jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
554 stars 58 forks source link

Support for inlining as data uri #138

Open ayZagen opened 5 months ago

ayZagen commented 5 months ago

In readme it is described as if ?url is used the import will result in inline data uri such as data:image/svg+xml however it is not the case. Using url will print out the path of the asset.

It would be great to hava data uri support. Instead of using ?url it could be ?inline to prevent conflict with vite's internal asset resolver.

Moghul commented 4 weeks ago

I'm actually having an issue where for some SVGs, it'll inline them as the docs describe, and for others, I'll get a url as you describe. I'm guessing it has to do with the size of the SVG but I don't know for sure.