We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad5a6e8 commit 1dbcbb8Copy full SHA for 1dbcbb8
.changeset/warm-books-visit.md
@@ -0,0 +1,5 @@
1
+---
2
+'@hono/vite-dev-server': patch
3
4
+
5
+fix: enable HMR for client-side
packages/dev-server/src/dev-server.ts
@@ -208,9 +208,14 @@ export function devServer(options?: DevServerOptions): VitePlugin {
208
}
209
})
210
},
211
- handleHotUpdate({ server }) {
212
- server.ws.send({ type: 'full-reload' })
213
- return []
+ handleHotUpdate({ server, modules }) {
+ // Force reload the page if any of the modules is SSR
+ const isSSR = modules.some((mod) => mod._ssrModule)
214
+ if (isSSR) {
215
+ server.hot.send({ type: 'full-reload' })
216
+ return []
217
+ }
218
+ // Apply HMR for the client-side modules
219
220
config: () => {
221
return {
0 commit comments