我运行了以下命令来获取 stats.json
node --max-old-space-size=4096 .\node_modules\@angular\cli\bin\ng build --prod --stats-json
然后用了WebPack Bundle Analyzer检查我的项目。
当运行 AOT 时(隐含 --prod
标志)我看到编译器捆绑在我的 polyfills 输出中,这不是我所期望的运行提前编译。
我应该改变什么来阻止这个编译器被捆绑?或者我应该在哪里检查?
最佳答案
好的,我发现了问题 - 呃。
有人直接将 import '@angular/compiler/bundles/compiler.umd';
添加到 pollyfills.ts
。
关于angular-cli --prod (AOT) polyfills 模块不会删除 Angular 2 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46287794/