Open dsine-de opened 1 month ago
Seems the problem is that after the line $symbol.append($svg.children());
the $svg
variable contains an empty SVG without children, so the next line const $defs = $svg.find('defs');
will never contain the <defs>
tag
Seems the problem is that after the line
$symbol.append($svg.children());
the$svg
variable contains an empty SVG without children, so the next lineconst $defs = $svg.find('defs');
will never contain the<defs>
tag
Nice :) if you have idea for PR please feel free to open one :) I will try to check it soon
I don't know why the <defs>
are being extracted to be honest - <defs>
should work if they are inside the individual <symbol>
tags (with the style
fix for chromium browsers described in #2).
I don't know why the
<defs>
are being extracted to be honest -<defs>
should work if they are inside the individual<symbol>
tags (with thestyle
fix for chromium browsers described in #2).
The issue is if you use the sprite as external
svg file. But we should think to make it better.
Hi,
this line doesn't seem to do anything: https://github.com/pivanov/vite-plugin-svg-sprite/blob/e9106479866e98dba41e9ef8d001910ad58a4d4a/src/index.ts#L109
It seems to look for
<defs>
tags in$svg.children()
to extract them and put them before any other<symbol>
tags of the sprite SVG - but this is a newly created empty cheerio variable (new SVG element), right?