Skip to content

Commit

Permalink
fix(vite-node): fix watch on vite 6 (#6422)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Sep 5, 2024
1 parent 0320801 commit c3ac43c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 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,15 @@ export function viteNodeHmrPlugin(): Plugin {
_send(payload)
emitter.emit('message', payload)
}
// eslint-disable-next-line ts/ban-ts-comment
// @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 c3ac43c

Please sign in to comment.