In `aio/`, we have a mechanism to apply patches in a `postinstall` hook.
See `aio/tools/cli-patches/README.md` for more info.
Previously, we had to update `aio/tools/cli-patches/patch.js` to list
each `.patch` file separately. While working on #37688, I found it
helpful for the script to automatically pick up `.patch` files.
This commit updates the script to automatically pick up and apply
`.patch` files from the `aio/tools/cli-patches/` directory. If one wants
to keep a `.patch` file but not apply it, they can change the file's
extension or move it to a sub-directory (without having to update the
script).
PR Close#37896
This reverts commit f0d530b4de38f71c759e42afc8f3d7531eb1b1fb.
cli rc.8 reintroduces the node polyfill which causes size regression,
so I'm putting the patch back in.
-rw-r--r-- 1 iminar eng 14880 Nov 1 12:11 dist/0.b19e913fbdd6507d346b.chunk.js
-rw-r--r-- 1 iminar eng 1533 Nov 1 12:11 dist/inline.25600c3b48de18b97581.bundle.js
-rw-r--r-- 1 iminar eng 486476 Nov 1 12:11 dist/main.d1292a34401056535884.bundle.js
-rw-r--r-- 1 iminar eng 37070 Nov 1 12:11 dist/polyfills.0dfca732c5a075c110d0.bundle.js
PR Close#19702
This will be fixed in CLI once https://github.com/angular/angular-cli/pull/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
PR Close#19702
-rw-r--r-- 1 iminar eng 84219 Oct 19 21:37 dist/0.0f327734d18211139822.chunk.js
-rw-r--r-- 1 iminar eng 14942 Oct 19 21:37 dist/4.c719ac5645940382cdce.chunk.js
-rw-r--r-- 1 iminar eng 1560 Oct 19 21:37 dist/inline.887757679ff553e20b54.bundle.js
-rw-r--r-- 1 iminar eng 492354 Oct 19 21:37 dist/main.5e5dc9ed980c9f5dc2bd.bundle.js
-rw-r--r-- 1 iminar eng 37402 Oct 19 21:37 dist/polyfills.f8409a9eb69060ac1aa6.bundle.js
PR Close#19702
-rw-r--r-- 1 iminar eng 14942 Oct 13 14:52 dist/0.b19e913fbdd6507d346b.chunk.js
-rw-r--r-- 1 iminar eng 1535 Oct 13 14:52 dist/inline.6ca24f1c3b848103b041.bundle.js
-rw-r--r-- 1 iminar eng 567802 Oct 13 14:52 dist/main.c8183a2c0116782ca366.bundle.js
-rw-r--r-- 1 iminar eng 37402 Oct 13 14:52 dist/polyfills.f8409a9eb69060ac1aa6.bundle.js
PR Close#19702
Running the patch script on Windows (with `patch` available) yields an invalid syntax warning, and does not apply patches.
```
kamik@T460p MINGW64 /d/work/angular/aio (master)
$ yarn postinstall
yarn postinstall v0.24.6
$ node tools/cli-patches/patch.js && uglifyjs node_modules/lunr/lunr.js -c -m -o src/assets/js/lunr.min.js --source-map
The syntax of the command is incorrect.
Done in 1.52s.
```