richardtallent / vite-plugin-singlefile

Vite plugin for inlining JavaScript and CSS resources
MIT License
808 stars 53 forks source link

Fix __VITE_PRELOAD__ regression in vite 5.3 #98

Closed cyanzhong closed 2 months ago

cyanzhong commented 3 months ago

The "__VITE_PRELOAD__" replacement no longer works in vite 5.3 because of this change: https://github.com/vitejs/vite/pull/16562

The reason is that the produced marker is just __VITE_PRELOAD__, no quotes.

I updated the regex to support both versions, by taking the quote as an optional pattern.

Tested both vite 5.3 and vite 5.2.12, working fine.

cyanzhong commented 3 months ago

Hey @richardtallent could you please help review and tag a release? Thank you!

Feel free to make modifications, like just removing the quote, I am fine with that.

richardtallent commented 2 months ago

Done

cyanzhong commented 2 months ago

Thank you!