We have a requirement to turn off the minify.removeAttributeQuotes property for certain pages.
This is the content of my vue.config.js:
const packageJson = require('./package.json')
module.exports = {
assetsDir: packageJson.name + '/static',
chainWebpack: config => {
config.plugins.delete('preload-search')
config
.plugin('html-search')
.tap(args => {
return [
{
preload: false,
title: packageJson.description,
template: __dirname + '/public/search.html',
minify: {
removeAttributeQuotes: false
}
}
]
})
},
pluginOptions: {
i18n: {
locale: 'de',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: true
}
},
pages: {
index: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
title: 'Index Page',
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
search: {
entry: 'src/search/main.js',
template: 'public/search.html',
filename: 'search.html',
title: 'Search Page',
chunks: ['chunk-vendors', 'chunk-common', 'search']
}
}
}
We are utilizing the pages property for multiple endpoints. Therefore, we need to switch from "plugin('html')" to "plugin('html-search')".
The issue at hand:
Due to our use of the pages property, the public/search.html file is not being minified, and no js/css injections are being included in the file.
All I did was:
- Defined the pages property following this link: https://cli.vuejs.org/config/#pages.
- Used webpack chaining to configure the html plugin as explained here: https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
I am out of ideas on how to solve this issue.
Regards, Mario