feat(aio): use new ngo (#17977)
This commit is contained in:
		
							parent
							
								
									671a175dfb
								
							
						
					
					
						commit
						abbac4bc69
					
				| @ -64,8 +64,7 @@ | |||||||
|     "core-js": "^2.4.1", |     "core-js": "^2.4.1", | ||||||
|     "jasmine": "^2.6.0", |     "jasmine": "^2.6.0", | ||||||
|     "ng-pwa-tools": "^0.0.10", |     "ng-pwa-tools": "^0.0.10", | ||||||
|     "ngo-loader": "alxhub/ngo", |     "ngo": "angular/ngo", | ||||||
|     "purify": "igorminar/purify", |  | ||||||
|     "rxjs": "^5.2.0", |     "rxjs": "^5.2.0", | ||||||
|     "tslib": "^1.7.1", |     "tslib": "^1.7.1", | ||||||
|     "web-animations-js": "^2.2.5", |     "web-animations-js": "^2.2.5", | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ | |||||||
| set -u -e -o pipefail | set -u -e -o pipefail | ||||||
| 
 | 
 | ||||||
| declare -A limitUncompressed | declare -A limitUncompressed | ||||||
| limitUncompressed=(["inline"]=1600 ["main"]=600000 ["polyfills"]=40000) | limitUncompressed=(["inline"]=1600 ["main"]=600000 ["polyfills"]=35000) | ||||||
| declare -A limitGzip7 | declare -A limitGzip7 | ||||||
| limitGzip7=(["inline"]=1000 ["main"]=140000 ["polyfills"]=12500) | limitGzip7=(["inline"]=1000 ["main"]=140000 ["polyfills"]=12500) | ||||||
| declare -A limitGzip9 | declare -A limitGzip9 | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ | |||||||
|          entry: entryPoints, |          entry: entryPoints, | ||||||
| +        module: {
 | +        module: {
 | ||||||
| +            rules: [
 | +            rules: [
 | ||||||
| +                {"test": /@angular\/.*\.js$/, "loader": "ngo-loader"},
 | +                {"test": /\.js$/, "use": {loader: "ngo/webpack-loader", options: { sourceMap: true }}},
 | ||||||
| +            ]
 | +            ]
 | ||||||
| +        },
 | +        },
 | ||||||
|          plugins: [ |          plugins: [ | ||||||
| @ -4,8 +4,8 @@ const sh = require('shelljs'); | |||||||
| PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched'; | PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched'; | ||||||
| 
 | 
 | ||||||
| if (!fs.existsSync(PATCH_LOCK)) { | if (!fs.existsSync(PATCH_LOCK)) { | ||||||
|   sh.exec('patch -p0 -i tools/cli-patches/ngo-loader.patch'); |   sh.exec('patch -p0 -i tools/cli-patches/ngo.patch'); | ||||||
|   sh.exec('patch -p0 -i node_modules/purify/angular-cli.patch'); |   sh.exec('patch -p0 -i tools/cli-patches/purify.patch'); | ||||||
|   sh.exec('patch -p0 -i tools/cli-patches/scope-hoisting.patch'); |   sh.exec('patch -p0 -i tools/cli-patches/scope-hoisting.patch'); | ||||||
|   sh.exec('patch -p0 -i tools/cli-patches/uglify-config.patch'); |   sh.exec('patch -p0 -i tools/cli-patches/uglify-config.patch'); | ||||||
|   sh.touch(PATCH_LOCK); |   sh.touch(PATCH_LOCK); | ||||||
|  | |||||||
							
								
								
									
										10
									
								
								aio/tools/cli-patches/purify.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								aio/tools/cli-patches/purify.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | |||||||
|  | --- node_modules/@angular/cli/models/webpack-configs/production.js	2017-05-11 12:10:46.000000000 -0700
 | ||||||
|  | +++ node_modules/@angular/cli/models/webpack-configs/production.js	2017-05-11 12:10:11.000000000 -0700
 | ||||||
|  | @@ -73,6 +73,7 @@
 | ||||||
|  |                  'NODE_ENV': 'production' | ||||||
|  |              }), | ||||||
|  |              new webpack.HashedModuleIdsPlugin(), | ||||||
|  | +            new (require("ngo").PurifyPlugin)(),
 | ||||||
|  |              new webpack.optimize.UglifyJsPlugin({ | ||||||
|  |                  mangle: { screw_ie8: true }, | ||||||
|  |                  compress: { screw_ie8: true, warnings: buildOptions.verbose }, | ||||||
| @ -5,6 +5,6 @@ | |||||||
|              }), |              }), | ||||||
|              new webpack.HashedModuleIdsPlugin(), |              new webpack.HashedModuleIdsPlugin(), | ||||||
| +            new webpack.optimize.ModuleConcatenationPlugin(),
 | +            new webpack.optimize.ModuleConcatenationPlugin(),
 | ||||||
|              new (require("purify/purify-webpack-plugin"))(), |              new (require("ngo").PurifyPlugin)(), | ||||||
|              new webpack.optimize.UglifyJsPlugin({ |              new webpack.optimize.UglifyJsPlugin({ | ||||||
|                  mangle: true, |                  mangle: true, | ||||||
|  | |||||||
| @ -4426,7 +4426,7 @@ macaddress@^0.2.8: | |||||||
|   version "0.2.8" |   version "0.2.8" | ||||||
|   resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" |   resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" | ||||||
| 
 | 
 | ||||||
| magic-string@^0.19.0: | magic-string@^0.19.0, magic-string@^0.19.1: | ||||||
|   version "0.19.1" |   version "0.19.1" | ||||||
|   resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.19.1.tgz#14d768013caf2ec8fdea16a49af82fc377e75201" |   resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.19.1.tgz#14d768013caf2ec8fdea16a49af82fc377e75201" | ||||||
|   dependencies: |   dependencies: | ||||||
| @ -4705,11 +4705,14 @@ ng-pwa-tools@^0.0.10: | |||||||
|     sha1 "^1.1.1" |     sha1 "^1.1.1" | ||||||
|     ts-node "^3.0.2" |     ts-node "^3.0.2" | ||||||
| 
 | 
 | ||||||
| ngo-loader@alxhub/ngo: | ngo@angular/ngo: | ||||||
|   version "0.0.6" |   version "0.0.11" | ||||||
|   resolved "https://codeload.github.com/alxhub/ngo/tar.gz/4b589d8ffb2b6278c387fc492bf17fd42227508f" |   resolved "https://codeload.github.com/angular/ngo/tar.gz/09980bf1006a20963a7273467c20d28216035d16" | ||||||
|   dependencies: |   dependencies: | ||||||
|     typescript "2.1" |     loader-utils "^1.1.0" | ||||||
|  |     magic-string "^0.19.1" | ||||||
|  |     source-map "^0.5.6" | ||||||
|  |     typescript "^2.3.3" | ||||||
| 
 | 
 | ||||||
| no-case@^2.2.0: | no-case@^2.2.0: | ||||||
|   version "2.3.1" |   version "2.3.1" | ||||||
| @ -5652,12 +5655,6 @@ punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: | |||||||
|   version "1.4.1" |   version "1.4.1" | ||||||
|   resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" |   resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" | ||||||
| 
 | 
 | ||||||
| purify@igorminar/purify: |  | ||||||
|   version "0.0.25" |  | ||||||
|   resolved "https://codeload.github.com/igorminar/purify/tar.gz/1b4f00d9c29efad03acc10a69ce280bdf59fc9cb" |  | ||||||
|   dependencies: |  | ||||||
|     tslib "^1.7.1" |  | ||||||
| 
 |  | ||||||
| q@1.4.1, q@^1.1.2, q@^1.4.1, q@~1.4.1: | q@1.4.1, q@^1.1.2, q@^1.4.1, q@~1.4.1: | ||||||
|   version "1.4.1" |   version "1.4.1" | ||||||
|   resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" |   resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" | ||||||
| @ -7186,14 +7183,14 @@ typedarray@^0.0.6: | |||||||
|   version "0.0.6" |   version "0.0.6" | ||||||
|   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" |   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" | ||||||
| 
 | 
 | ||||||
| typescript@2.1: | typescript@2.3.2, "typescript@>=2.0.0 <2.4.0": | ||||||
|   version "2.1.6" |  | ||||||
|   resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.1.6.tgz#40c7e6e9e5da7961b7718b55505f9cac9487a607" |  | ||||||
| 
 |  | ||||||
| typescript@2.3.2, "typescript@>=2.0.0 <2.4.0", typescript@^2.2.1: |  | ||||||
|   version "2.3.2" |   version "2.3.2" | ||||||
|   resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984" |   resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984" | ||||||
| 
 | 
 | ||||||
|  | typescript@^2.2.1, typescript@^2.3.3: | ||||||
|  |   version "2.4.1" | ||||||
|  |   resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc" | ||||||
|  | 
 | ||||||
| uglify-js@^2.6, uglify-js@^2.8.27, uglify-js@~2.8.22: | uglify-js@^2.6, uglify-js@^2.8.27, uglify-js@~2.8.22: | ||||||
|   version "2.8.28" |   version "2.8.28" | ||||||
|   resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.28.tgz#e335032df9bb20dcb918f164589d5af47f38834a" |   resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.28.tgz#e335032df9bb20dcb918f164589d5af47f38834a" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user