Skip to content

Commit

Permalink
fix: update after review discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Mar 23, 2022
1 parent 053e01d commit 64f2d07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite/src/node/server/ws.ts
Expand Up @@ -30,8 +30,9 @@ export function createWebSocketServer(
const hmr = isObject(config.server.hmr) && config.server.hmr
const hmrServer = hmr && hmr.server
const hmrPort = hmr && hmr.port
const portsNotEqual = config.server.port && hmrPort !== config.server.port
const wsServer = hmrServer || ((!hmrPort || portsNotEqual) && server)
const portsAreCompatible =
!hmrPort || !config.server.port || hmrPort === config.server.port
const wsServer = hmrServer || (portsAreCompatible && server)

if (wsServer) {
wss = new WebSocket({ noServer: true })
Expand Down

0 comments on commit 64f2d07

Please sign in to comment.