Skip to content

Commit 1cd9eda

Browse files
committed
更新webpack配置
1 parent 33217b2 commit 1cd9eda

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

sample/Util.Samples.Webs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@angular/router": "6.1.0-beta.1",
2828
"@angular/compiler-cli": "6.1.0-beta.1",
2929
"@ngtools/webpack": "6.1.0-rc.0",
30+
"@angular-devkit/build-optimizer": "^0.7.0-beta.2",
3031
"@angular/flex-layout": "6.0.0-beta.16",
3132
"hammerjs": "2.0.8",
3233
"@angular/cdk": "6.3.0",
@@ -60,7 +61,6 @@
6061
"postcss-loader": "2.1.5",
6162
"url-loader": "1.0.1",
6263
"webpack-hot-middleware": "2.22.2",
63-
"angular-router-loader": "0.8.5",
64-
"uglifyjs-webpack-plugin": "1.2.5"
64+
"angular-router-loader": "0.8.5"
6565
}
6666
}

sample/Util.Samples.Webs/webpack.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const webpack = require('webpack');
33
var Extract = require("extract-text-webpack-plugin");
44
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
5-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
65

76
module.exports = (env) => {
87
//是否开发环境
@@ -34,6 +33,7 @@ module.exports = (env) => {
3433
module: {
3534
rules: [
3635
{ test: /\.ts$/, use: isDev ? ['awesome-typescript-loader?silent=true', 'angular-router-loader'] : ['@ngtools/webpack'] },
36+
{ test: /\.js$/, loader: '@angular-devkit/build-optimizer/webpack-loader', options: { sourceMap: false } },
3737
{ test: /\.html$/, use: 'html-loader?minimize=false' }
3838
]
3939
},
@@ -52,8 +52,7 @@ module.exports = (env) => {
5252
new AngularCompilerPlugin({
5353
tsConfigPath: 'tsconfig.json',
5454
entryModule: "Typings/app/app.module#AppModule"
55-
}),
56-
new UglifyJsPlugin()
55+
})
5756
])
5857
}
5958

sample/Util.Samples.Webs/webpack.config.util.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ module.exports = (env) => {
3838
new webpack.DllPlugin({
3939
path: getPath("wwwroot/dist/[name]-manifest.json"),
4040
name: "[name]"
41-
}),
42-
new webpack.optimize.ModuleConcatenationPlugin()
43-
].concat(isDev ? [] : [
44-
new webpack.optimize.UglifyJsPlugin()
45-
])
41+
})
42+
]
4643
}
4744
}

0 commit comments

Comments
 (0)