-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(hmr): dev mode reduce unnecessary restart #14426
Conversation
Run & review this pull request in StackBlitz Codeflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry only checked now.
Could you expose something like getEnvFilesForMode
in env.ts
that expose this list?
https://github.com/vitejs/vite/blob/main/packages/vite/src/node/env.ts#L21-L26
Then changeEnvShouldRestart can be replaced by getEnvFilesForMode(mode).includes(filename)
This is an interesting optimization. My only doubt is if users may expect other |
Personally I think this is better to show to the user that .env.prod changes doesn't have impact on the running dev server |
Sounds good to me. I let others also do a review and merge this one |
Description
I don't think it's necessary to restart the server to modify the production environment related env in development mode.
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).