I have removeAttrs set to true, I would like to remove all fill, and color:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: true },
],
},
},
But I don´t know how to specify attrs to remove in there...
I have removeAttrs set to true, I would like to remove all fill, and color:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: true },
],
},
},
But I don´t know how to specify attrs to remove in there...
Share Improve this question edited Apr 21, 2017 at 19:41 Robert Longson 125k27 gold badges267 silver badges253 bronze badges asked Apr 21, 2017 at 9:33 palyxkpalyxk 3512 gold badges5 silver badges17 bronze badges 5- removeUselessStrokeAndFill ?? – Sahil Dhir Commented Apr 21, 2017 at 9:35
- No remove useless stroke and fill i have tried.. – palyxk Commented Apr 21, 2017 at 9:37
- Please provide full code – Sahil Dhir Commented Apr 21, 2017 at 9:41
- thats cool :) :) – Sahil Dhir Commented Apr 21, 2017 at 9:51
- 1 Could somebody enlighten me as on how to use this on the mand line? I want to get rid of a lot of 'forbidden' data-name attributes in a bunch of SVG files. “svgo . enable=removeAttrs data-name” doesn't work. – Ideogram Commented Aug 24, 2017 at 7:21
1 Answer
Reset to default 5I solved it like this:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: { attrs: '(fill|stroke)' } },
]
}
}