gulp-svg-sprites
gulp-svg-sprites copied to clipboard
Ability to disable path merging
First off, awesome module. We're using it in a production site and we're loving it.
We're hoping we can get an option to disable the path merging that svgo offers. Currently gulp-svg-sprites
/svgo
would combine the following paths into one path. This is not always ideal since you lose the ability to style individual paths with CSS.
In:
<g>
<path d="foo">
<path d="bar">
<path d="baz">
</g>
Out:
<g>
<path d="foo bar baz">
</g>
Thanks!
Yeah I'm going to expose the SVGO options to the main config object in a coming release :)
What would you say the ETA is on that?
Also, willing to help.
Would it be easier to just remove svggo from this plugin. Could just add a link in the readme to https://www.npmjs.org/package/gulp-svgmin
svgo is not just used to compress the final file output, it's used on every svg so I'm not sure how we could remove it?
Can't we just rip this bit out? https://github.com/shakyShane/gulp-svg-sprites/blob/master/lib/svg-utils.js#L15 Either way, no biggie. Just thinking if people used svgo themselves on their src svgs they could use plugins like gulp newer to only optimize files that have not already been compressed. And that overall removal of svgo from this plugin would speed things up a little
I agree with that. I also think that it’s better to remove SVGO from this plugin.
I use SVGO quite often and it destroys some SVGs when certain options are not disabled. I figured out that these are the most problematic when enabled: convertTransform, convertPathData.
So another strong argument against bundling SVGO with this plugin is that it isn’t always non-destructive.
@shakyShane
svgo is not just used to compress the final file output, it's used on every svg
Why is that necessary? Wouldn’t it be enough to run SVGO over the final sprite output? If SVGO would be removed from this plugin, an user could simply run gulp-svgmin
over the final output.
Were you able to expose the SVGO plugins in the config?
I agree with the above opinions that this plugin could leave SVGO out and pass off the optimization task to the user. I find that that kind of separation of responsibilities is straightforward and sensible with gulp.
@shakyShane my two cents:
- remove svgo dependency from package.json here, no need for it
- update svg-sprite-data svgo dependency to 0.5.0, seems to fix many bugs for me like bad svg output
- add cleanconfig options to readme, it already works
thanks!