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
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.
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.
Thanks.
Validations