jpkleemans / vite-svg-loader

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

Gracefully handle Vite virtual files #142

Open hecktarzuli opened 3 months ago

hecktarzuli commented 3 months ago

Vite supports virtual files like virtual:public?%2Fimages%2Fvisa.svg. This module attempts to load these files even if the default import type is url because of the ? in the virtual filename.

This produces tons of warnings like these: image

For the time being it would be nice if this plugin just early-outted if the url starts with virtual:

nextmat commented 3 weeks ago

Running into the same issue. Has anyone found a way around this?

Is it possible to scope what vite-svg-loader processes via configuration to avoid processing of public or virtual files?

nextmat commented 3 weeks ago

Added #146 to address this