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
View File
@@ -259,6 +259,7 @@ async function rewriteArtifactImportsAsync(
}
export async function loadModule(file: string): Promise<Record<string, unknown>> {
file = resolve(file);
let mod = moduleCache.get(file);
if (!mod) {
mod = (async () => {
@@ -631,6 +632,7 @@ export function serveWrnBrowserArtifact(pathname: string): Response | null {
/** Forget one module and force its next dynamic import to bypass Bun's import cache. */
export function invalidateModule(file: string): void {
file = resolve(file);
moduleCache.delete(file);
moduleVersions.set(file, (moduleVersions.get(file) ?? 0) + 1);
}