anyone here transpile es6 -> netsuite modules? ...
# suitescript
k
anyone here transpile es6 -> netsuite modules? i'm trying to figure out how to go from es6 -> amd format using the babel
transform-es2015-modules-amd
plugin and am not able to get it just right if I do something like
import { record } from 'N/record'
it transpiles to
Copy code
define(['N/record', 'N/search', 'N/xml'], function (_record, _search, _xml) { ... });
and prefixes all of the
record, search, xml
variables with
_record, _search, _xml
, so the output looks a little like
_record.record.load({ ... })
s
I transpile with TypeScript, and build to a UMD target which works nicely both in NS serverside and for local unit testing with Nodejs. I use
import * as record from "N/record"
in scripts.