提交
This commit is contained in:
30
webpack.config.js
Normal file
30
webpack.config.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 不是真实的 webpack 配置,仅为兼容 webstorm 和 intellij idea 代码跳转
|
||||
* ref: https://github.com/umijs/umi/issues/1109#issuecomment-423380125
|
||||
*/
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
// 删除注释
|
||||
output:{
|
||||
comments: false
|
||||
},
|
||||
compress: {
|
||||
drop_console: true, // 删除所有调式带有console的
|
||||
drop_debugger: true,
|
||||
pure_funcs: ['console.log'] // 删除console.log
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': require('path').resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user