1.安装插件
npm install uglifyjs-webpack-plugin@1.1.1 --save-dev
2.配置
webpack.config.js中导入
const UglifyWebpackPlugin = require('uglifyjs-webpack-plugin')
plugin中新增
new UglifyWebpackPlugin()
3.运行
npm run build