fix(dev-server): normalize hot reload module paths

This commit is contained in:
2026-08-09 13:32:00 +05:30
parent d85be6c456
commit a90d3683d3
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ test("invalidateModule loads changed server modules without restarting the proce
}
});
test("invalidateModule recompiles changed WRN files in-process", async () => {
test("invalidateModule recompiles changed WRN files with watcher-normalized separators", async () => {
const root = mkdtempSync(join(tmpdir(), "wrnexus-hmr-"));
const file = join(root, "page.wrn");
setCompileCacheDir(join(root, ".wrnexus"));
@@ -94,7 +94,7 @@ test("invalidateModule recompiles changed WRN files in-process", async () => {
expect(String(first({}))).toContain("First");
writeFileSync(file, "page Home { view { <h1>Second</h1> } }\n");
invalidateModule(file);
invalidateModule(file.replace(/\\/g, "/"));
const second = (await loadModule(file)).default as (ctx: unknown) => unknown;
expect(String(second({}))).toContain("Second");
} finally {