Closed
Description
I found that current vue-build
in production mode offers fixed filename for the extracted CSS which is taken from the entry path:
In https://github.com/vuejs/vue-cli/blob/master/bin/vue-build
new ExtractTextPlugin(options.lib ? `${replaceExtension(options.entry, '.css')}` : '[name].[contenthash:8].css')
I have a different project folder structure and I need to define a custom filename for the extracted CSS. How this can be achieved?
My temporary solution is presented below, but I think there must be a better way.
module.exports = {
webpack(defaults, options) {
defaults.output.filename = './index.js'
defaults.plugins.find(el => {
if (el.constructor.name === 'ExtractTextPlugin') {
el.filename = './style.css'
}
})
return defaults;
}
};