在项目根目录新建vue.config.js,添加如下代码。
chainWebpack: config => {
//通过运行 vue inspect plugins 的值html插件别名。。
config.plugin('html-index').tap(args => {
args[0].minify = {
removeAttributeQuotes: false
}
return args
})
},
之前按照vue官方文档查的说添加
有的说添加
config.plugin('html').tap
报错说
TypeError: Cannot set property 'minify' of undefined
通过运行
vue inspect plugins
看到插件列表,htmlWebpackPlugin别名改成了html-index
