Svgo: How to correct use removeAttrs?

Created on 23 Dec 2017  路  1Comment  路  Source: svg/svgo

I using svgo as gulp-imagemin plugin and task where i want to minify my svg images and use removeAttrs plugin, but i have no result.

gulp.task('minify', function() {
  gulp.src('*.svg')
    .pipe(imagemin([
      imagemin.svgo({plugins: [
        { removeAttrs: { attrs: 'filter' } }
      ]})
    ]))
    .pipe(gulp.dest('.'));
});

This code does not work, images minifying but with no removing filter attribute. By the way i want to know how to remove multiple attributes and is there way to remove whole tags?

Most helpful comment

This is how I'm removing fill attribute from svg

plugins: [
    {removeAttrs: {attrs:['fill']}}
 ]

>All comments

This is how I'm removing fill attribute from svg

plugins: [
    {removeAttrs: {attrs:['fill']}}
 ]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

madysondesigns picture madysondesigns  路  4Comments

gregberge picture gregberge  路  3Comments

pixelass picture pixelass  路  3Comments

guliash picture guliash  路  4Comments

mahnunchik picture mahnunchik  路  3Comments