ben-eb / gulp-svgmin

Minify SVG files with gulp.
MIT License
341 stars 35 forks source link

Breaks certain svgs #30

Closed MarcelRobitaille closed 8 years ago

MarcelRobitaille commented 8 years ago

I just switched from gulp-svgo because that doesn't seem to exist any more. When I run this, some of my svgs break. I am using 1.2.0

ben-eb commented 8 years ago

Probably best to report upstream with a specific SVG that doesn't compress properly. Note that you can disable problematic transforms with the options object.

https://github.com/ben-eb/gulp-svgmin#plugins

MarcelRobitaille commented 8 years ago

I never had this issue with gulp-svgo, though. shouldn't be svgo's fault.

ben-eb commented 8 years ago

This module delegates all of its transforms to SVGO. Any issues with this wrapper will be reproducible with other means, such as via command line or JS API. Perhaps the gulp-svgo plugin was using an old version of SVGO which didn't break your SVG file? In any case, this wrapper does nothing special and your issue should be reported upstream.

You can verify that with plain node, if you wish:

var SVGO = require('svgo');
var svgo = new SVGO({}); // pass options here

svgo.optimize('<svg>...</svg>', function (result) {
  console.log(result.data);
});
MarcelRobitaille commented 8 years ago

Will do. Thanks!