Skip to content

Commit c3ac43c

Browse files
authored
fix(vite-node): fix watch on vite 6 (#6422)
1 parent 0320801 commit c3ac43c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/vite-node/src/hmr/emitter.ts

+9
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ export function viteNodeHmrPlugin(): Plugin {
6363
_send(payload)
6464
emitter.emit('message', payload)
6565
}
66+
// eslint-disable-next-line ts/ban-ts-comment
67+
// @ts-ignore Vite 6 compat
68+
const environments = server.environments
69+
if (environments) {
70+
environments.ssr.hot.send = function (payload: any) {
71+
_send(payload)
72+
emitter.emit('message', payload)
73+
}
74+
}
6675
},
6776
}
6877
}

0 commit comments

Comments
 (0)