我這裏描述花了很多時間量好讓我的角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的內容進行深入的定義,但是我能夠很好地解決我自己的問題,以便繼續前進。 –