Skip to content

Inline SVG IDs collision #32

Closed Answered by webdiscus
vralle asked this question in Q&A
Discussion options

You must be logged in to vote

@vralle

this is really a very, very complex issue that has been known for more than 10 years.
But I have a solution.

The HTML Bundler plugin works with standard assets types that Webpack generates using loaders.
All manipulation of SVG content must be done outside of the bundler plugin. This is not a task for the plugin.
Therefore we need the svgo-loader (not svg-sprite-loader) which can handle the SVG content via plugins.
But the svgo has the unresolved issues:

I have extended/fixed the original svgo plugin prefixIds to generate unique IDs for SVG.

Here is the working example inline-svg-unique-id to i…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vralle
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants