feat(aio): use new ngo (#17977)
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
entry: entryPoints,
|
||||
+ module: {
|
||||
+ rules: [
|
||||
+ {"test": /@angular\/.*\.js$/, "loader": "ngo-loader"},
|
||||
+ {"test": /\.js$/, "use": {loader: "ngo/webpack-loader", options: { sourceMap: true }}},
|
||||
+ ]
|
||||
+ },
|
||||
plugins: [
|
@ -4,8 +4,8 @@ const sh = require('shelljs');
|
||||
PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched';
|
||||
|
||||
if (!fs.existsSync(PATCH_LOCK)) {
|
||||
sh.exec('patch -p0 -i tools/cli-patches/ngo-loader.patch');
|
||||
sh.exec('patch -p0 -i node_modules/purify/angular-cli.patch');
|
||||
sh.exec('patch -p0 -i tools/cli-patches/ngo.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/uglify-config.patch');
|
||||
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.optimize.ModuleConcatenationPlugin(),
|
||||
new (require("purify/purify-webpack-plugin"))(),
|
||||
new (require("ngo").PurifyPlugin)(),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
mangle: true,
|
||||
|
Reference in New Issue
Block a user