fix: revert bad rootRelativePath change
This commit is contained in:
parent
136ed3ab04
commit
ec2dbd8a30
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue