We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As description of #35, we will following esbuild bundle commonjs strategy.
module.exports = 1 // compiled var require_a = __commonJS({ "a.js"(exports, module) { module.exports = 1; } });
export const a = 1; // compiled var a; var init_b = __esm({ "b.js"() { a = 1; } });
__commonJS
require
require('esm'); // compiled var require_a = __commonJS({ "a.js"(exports, module) { (init_esm(), __toCommonJS(esm_exports)); } });
require('cjs'); // compiled var require_a = __commonJS({ "a.js"(exports, module) { require_cjs(); } });
import cjs from './cjs' console.log(cjs) // compiled var import_cjs = __toESM(require_cjs()); console.log(import_cjs.default)
import esm from './esm' console.log(esm) // compiled init_esm() console.log(esm)
__esm
export function a(){} // compiled function a(){} var b_ns = { get a () => a } var init_b = __esm({ "b.js"() { } });
export default function a(){} // compiled function a(){} var b_ns = { get default () => a } var init_b = __esm({ "b.js"() { } });
export default 1 export const a = 1 // compiled var a, b_default; var b_ns = { get default () => b_default, get a() => a } var init_b = __esm({ "b.js"() { b_default = 1 a = 1 } });
move
cjs_compat
ident
export * from commonjs
The text was updated successfully, but these errors were encountered:
underfin
No branches or pull requests
Summary
As description of #35, we will following esbuild bundle commonjs strategy.
Linker
Module codegen
Wrap module to lazy execute
Commonjs module codegen
__commonJS
require
call to init module expr callEsm module codegen
Wrapped esm module codegen
__esm
Implemention
move
apicjs_compat
mode optionident
api to ident wrap module functionexport * from commonjs
at entryThe text was updated successfully, but these errors were encountered: