I've spent a good amount of time getting my Angular 2 project to work with SystemJS, and now with AoT compilation as described here: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html
I'm running plugin-typescript with SystemJS to transpile typescript in browser during development. I've got systemjs builder using plugin-typescript to generate sfx bundle out of the AoT (ngc) output.
What I can't figure out is how to get systemjs-builder to tree-shake the angular AoT code. From what I can tell, it seems like systemjs-builder should support rollup (e.g. https://github.com/systemjs/builder/issues/709) but I don't think rollup is running for me when I set rollup:true
in my buildStatic options.
My typescriptOptions
from systemjs.config.js
transpiler: 'ts',
typescriptOptions: {
target: 'es5',
module: 'es6',
emitDecoratorMetadata: true,
experimentalDecorators: true
}
my buildStatic
call:
builder.buildStatic('app/main-aot.ts', paths.wwwroot + 'dst/build-aot.sfx.min.js', {
minify: true,
rollup: true
}).then(function (output) {
console.log(output.inlineMap);
}, function (err) {
console.log(err);
}),
I got the piece about output.inlineMap
from this github ticket: https://github.com/systemjs/builder/issues/639
But it isn't clear to me what I should expect. Right now it simply outputs {}
This is all really new to me, I might be completely misunderstanding something. Looking for anyone to help me identify whether or not rollup is running, confirm that it should be possible, and hopefully get this sorted out if it is.