windicss / vite-plugin-windicss

🍃 Windi CSS for Vite ⚡️
MIT License
854 stars 65 forks source link

Unnecessary full page reload when config file changes #288

Closed judocode closed 2 years ago

judocode commented 2 years ago

Describe the bug Whenever the windi config file changes, HMR is triggered as well as a full page reload. The full page reload should not be necessary after the HMR and it looks like this is by design for some reason: https://github.com/windicss/vite-plugin-windicss/blob/124fb2fbbbe5c3421424060a2401ba292be4440f/packages/vite-plugin-windicss/src/index.ts#L129-L132

In my logs I see:

[vite] hmr update /@windicss/windi.css
configure file changed, reloading

Minimal Reproductions https://github.com/judocode/vite-rails-docker If you run docker-compose up vite and then in a separate terminal docker-compose up app and then browse localhost:3000 and change the config file

Versions

Additonal Context I saw this was once an issue with Vite https://github.com/vitejs/vite/issues/4150 but it has since been resolved.

antfu commented 2 years ago

Features like variants groups or @apply directives transform your code. A full reload is necessary to ensure everything is refreshed correctly.