diff --git a/packages/remix-dev/vite/plugin.ts b/packages/remix-dev/vite/plugin.ts index e580c2660d9..398a026aab5 100644 --- a/packages/remix-dev/vite/plugin.ts +++ b/packages/remix-dev/vite/plugin.ts @@ -406,6 +406,10 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => { imports: [], }, routes, + hmr: { + runtime: VirtualModule.url(injectHmrRuntimeId), + timestamp: -1, // not used for vite hmr + } }; }; @@ -691,12 +695,13 @@ export const remixVitePlugin: RemixVitePlugin = (options = {}) => { return [ 'import { createElement } from "react";', 'export * from "@remix-run/react";', - 'export const LiveReload = process.env.NODE_ENV !== "development" ? () => null : ', - '() => createElement("script", {', - ' type: "module",', - " async: true,", - ` src: "${VirtualModule.url(injectHmrRuntimeId)}"`, - "});", + 'export const LiveReload = () => null;', + // 'export const LiveReload = process.env.NODE_ENV !== "development" ? () => null : ', + // '() => createElement("script", {', + // ' type: "module",', + // " async: true,", + // ` src: "${VirtualModule.url(injectHmrRuntimeId)}"`, + // "});", ].join("\n"); } },