Skip to content

Commit

Permalink
fix(@angular/cli): use 3 uglify passes with build-optimizer
Browse files Browse the repository at this point in the history
PURE comments work best with 3 passes.
See webpack/webpack#2899 (comment) for context and an example.

Thanks to @kzc for highlighting this.
  • Loading branch information
filipesilva authored and hansl committed Aug 3, 2017
1 parent a8d3806 commit df6d331
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@angular/cli/models/webpack-configs/production.ts
Expand Up @@ -98,6 +98,9 @@ export const getProdConfig = function (wco: WebpackConfigOptions) {
// This plugin must be before webpack.optimize.UglifyJsPlugin.
extraPlugins.push(new PurifyPlugin());
uglifyCompressOptions.pure_getters = true;
// PURE comments work best with 3 passes.
// See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
uglifyCompressOptions.passes = 3;
}

return {
Expand Down

0 comments on commit df6d331

Please sign in to comment.