Skip to content

Commit

Permalink
fix(vite-node): fix watch for vite 6
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Aug 29, 2024
1 parent 122e4fe commit 70744e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/vite-node/src/hmr/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export function viteNodeHmrPlugin(): Plugin {
_send(payload)
emitter.emit('message', payload)
}
// @ts-ignore Vite 6 compat
const environments = server.environments;
if (environments) {
environments.ssr.hot.send = function (payload: any) {
_send(payload)
emitter.emit('message', payload)
}
}
},
}
}

0 comments on commit 70744e5

Please sign in to comment.