Julien-R44 / vite-plugin-validate-env

✅ Vite plugin for validating your environment variables
MIT License
164 stars 6 forks source link

Values stay the same when the server is soft-restarted #17

Closed kvnbra closed 9 months ago

kvnbra commented 9 months ago

When vite soft-restart the server after I change a value in my .env, the value are no longer updated in the generated source code and they alway stay at their initial value on the first cold start.

After manually adding some logs in the plugin it's seams that vite.loadEnv always return the old/initial values but that may be caused by the initial execution of process.env[key] = res; (see: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/env.ts#L66).

Julien-R44 commented 9 months ago

Hey bogoce ( 😬 ), this is fixed with 1.0.0

Please see the changelog https://github.com/Julien-R44/vite-plugin-validate-env/releases/tag/v1.0.0