vbenjs / vite-plugin-svg-icons

Vite Plugin for fast creating SVG sprites.
MIT License
819 stars 111 forks source link

how to use this plugin in libary mode of vite #39

Closed carmel closed 2 years ago

carmel commented 2 years ago

I guess it's because of the import 'virtual:svg-icons-register' line of code in main.js, which is the entrance of vue project, the component library built under vite's library mode doesn't display the svg icon properly. Maybe it's because I didn't import vite-plugin-svg-icons in the new project, but I don't want to import it either, because the library component shouldn't be a separate library?

Does anyone have a solution? Thanks in advance!

casyalex commented 2 years ago

I met this situation too... And my main project use the same plugin too archive svg icon, and it broke the main project @carmel do you find any solutions?

arthrfrts commented 2 years ago

I am on the same boat. @carmel, how did you provide your sprite through the library mode?

casyalex commented 2 years ago

I am on the same boat. @carmel, how did you provide your sprite through the library mode?

In my case, i am using vite-svg-loader instead in library mode.