npm i --save-dev terser-webpack-plugin
/config/index.js


import TerserPlugin from "terser-webpack-plugin"


const config = {
    mini: {
      webpackChain(chain, webpack) {
        chain.mode("production");
        chain.optimization.minimize(true);
        chain.plugin("terser").use(TerserPlugin, [
          {
            cache: true,
            extractComments: false,
            terserOptions: {
              output: {
                comments: false
              }
            }
          }
        ]);
      }
  }


}

 

posted on 2020-07-13 17:26  chenlw101  阅读(3468)  评论(0编辑  收藏  举报