Jevon617 / unplugin-svg-component

generate a vue/react component through svg files, supporting svg file HMR, Tree-shaking, SSR and TS hint.
MIT License
58 stars 5 forks source link

[Feature request] Support multiple directories for preserveColor #19

Closed Nikjee closed 6 months ago

Nikjee commented 6 months ago

technically the same as #10 issue but for preserveColor field Since i have svg's in icons folder and public i need to specify both, i tried giving it a regex for both folders but it didnt work. And also it would be nice if we could set it just to true so it would preserveColor for all svg's

Jevon617 commented 6 months ago

@Nikjee

if preserveColor is Regx, it will match the SVG path, such as(in windows):

D:\project\unplugin-svg-component\examples\vue3-vite\icons\common\icon-addx.svg

so in my understanding, it should be able to meet your needs, you just need to find the correct Regx.

Nikjee commented 6 months ago

@Nikjee

if preserveColor is Regx, it will match the SVG path, such as(in windows):

D:\project\unplugin-svg-component\examples\vue3-vite\icons\common\icon-addx.svg

so in my understanding, it should be able to meet your needs, you just need to find the correct Regx.

Sorry my bad, problem is not reproducible anymore, my regex was working only on half of the files but now it is working correctly. Closing it.