From 59136fdbe4593f6d192bbb5e6f03a2018acaaeaa Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 12 May 2017 13:58:11 -0700 Subject: [PATCH] build(aio): add ngo + purify --- aio/.angular-cli.json | 2 +- aio/package.json | 6 +++++- aio/tools/cli-patches/ngo-loader.patch | 14 ++++++++++++++ aio/yarn.lock | 22 ++++++++++++++++++++-- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 aio/tools/cli-patches/ngo-loader.patch diff --git a/aio/.angular-cli.json b/aio/.angular-cli.json index 1cf205d9fb..90123fef4e 100644 --- a/aio/.angular-cli.json +++ b/aio/.angular-cli.json @@ -26,7 +26,7 @@ "styles.scss" ], "scripts": [ - + "../node_modules/tslib/tslib.js" ], "environmentSource": "environments/environment.ts", "environments": { diff --git a/aio/package.json b/aio/package.json index 89b2a2c90e..29cd77f2d3 100644 --- a/aio/package.json +++ b/aio/package.json @@ -33,7 +33,8 @@ "generate-plunkers": "node ./tools/plunker-builder/generatePlunkers", "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/" + "sw-copy": "cp node_modules/@angular/service-worker/bundles/worker-basic.min.js dist/", + "postinstall": "PATCH_LOCK=node_modules/@angular/cli/models/webpack-configs/.patched; if [ ! -e $PATCH_LOCK ]; then touch $PATCH_LOCK; patch -p0 -i tools/cli-patches/ngo-loader.patch && patch -p0 -i node_modules/purify/angular-cli.patch; fi" }, "private": true, "dependencies": { @@ -51,7 +52,10 @@ "@angular/service-worker": "^1.0.0-beta.12", "core-js": "^2.4.1", "ng-pwa-tools": "^0.0.10", + "ngo-loader": "alxhub/ngo", + "purify": "igorminar/purify", "rxjs": "^5.2.0", + "tslib": "^1.7.0", "zone.js": "^0.8.4" }, "devDependencies": { diff --git a/aio/tools/cli-patches/ngo-loader.patch b/aio/tools/cli-patches/ngo-loader.patch new file mode 100644 index 0000000000..84fa456320 --- /dev/null +++ b/aio/tools/cli-patches/ngo-loader.patch @@ -0,0 +1,14 @@ +--- node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-12 14:30:22.000000000 -0700 ++++ node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-12 14:32:23.000000000 -0700 +@@ -68,6 +68,11 @@ + } + return { + entry: entryPoints, ++ module: { ++ rules: [ ++ {"test": /@angular\/.*\.js$/, "loader": "ngo-loader"}, ++ ] ++ }, + plugins: [ + new webpack.EnvironmentPlugin({ + 'NODE_ENV': 'production' diff --git a/aio/yarn.lock b/aio/yarn.lock index e501b878bc..f2eac7996c 100644 --- a/aio/yarn.lock +++ b/aio/yarn.lock @@ -4679,6 +4679,12 @@ ng-pwa-tools@^0.0.10: sha1 "^1.1.1" ts-node "^3.0.2" +ngo-loader@alxhub/ngo: + version "0.0.2" + resolved "https://codeload.github.com/alxhub/ngo/tar.gz/5dd9616f88419747699f72c4ec132feb72d37931" + dependencies: + typescript "2.1" + no-case@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.1.tgz#7aeba1c73a52184265554b7dc03baf720df80081" @@ -5620,6 +5626,10 @@ punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +purify@igorminar/purify: + version "0.0.5" + resolved "https://codeload.github.com/igorminar/purify/tar.gz/f2605c677ea5b248c5ee71f31be6e1dd883a675b" + q@1.4.1, q@^1.1.2, q@^1.4.1, q@~1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" @@ -6948,13 +6958,13 @@ tmp@0.0.27: dependencies: os-tmpdir "~1.0.0" -tmp@0.0.28: +tmp@0.0.28, tmp@0.0.x: version "0.0.28" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.28.tgz#172735b7f614ea7af39664fa84cf0de4e515d120" dependencies: os-tmpdir "~1.0.1" -tmp@0.0.30, tmp@0.0.x: +tmp@0.0.30: version "0.0.30" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" dependencies: @@ -7091,6 +7101,10 @@ tsickle@^0.21.0: source-map "^0.5.6" source-map-support "^0.4.2" +tslib@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.7.0.tgz#6e8366695f72961252b35167b0dd4fbeeafba491" + tslint@^4.1.1, tslint@~4.5.0: version "4.5.1" resolved "https://registry.yarnpkg.com/tslint/-/tslint-4.5.1.tgz#05356871bef23a434906734006fc188336ba824b" @@ -7146,6 +7160,10 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +typescript@2.1: + version "2.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.1.6.tgz#40c7e6e9e5da7961b7718b55505f9cac9487a607" + typescript@2.2.0, "typescript@>=2.0.0 <2.3.0": version "2.2.0" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.0.tgz#626f2fc70087d2480f21ebb12c1888288c8614e3"