From ff15509bc7c2c6640e87fe428e4bbb5b1ccb6276 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 7 Jun 2017 23:47:35 -0700 Subject: [PATCH] build(aio): turn on webpack 3.0 scope-hoisting --- aio/tools/cli-patches/patch.js | 1 + aio/tools/cli-patches/scope-hoisting.patch | 10 ++++++++++ aio/tools/cli-patches/uglify-config.patch | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 aio/tools/cli-patches/scope-hoisting.patch diff --git a/aio/tools/cli-patches/patch.js b/aio/tools/cli-patches/patch.js index 1d6cce074a..28a61bdba4 100644 --- a/aio/tools/cli-patches/patch.js +++ b/aio/tools/cli-patches/patch.js @@ -7,5 +7,6 @@ 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/scope-hoisting.patch && patch -p0 -i tools/cli-patches/uglify-config.patch`); } diff --git a/aio/tools/cli-patches/scope-hoisting.patch b/aio/tools/cli-patches/scope-hoisting.patch new file mode 100644 index 0000000000..c094fc8157 --- /dev/null +++ b/aio/tools/cli-patches/scope-hoisting.patch @@ -0,0 +1,10 @@ +--- 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 +@@ -85,6 +85,7 @@ + 'NODE_ENV': 'production' + }), + new webpack.HashedModuleIdsPlugin(), ++ new webpack.optimize.ModuleConcatenationPlugin(), + new (require("purify/purify-webpack-plugin"))(), + new webpack.optimize.UglifyJsPlugin({ + mangle: true, diff --git a/aio/tools/cli-patches/uglify-config.patch b/aio/tools/cli-patches/uglify-config.patch index 29b656bf02..3d17d3c9d4 100644 --- a/aio/tools/cli-patches/uglify-config.patch +++ b/aio/tools/cli-patches/uglify-config.patch @@ -1,6 +1,6 @@ --- 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 @@ +@@ -82,7 +82,7 @@ new (require("purify/purify-webpack-plugin"))(), new webpack.optimize.UglifyJsPlugin({ mangle: { screw_ie8: true },