nuxt-modules / svg-sprite

Optimize SVG files and combine them into sprite
https://codesandbox.io/s/github/nuxt-community/svg-sprite-module/
MIT License
300 stars 42 forks source link

How can I remove the 'fill-opacity', 'opacity' attributes? #308

Open imhvost opened 9 months ago

imhvost commented 9 months ago

Hello. Not sure how to remove unnecessary attributes? There is no documentation on the use of svgoConfig. I try like this:

svgSprite: {
    // manipulate module options
    svgoConfig: {
      plugins: [
        {
          name: 'removeAttrs',
          params: {
            attrs: ['fill', 'stroke', 'fill-opacity', 'opacity'],
          },
        },
      ],
    }
  }

But it doesn't seem to work.