Skip to content

Commit 64577d2

Browse files
committed
build(aio): disable 'global' support in webpack
This will be fixed in CLI once angular/angular-cli#8130 lands. -rw-r--r-- 1 iminar eng 14942 Oct 20 22:23 dist/0.b19e913fbdd6507d346b.chunk.js -rw-r--r-- 1 iminar eng 1535 Oct 20 22:23 dist/inline.5d66b81ec9e01af9d28d.bundle.js -rw-r--r-- 1 iminar eng 528395 Oct 20 22:23 dist/main.e36bb99245ca52ae546f.bundle.js -rw-r--r-- 1 iminar eng 37205 Oct 20 22:23 dist/polyfills.0dfca732c5a075c110d0.bundle.js
1 parent 09f4dfb commit 64577d2

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Diff for: aio/tools/cli-patches/patch.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const sh = require('shelljs');
33

44
PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched';
55

6-
// if (!fs.existsSync(PATCH_LOCK)) {
7-
// sh.touch(PATCH_LOCK);
8-
// }
6+
if (!fs.existsSync(PATCH_LOCK)) {
7+
sh.exec('patch -p0 -i tools/cli-patches/webpack-no-global.patch');
8+
sh.touch(PATCH_LOCK);
9+
}
910

Diff for: aio/tools/cli-patches/webpack-no-global.patch

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--- node_modules/@angular/cli/models/webpack-configs/browser.js 2017-10-20 22:11:38.000000000 -0700
2+
+++ node_modules/@angular/cli/models/webpack-configs/browser.js 2017-10-20 22:11:47.000000000 -0700
3+
@@ -105,11 +105,11 @@
4+
fs: 'empty',
5+
// `global` should be kept true, removing it resulted in a
6+
// massive size increase with Build Optimizer on AIO.
7+
- global: true,
8+
+ global: false,
9+
crypto: 'empty',
10+
tls: 'empty',
11+
net: 'empty',
12+
- process: true,
13+
+ process: false,
14+
module: false,
15+
clearImmediate: false,
16+
setImmediate: false

0 commit comments

Comments
 (0)