From 8e2f72c644984e3148ea901165a897514bcce9a5 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 24 May 2017 15:41:41 -0700 Subject: [PATCH] build(aio): turn on pure_getters option in uglify --- aio/package.json | 2 +- aio/tools/cli-patches/uglify-config.patch | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 aio/tools/cli-patches/uglify-config.patch diff --git a/aio/package.json b/aio/package.json index f7a65f1ec2..6396d0e221 100644 --- a/aio/package.json +++ b/aio/package.json @@ -34,7 +34,7 @@ "generate-zips": "node ./tools/example-zipper/generateZips", "sw-manifest": "ngu-sw-manifest --dist dist --in ngsw-manifest.json --out dist/ngsw-manifest.json", "sw-copy": "cp node_modules/@angular/service-worker/bundles/worker-basic.min.js dist/", - "postinstall": "node --eval \"const fs=require('fs'), sh=require('shelljs'), PATCH_LOCK='node_modules/@angular/cli/models/webpack-configs/.patched'; if (!fs.existsSync(PATCH_LOCK)) { sh.touch(PATCH_LOCK); sh.exec('patch -p0 -i tools/cli-patches/ngo-loader.patch && patch -p0 -i node_modules/purify/angular-cli.patch'); }\"", + "postinstall": "node --eval \"const fs=require('fs'), sh=require('shelljs'), PATCH_LOCK='node_modules/@angular/cli/models/webpack-configs/.patched'; if (!fs.existsSync(PATCH_LOCK)) { sh.touch(PATCH_LOCK); sh.exec('patch -p0 -i tools/cli-patches/ngo-loader.patch && patch -p0 -i node_modules/purify/angular-cli.patch && patch -p0 -i tools/cli-patches/uglify-config.patch'); }\"", "build-ie-polyfills": "webpack -p src/ie-polyfills.js src/generated/ie-polyfills.min.js" }, "private": true, diff --git a/aio/tools/cli-patches/uglify-config.patch b/aio/tools/cli-patches/uglify-config.patch new file mode 100644 index 0000000000..921c3c431b --- /dev/null +++ b/aio/tools/cli-patches/uglify-config.patch @@ -0,0 +1,11 @@ +--- node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-24 15:36:43.000000000 -0700 ++++ node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-24 15:37:04.000000000 -0700 +@@ -81,7 +81,7 @@ + new (require("purify/purify-webpack-plugin"))(), + new webpack.optimize.UglifyJsPlugin({ + mangle: { screw_ie8: true }, +- compress: { screw_ie8: true, warnings: buildOptions.verbose }, ++ compress: { screw_ie8: true, warnings: buildOptions.verbose, pure_getters: true }, + sourceMap: buildOptions.sourcemaps + }) + ].concat(extraPlugins)