Answer the question
In order to leave comments, you need to log in
How to force webpack to add folder name to image path?
I'm using vue-cli3 for a project, but I needed to change the path to static files when building the project.
there is such a configuration
// vue.config.js
module.exports = {
chainWebpack: config => {
if(config.plugins.has('extract-css')) {
const extractCSSPlugin = config.plugin('extract-css')
extractCSSPlugin && extractCSSPlugin.tap(() => [{
filename: '[name].css',
chunkFilename: '[name].css'
}])
}
config.optimization.delete('splitChunks')
},
configureWebpack: {
output: {
filename: '[name].js',
chunkFilename: '[name].js',
},
},
lintOnSave: true,
filenameHashing: false,
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question