ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
257 stars 35 forks source link

feat: pass file path to SVG Optimizer #52

Closed danieldecsi closed 3 years ago

danieldecsi commented 3 years ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

The SVG generator doesn't pass the path parameter when calling SVG Optimize. This leads to some features not working with SVG Optimize plugins. The concrete example I found is when you use prefixIds plugin it would use the source file's name as a prefix by default. The exact implementation can be seen here: https://github.com/svg/svgo/blob/master/plugins/prefixIds.js#L194

Issue Number: N/A

What is the new behavior?

SVG generator passes path parameter to SVG Optimize.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information