new webpack.optimize.UglifyJsPlugin({
//刪除註釋
output:{
comments:false
},
//刪除console 和 debugger 刪除警告
compress:{
warnings:false,
drop_debugger:true,
drop_console:true
}
})
uglifyJsPlugin 用來對js文件進行壓縮,減小js文件的大小。其會拖慢webpack的編譯速度,建議開發環境時關閉,生產環境再將其打開。