Transpile to ESM (Browser) #1853
Unanswered
miguelramos
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can bun transpile a base code in commonjs to esm? Like rollup can do with plugin commonjs. When using option platform: browser some requires are not converted to import, but bun scan detects that:
const transpiler = new Transpiler({ loader: "js", platform: 'browser' });
Also, exports aren't always transpiled or converted like the example above:
const transpiler = new Transpiler({ define: { 'process.env.NODE_ENV': JSON.stringify('production') }, loader: "js", platform: 'browser' });
Beta Was this translation helpful? Give feedback.
All reactions