Closed Arthurin915 closed 2 years ago
Hi, thanks for reporting. Could you share an example project so I can reproduce the problem, and investigate how to resolve it.
Hi, i created this repo to reproduce the issue:
https://github.com/Arthurin915/vite-svg-loader-issue
I'm also confused why the svg loader would run an error if i'm not even importing it as a component, i'm importing directly in the src img attribute.
Thanks, if you have any doubts about the repo please contact me
I am also facing the same with the new vite project:
Looks like @jpkleemans is not maintaining this lib. I can confirm this problem still exists. Loader should ignore file if path starts with a forward slash.
@nxmad I definitely do maintain this library (just did a new release last week), however it is hard for me to find much time for it in my spare time. So, if you could help fix this issue by submitting a Pull Request for example, that would be very helpful!
@jpkleemans That's great to hear, thanks for your work. I'm not into plugins development so much. May be not the best solution, but at least it works - https://github.com/jpkleemans/vite-svg-loader/pull/46
Fixed in v3.3.0
Hello, when I try to use a svg from public path it works in the dev server, but breaks in build.![image](https://user-images.githubusercontent.com/26447720/131048939-5c2e1bdb-28f0-4c9c-bc97-f59e80140218.png)
If I v-bind the image src in the template with the same path, it surprisingly works, even in build![image](https://user-images.githubusercontent.com/26447720/131048993-f6b11084-29a4-417a-9e78-079c41fb74ca.png)
Any thoughts on why i get an error trying to build a simple svg? I'm not even trying to import as a component...