-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Labels
Description
Description
Some users are actively seeking ways to disable HMR (#13994).
With HML enabled, and reactive components are partially rendered, it is unpredictable #18217 when page reload happens.
From my personal experience, the page reloads multiple times, even during simple navigation within the project.
Suggested solution
Please provide an option for users to disable WebSocket and HMR.
server: {
socket: false,
hmr: false,
},
A single page reload after updating code in the editor is sufficient and might be optimal solution.
Fortunately, Vite is capable of updating CSS and JS files even without WebSocket enabled.
Alternative
Additional context
Normally I do not change the library's code. However, this changes made my developing experience much more predictable and less annoying with unexpected reloads.
function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
if (!socketEnabled) return;
Thanks.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
UnnoTed, TylerSouthmayd, MSchinwaldEl, Congee, r7l and 5 more
