A simple module bundler that uses Layer 0 of compartments, module blocks and (if you need dynamic import support) import reflection.
API:
function bundle(entryPointURL: string, allowDynamicImport: boolean): string;
where:
entryPointURL
is the absolute URL of the entry pointallowDynamicImport
can be set totrue
to allow the bundled code to use dynamic import to load modules that are not part of the bundle- the result is the source code of the bundle, as a string
The resulting source code can then be run directly.