我这里描述花了很多时间量好让我的角2项目,SystemJS工作,现在用AOT编译:https://angular.io/docs/ts/latest/cookbook/aot-compiler.html捆绑Angular2 AOT与systemjs建设者和汇总树摇
我使用SystemJS运行plugin-typescript在开发过程中在浏览器中传输打字稿。我已经有了使用plugin-typescript的systemjs生成器来生成AoT(ngc)输出中的sfx包。
我无法弄清楚的是如何让systemjs-builder树状摇角的AoT代码。从我所知道的情况来看,systemjs-builder似乎应该支持汇总(例如https://github.com/systemjs/builder/issues/709),但当我在buildStatic选项中设置rollup:true
时,我不认为汇总正在运行。
我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);
}),
我从这个GitHub的票拿到了一块约output.inlineMap
:https://github.com/systemjs/builder/issues/639
但它不是我清楚我应该期待什么。现在它只是输出{}
这对我来说真的很新,我可能完全误解了一些东西。寻找任何人来帮助我确定汇总是否正在运行,确认它应该是可能的,并希望如果它是这样整理出来。
我一直运行到同样的问题我自己。并想知道你是否找到了你原来的问题的答案。 –
@ N.Schipper我发布了一个解决方案,下面我经过一系列的试验和错误后登陆。不幸的是,我从来没有对inlineMap的内容进行深入的定义,但是我能够很好地解决我自己的问题,以便继续前进。 –