Vue.js 整合';字符串替换加载程序';进入Vue CLI
正如标题所说,我想在vue.config.js文件中集成“string replace loader”,但我一生都无法启动它,到目前为止,我已经尝试了以下方法:Vue.js 整合';字符串替换加载程序';进入Vue CLI,vue.js,webpack,vue-cli,Vue.js,Webpack,Vue Cli,正如标题所说,我想在vue.config.js文件中集成“string replace loader”,但我一生都无法启动它,到目前为止,我已经尝试了以下方法: module.exports = { chainWebpack: config => { config.module .rule('stringReplace') .use('vue-loader') .loader('string-replace-loader')
module.exports = {
chainWebpack: config => {
config.module
.rule('stringReplace')
.use('vue-loader')
.loader('string-replace-loader')
.tap(options => {
const newOptions = {
search: 'bundles',
replace: target,
flags: 'g',
}
return { ...options, ...newOptions };
})
}
};
无济于事,而且:
module.exports = {
chainWebpack: config => {
config.module.rules.delete('vue');
config.module
.rule('vue')
.test(/\.(vue)(\?.*)?$/)
.use('vue-loader')
.loader('vue-loader')
.use('string-replace-loader')
.loader('string-replace-loader')
.tap(options => {
const newOptions = {
search: 'bundles',
replace: target,
flags: 'g',
}
return { ...options, ...newOptions };
})
}
};
没有任何运气
任何帮助都将不胜感激
谢谢