fix: revert bad rootRelativePath change

This commit is contained in:
bholmesdev 2023-04-26 15:23:20 -04:00
parent 136ed3ab04
commit ec2dbd8a30

View file

@ -158,7 +158,10 @@ export function rootRelativePath(root: URL, idOrUrl: URL | string, prependSlash
} else {
id = idOrUrl;
}
id = id.slice(normalizePath(fileURLToPath(root)).length);
const normalizedRoot = normalizePath(fileURLToPath(root));
if (id.startsWith(normalizedRoot)) {
id = id.slice(normalizedRoot.length);
}
return prependSlash ? prependForwardSlash(id) : id;
}