Skip to content

feat: rename server.hmr options to server.ws options#21357

Open
sapphi-red wants to merge 3 commits intomainfrom
feat/rename-server-hmr-options-to-server-ws-options
Open

feat: rename server.hmr options to server.ws options#21357
sapphi-red wants to merge 3 commits intomainfrom
feat/rename-server-hmr-options-to-server-ws-options

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

I noticed that it's not possible to configure the ws settings when the HMR is disabled by server.hmr: false. This PR moves all ws related options under server.hmr to server.ws. This would make it possible to configure ws settings while disabling HMR.

fixes #18489
refs #18489 (comment), #18489 (comment)

@sapphi-red sapphi-red added this to the 8.1 milestone Jan 1, 2026
@sapphi-red sapphi-red added the p2-edge-case Bug, but has workaround or limited in scope (priority) label Jan 1, 2026
Copy link
Copy Markdown
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall lgtm 👍

Comment thread packages/vite/src/node/utils.ts Outdated
Comment on lines +1389 to +1391
if (rootPath === 'server') {
setupHmrWsOptionCompat(merged)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit strange for me to put compat code in the merge function, but I suppose it works temporarily for now.

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-edge-case Bug, but has workaround or limited in scope (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabling WebSocket and HMR

2 participants