Skip to content

Commit

Permalink
refactor(vite): disable hmr for child compiler (#8108)
Browse files Browse the repository at this point in the history
Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com>
  • Loading branch information
pcattori and hi-ogawa authored Nov 22, 2023
1 parent 771b2de commit 787bb83
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,7 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => {
...viteUserConfig,
mode: viteConfig.mode,
server: {
...viteUserConfig.server,
// when parent compiler runs in middleware mode to support
// custom servers, we don't want the child compiler also
// run in middleware mode as that will cause websocket port conflicts
middlewareMode: false,
hmr: false,
},
configFile: false,
envFile: false,
Expand All @@ -651,15 +647,6 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => {
plugin.name !== "remix" &&
plugin.name !== "remix-hmr-updates"
),
{
name: "no-hmr",
handleHotUpdate() {
// parent vite server is already sending HMR updates
// do not send duplicate HMR updates from child server
// which log confusing "page reloaded" messages that aren't true
return [];
},
},
],
});
await viteChildCompiler.pluginContainer.buildStart({});
Expand Down

0 comments on commit 787bb83

Please sign in to comment.