diff --git a/aio/package.json b/aio/package.json index c3254ea710..3bba7ded2d 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 && patch -p0 -i tools/cli-patches/uglify-config.patch'); }\"", + "postinstall": "node tools/cli-patches/patch.js", "build-ie-polyfills": "webpack -p src/ie-polyfills.js src/generated/ie-polyfills.min.js" }, "private": true, diff --git a/aio/tools/cli-patches/patch.js b/aio/tools/cli-patches/patch.js new file mode 100644 index 0000000000..1d6cce074a --- /dev/null +++ b/aio/tools/cli-patches/patch.js @@ -0,0 +1,11 @@ +const fs = require('fs'); +const 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`); +}