diff --git a/aio/tools/cli-patches/patch.js b/aio/tools/cli-patches/patch.js index f175269d52..259d688d9e 100644 --- a/aio/tools/cli-patches/patch.js +++ b/aio/tools/cli-patches/patch.js @@ -3,7 +3,8 @@ const sh = require('shelljs'); const PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched'; -// if (!fs.existsSync(PATCH_LOCK)) { -// sh.touch(PATCH_LOCK); -// } +if (!fs.existsSync(PATCH_LOCK)) { + sh.exec('patch -p0 -i tools/cli-patches/webpack-no-global.patch'); + sh.touch(PATCH_LOCK); +} diff --git a/aio/tools/cli-patches/webpack-no-global.patch b/aio/tools/cli-patches/webpack-no-global.patch new file mode 100644 index 0000000000..335d86d70c --- /dev/null +++ b/aio/tools/cli-patches/webpack-no-global.patch @@ -0,0 +1,16 @@ +--- node_modules/@angular/cli/models/webpack-configs/browser.js 2017-10-20 22:11:38.000000000 -0700 ++++ node_modules/@angular/cli/models/webpack-configs/browser.js 2017-10-20 22:11:47.000000000 -0700 +@@ -105,11 +105,11 @@ + fs: 'empty', + // `global` should be kept true, removing it resulted in a + // massive size increase with Build Optimizer on AIO. +- global: true, ++ global: false, + crypto: 'empty', + tls: 'empty', + net: 'empty', +- process: true, ++ process: false, + module: false, + clearImmediate: false, + setImmediate: false