This commit is contained in:
wushenghua
2017-05-10 17:19:39 +08:00
parent afafd9c07b
commit 6a48d33db7
907 changed files with 118717 additions and 35470 deletions
+10
View File
@@ -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$/,