代码里如果用到const 关键字,编译报这种错误
解决方法:
npm install terser-webpack-plugin --save然后,webpack配置:
const TerserPlugin = require('terser-webpack-plugin'); module.exports = { optimization: { minimize: true, minimizer: [new TerserPlugin()], }, };