Created
April 10, 2020 14:10
-
-
Save 52cik/ef11307a89c755dadf4599b80697eaf2 to your computer and use it in GitHub Desktop.
vue config Component img src resolving - vue 自定义图片组件 src 解析配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import('@vue/cli-service').ProjectOptions} */ | |
module.exports = { | |
chainWebpack(config) { | |
// https://bootstrap-vue.js.org/docs/reference/images/ | |
// https://github.com/webpack-contrib/html-loader | |
config.module | |
.rule('vue') | |
.use('vue-loader') | |
.loader('vue-loader') | |
.tap((options) => { | |
options.transformAssetUrls = { | |
img: 'src', | |
MyImg: 'src', | |
'my-img': 'src', | |
}; | |
return options; | |
}); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment