【Vue2.5】打包报错:ValidationError: Invalid options object.....
vue项目打包发生报错,显示ValidationError: Invalid options object. Terser Plugin has been initialized using an options object that does not match the API schema.
·
1、报错情况
All browser targets in the browserslist configuration have supported ES module.
Therefore we don't build two separate bundles for differential loading.
✔ Building for production...
ERROR ValidationError: Invalid options object. Terser Plugin has been initialized using an options object
that does not match the API schema.
- options has an unknown property 'sourceMap'. These properties are valid:
object { test?, include?, exclude?, terserOptions?, extractComments?, parallel?, minify? }
ValidationError: Invalid options object. Terser Plugin has been initialized using an options object that does not match the API schema.
- options has an unknown property 'sourceMap'. These properties are valid:
object { test?, include?, exclude?, terserOptions?, extractComments?, parallel?, minify? }
....
2、原因:
造成上面问题的原因是terser-webpack-plugin版本问题。
3、解决方案:
推荐使用terser-webpack-plugin@4.2.3。更新版本,重新打包即可。
npm install terser-webpack-plugin@4.2.3
更多推荐
已为社区贡献2条内容
所有评论(0)