错误描述
我的一个 Vue 应用在开启 Gzip 压缩后,使用 npm run build
生成时报错,报错内容如下:
ValidationError: Invalid options object. Compression Plugin has been initialized using an options object that does not match the API schema.
- options has an unknown property 'asset'. These properties are valid:
object { test?, include?, exclude?, algorithm?, compressionOptions?, threshold?, minRatio?, deleteOriginalAssets?, filename? }
解决方案
修改 build\webpack.prod.conf.js
,找到如下内容,将 assert
修改为 filename
: