Answer the question
In order to leave comments, you need to log in
Vue-svg-loader: remove all colors from icons?
I use vue cli 3.0 to build.
Installed vue-svg-loader .
Set up:
// vue.config.js
module.exports = {
chainWebpack: (config) => {
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.use('vue-svg-loader')
.loader('vue-svg-loader')
.options({
svgo: {
plugins: [
{ prefixIds: true }
]
}
})
}
}
module.exports = {
chainWebpack: (config) => {
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.use('vue-svg-loader')
.loader('vue-svg-loader')
.options({
svgo: {
plugins: [
{ removeViewBox: false },
{ removeUselessDefs: false },
{ removeStyleElement: false },
{ minifyStyles: false },
{ convertStyleToAttrs: false },
{ convertColors: 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