我正在尝试在我们的项目中配置树状摇动,但不知道如何启用它。据我了解,UglifyJsPlugin
允许与webpack
一起使用树状摇动,但是我是否需要其他配置?
UglifyJsPlugin conf:
new UglifyJsPlugin({
"test": /\.js(\?.*)?$/i,
"extractComments": false,
"sourceMap": false,
"cache": true,
"parallel": true,
"uglifyOptions": {
"output": {
"ascii_only": true,
"comments": false,
"webkit": true
},
"ecma": 5,
"warnings": false,
"ie8": false,
"mangle": {
"safari10": true
},
"compress": {
"typeofs": false,
"inline": 3,
"pure_getters": true,
"passes": 3
}
}
}),