mirror of
https://github.com/wu736139669/ASHEBShop-h5.git
synced 2026-08-05 05:55:36 +00:00
压缩
This commit is contained in:
@@ -9,6 +9,16 @@ module.exports = {
|
||||
path : path.resolve(__dirname),
|
||||
filename : '[name].js'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({ // <-- 减少 React 大小的关键
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.DedupePlugin(), //删除类似的重复代码
|
||||
new webpack.optimize.UglifyJsPlugin(), //最小化一切
|
||||
new webpack.optimize.AggressiveMergingPlugin()//合并块
|
||||
],
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.css$/,
|
||||
|
||||
Reference in New Issue
Block a user