webpack.prod.js

  • Post author:
  • Post category:其他


let OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin');
let TerserPlugin = require('terser-webpack-plugin');
let {smart} = require('webpack-merge');
//既想要base中的配置 又想要自己的配置  base
let base = require('./webpack.base');
module.exports = smart(base, {
  mode: 'production',
  optimization: {//webpack4.0之后出现的优化项
    minimizer: [new TerserPlugin({}), new OptimizeCssAssetsWebpackPlugin({})]//压缩css
    //缺陷 可以压缩css 但是 js压缩又出现了问题
  }
});



版权声明:本文为qq_45424679原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。