Not possible to disable HMR
Versions
nuxt-vite: 0.0.28 nuxt: 2.15.2
Description
There's ws call even when there's hmr:false. This makes it hard to deploy behind reverse proxy with redirects. Tried everything (setting port and path, proxy, etc) and it didn't work for me. It would be better to turn it off completely. nuxt.config.js
vite: {
server: {
hmr: false,
},
},
Adding option makes sense to disable ws/hmr. But i think toy shouldn't deploy development mode of nuxt to prod 😅
It's not prod, but dev server. I just need devtools but nuxt forces production env on nuxt build.
I've tried to take a look into source and noticed you need workaround to turn off HMR in server.ts.
Also related to HMR: https://github.com/vitejs/vite/pull/2338
@Atinux I think your reference is related to #47
@Atinux I see. There's middleware option enabled. Haven't realized even though docs mention it 😅 https://github.com/nuxt/vite/blob/04d01edfa9d5eb94e76736ae95a6394bba375a06/src/client.ts#L38
Some problem

In my tests, this does disable HMR, even in middlewareMode:
vite: {
server: {
hmr: false
}
}
What it does not do is disable the Vite websocket server, which isn't really a possibility for nuxt-vite to do. Opened https://github.com/vitejs/vite/pull/2474 for discussion.