SpiriitLabs / vite-plugin-svg-spritemap

Vite plugin to generate svg spritemap
MIT License
53 stars 4 forks source link

Incorrect spritemap.svg path got when build on Windows. #45

Closed 0xDarker closed 9 months ago

0xDarker commented 9 months ago

I got "/assetsspritemap.[hash].svg" when build with Vite on Windows. But on Linux, it works fine.

Applelo commented 9 months ago

Hi, can you share a reproduction? I have tried on my windows machine, there is a small problem with the type of slash but not this kind of weird path.

0xDarker commented 9 months ago

Hi, can you share a reproduction? I have tried on my windows machine, there is a small problem with the type of slash but not this kind of weird path.

Here is the reproduction project. demo.zip

0xDarker commented 9 months ago

https://github.com/SpiriitLabs/vite-plugin-svg-spritemap/blob/669f31ffc4bee03f47876c0bd0574ac5d443aaa8/src/plugins/build.ts#L62

maybe use path.posix.join ?

Applelo commented 9 months ago

Hi, I have already implemented on my branch and this is not the problem. It is related to Vue plugin and windows some how. I continue to investigate.

Applelo commented 9 months ago

So you was right, all path in build need to use posix format. A fix is coming in the 2.2.4.