fix: client script source map returning 404 (#2071)

This commit is contained in:
Marvin Hagemeister
2023-11-27 16:10:36 +01:00
committed by GitHub
parent 74672b1095
commit 1294d455bc
2 changed files with 28 additions and 4 deletions
+9 -3
View File
@@ -195,9 +195,15 @@ export class ServerContext {
});
return response;
} else if (url.pathname === DEV_CLIENT_URL) {
} else if (
url.pathname === DEV_CLIENT_URL ||
url.pathname === `${DEV_CLIENT_URL}.map`
) {
const bundlePath = (url.pathname.endsWith(".map"))
? "fresh_dev_client.js.map"
: "fresh_dev_client.js";
return bundleAssetRoute(req, { ...connInfo, isPartial: false }, {
path: "client.js",
path: bundlePath,
});
}
}
@@ -635,7 +641,7 @@ function collectEntrypoints(
? import.meta.resolve(`${entrypointBase}/main_dev.ts`)
: import.meta.resolve(`${entrypointBase}/main.ts`),
deserializer: import.meta.resolve(`${entrypointBase}/deserializer.ts`),
client: import.meta.resolve(`${entrypointBase}/client.ts`),
fresh_dev_client: import.meta.resolve(`${entrypointBase}/client.ts`),
};
try {