Skip to content

Commit 4add8b8

Browse files
committed
Daniel’s optimization
1 parent 44f665b commit 4add8b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/path.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,10 @@ function simpleNormalizePath(path: string): string | undefined {
735735
return path;
736736
}
737737
// Some paths only require cleanup of `/./` or leading `./`
738-
const simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, "");
738+
let simplified = path.replace(/\/\.\//g, "/");
739+
if (simplified.startsWith("./")) {
740+
simplified = simplified.slice(2);
741+
}
739742
if (simplified !== path) {
740743
path = simplified;
741744
if (!relativePathSegmentRegExp.test(path)) {

0 commit comments

Comments
 (0)