使用
this GitHub issue as an example
,您应该能够通过在配置中添加类似的内容来实现这一点。。。
module.exports = {
chainWebpack: config => {
config.module.rule('images').use('url-loader')
.loader('file-loader')
.tap(options => Object.assign(options, {
name: 'images/register/[name].[hash:8].[ext]'
}))
config.module.rule('svg').use('file-loader')
.tap(options => Object.assign(options, {
name: 'images/register/[name].[hash:8].[ext]'
}))
},
css: {
extract: {
filename: 'css/register/[name].[hash:8].css',
chunkFilename: 'css/register/[name].[hash:8].css'
}
},
configureWebpack: {
output: {
filename: 'js/register/[name].[hash:8].js',
chunkFilename: 'js/register/[name].[hash:8].js'
}
}
}
看到了吗
https://cli.vuejs.org/config/#vue-config-js