我已将removeAttrs设置为true,我想删除所有填充和颜色:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: true },
],
},
},
但我不知道如何指定要删除的属性...
最佳答案
我是这样解决的:
{
loader: 'svgo-loader',
options: {
plugins: [
{ removeNonInheritableGroupAttrs: true },
{ collapseGroups: true },
{ removeAttrs: { attrs: '(fill|stroke)' } },
]
}
}
关于javascript - svgo removeAttrs 如何指定要删除的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43539086/