angular-cli --prod (AOT) polyfills module doesn't remove Angular 2 Compiler

Viewed 573

I ran the following command to get the stats.json

 node --max-old-space-size=4096 .\node_modules\@angular\cli\bin\ng build --prod --stats-json

Then used WebPack Bundle Analyzer to inspect my project.

When running AOT (implicit with --prod flag) I see a compiler is bundled up in my polyfills output, which is not what I expected as I'm running Ahead of Time Compilation.

What should I change to stop this compiler being bundled up? Or where should I check?

Webpack Bundle Analyzer output

2 Answers

OK I found the problem - duh.

Someone had added import '@angular/compiler/bundles/compiler.umd'; to the pollyfills.ts directly.

Related