I have an existing System.js bundle (that is, a single file containing many System.register calls) that is produced by the TypeScript compiler with module="System". What I want to do is build some new bundles from subtrees of the modules represented in this file. For example, say my TS-generated bundle file contains modules A, B, and C. I want to use the System.js builder to build new two bundles using A and B respectively as entry points.
I tried to do this using the "bundles" config property without any luck:
var path = require("path");
var Builder = require('systemjs-builder');
function build () {
var builder = new Builder(
undefined,
"build/renderer-system-config.js"
);
builder.bundle("renderer/index", "out-lol.js")
.then(() => {
console.log("build success");
})
.catch(e => {
console.error(e);
});
}
build();
My expectation was that thanks to the "bundle" property in my config, when I call builder.bundle("renderer/index", ...), System.js would go and fetch renderer/out.js. This seems not to be the case:
Error on fetch for renderer/index at file:///D:/a/b/src/renderer/index
Error: ENOENT: no such file or directory, open 'D:\a\b\src\renderer\index'
at Error (native)
originalErr:
{ Error: ENOENT: no such file or directory, open 'D:\a\b\src\renderer\index'
at Error (native)
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'D:\\a\\b\\src\\renderer\\index' } }
Hello,
I have an existing System.js bundle (that is, a single file containing many System.register calls) that is produced by the TypeScript compiler with module="System". What I want to do is build some new bundles from subtrees of the modules represented in this file. For example, say my TS-generated bundle file contains modules A, B, and C. I want to use the System.js builder to build new two bundles using A and B respectively as entry points.
I tried to do this using the "bundles" config property without any luck:
renderer-system-config.js
renderer/out.js contains
and a bunch of other System.register'd modules.
My expectation was that thanks to the "bundle" property in my config, when I call
builder.bundle("renderer/index", ...)
, System.js would go and fetch renderer/out.js. This seems not to be the case:Does anyone know the right way to approach this?