|
|
@@ -1,5 +1,6 @@
|
|
|
const path = require('path');
|
|
|
-// const UglifyPlugin = require('uglifyjs-webpack-plugin');
|
|
|
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
|
+
|
|
|
module.exports = {
|
|
|
// 基本路径
|
|
|
/* 部署生产环境和开发环境下的URL:可对当前环境进行区分,baseUrl 从 Vue CLI 3.3 起已弃用,要使用publicPath */
|
|
|
@@ -43,16 +44,21 @@ module.exports = {
|
|
|
}
|
|
|
},
|
|
|
minimizer: [
|
|
|
- // new UglifyPlugin({
|
|
|
- // uglifyOptions: {
|
|
|
- // compress: {
|
|
|
- // warnings: false,
|
|
|
- // drop_console: true, // console
|
|
|
- // drop_debugger: false,
|
|
|
- // pure_funcs: [ 'console.log' ] // 移除console
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
+ new UglifyJsPlugin({
|
|
|
+ uglifyOptions: {
|
|
|
+ // 删除注释
|
|
|
+ output: {
|
|
|
+ comments: false
|
|
|
+ },
|
|
|
+ // 删除console debugger 删除警告
|
|
|
+ compress: {
|
|
|
+ warnings: false,
|
|
|
+ drop_console: true, //console
|
|
|
+ drop_debugger: false,
|
|
|
+ pure_funcs: [ 'console.log' ] //移除console
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
]
|
|
|
};
|
|
|
Object.assign(config, {
|