From 8821520c2af143bc5e0388a88422c7492911d6f3 Mon Sep 17 00:00:00 2001 From: Wykks Date: Wed, 4 Oct 2017 16:41:23 +0200 Subject: [PATCH] fix(@angular/cli): Disable comparisons feature in uglify compression in production --- .../@angular/cli/models/webpack-configs/production.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/@angular/cli/models/webpack-configs/production.ts b/packages/@angular/cli/models/webpack-configs/production.ts index 591bf95f4fd6..bde81969cffb 100644 --- a/packages/@angular/cli/models/webpack-configs/production.ts +++ b/packages/@angular/cli/models/webpack-configs/production.ts @@ -117,7 +117,13 @@ export function getProdConfig(wco: WebpackConfigOptions) { })); } - const uglifyCompressOptions: any = {}; + const uglifyCompressOptions: any = { + // Disabled because of an issue with Uglify breaking seemingly valid code: + // https://github.com/angular/angular-cli/issues/5804 + // Further investigation: + // https://github.com/mishoo/UglifyJS2/issues/2011 + comparisons: false + }; if (buildOptions.buildOptimizer) { // This plugin must be before webpack.optimize.UglifyJsPlugin.