0๐
โ
I added this to my vue.config.js
module.exports = {
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
if (process.env.NODE_ENV === 'production')
args[0].minify = {
minifyCSS: true,
minifyJS: true,
minifyURLs: true,
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeScriptTypeAttributes: true,
removeAttributeQuotes: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true
};
return args;
})
},
... // Other configs
}
More details here
Source:stackexchange.com