-
-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow svgo's prefixIds plugin to use filenames #152
Comments
Yeah I think we have to do it! |
I gave the new version a try but unfortunately this isn't working for me as expected. I've added some trace logs to From looking at the svgr source, that therefore looks like the I'm using the svgo/webpack, if that makes a difference. I'm loading SVGs like so:
|
Actually the filename is not passed when used with Webpack. I don't know if we have access to it, probably not always. Anyway there is still a fix to do in |
Hope there's a way to do it! |
I'm doing this as a workaround now (to prevent duplicate ids):
|
Follow up #188 |
See https://github.com/svg/svgo/blob/master/plugins/prefixIds.js#L137
This looks to me like there's some way to pass a data structure "extra" to SVGO, which can contain the SVG's filename. This would then be used to prefix IDs in the SVG, sidestepping problems with duplicate IDs in inline SVGs.
Would it be possible to have SVGR populate this, so that this plugin can be used in this way?
The text was updated successfully, but these errors were encountered: