fix: basePath not working in dev server (#3202)

Fixes https://github.com/denoland/fresh/issues/3201
This commit is contained in:
Marvin Hagemeister
2025-08-07 12:38:37 +02:00
committed by GitHub
parent 073bacfbbb
commit 3d1eb2c346
5 changed files with 64 additions and 12 deletions
+6 -2
View File
@@ -284,11 +284,15 @@ export function patternToSegments(
return out;
}
export function mergePath(basePath: string, path: string): string {
export function mergePath(
basePath: string,
path: string,
isMounting: boolean,
): string {
if (basePath.endsWith("*")) basePath = basePath.slice(0, -1);
if (basePath === "/") basePath = "";
if (path === "*") path = "";
if (path === "*") path = isMounting ? "" : "/*";
else if (path === "/*") path = "/*";
const s = (basePath !== "" && path === "/") ? "" : path;