vue.config.js的uglifyjs-webpack-plugin

zsgww發表於2020-11-27
static/js/chunk-vendors.004474e2.js from UglifyJs
Unexpected token: operator «>» [static/js/chunk-vendors.004474e2.js:14722,27]

專案環境是vuejs3加上antd,嘗試compression-webpack-plugin和uglifyjs-webpack-plugin打包外掛,
發現uglifyjs-webpack-plugin一使用這個方法就報錯,配置物件時報其他的錯誤如下:

Building for production...events.js:292
      throw er; // Unhandled 'error' even

檢視網上解決方案,安裝uglifyjs-webpack-plugin@beta支援對 ES2015+ 語法。

本作品採用《CC 協議》,轉載必須註明作者和本文連結
一勞永逸

相關文章