我花了很多时间让我的 Angular 2 项目使用 SystemJS,现在使用 AoT 编译,如下所述:https ://angular.io/docs/ts/latest/cookbook/aot-compiler.html
我正在使用 SystemJS 运行 plugin-typescript 以在开发期间在浏览器中转换 typescript。我有 systemjs builder 使用 plugin-typescript 从 AoT (ngc) 输出中生成 sfx 包。
我想不通的是如何让 systemjs-builder 对 Angular AoT 代码进行摇树摇动。据我所知,似乎 systemjs-builder 应该支持汇总(例如https://github.com/systemjs/builder/issues/709),但是当我rollup:true
在 buildStatic 中设置时,我认为汇总不会为我运行选项。
我typescriptOptions
来自systemjs.config.js
transpiler: 'ts',
typescriptOptions: {
target: 'es5',
module: 'es6',
emitDecoratorMetadata: true,
experimentalDecorators: true
}
我的buildStatic
电话:
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);
}),
我output.inlineMap
从这张 github 票中得到了关于:https ://github.com/systemjs/builder/issues/639
但我不清楚我应该期待什么。现在它只是输出{}
这对我来说真的很新鲜,我可能完全误解了一些东西。寻找任何人来帮助我确定汇总是否正在运行,确认它应该是可能的,如果是的话,希望能解决这个问题。