4.配置js压缩

webpack.config.js配置

安装 uglifyjs-webpack-plugin
         cnpm install uglifyjs-webpack-plugin
在开发环境不能使用npm run server
const uglify = require('uglifyjs-webpack-plugin');
...
    plugins: [
        new uglify()
    ],
...

你可能感兴趣的:(4.配置js压缩)