From acca85fbe0e30fa26846403c285c9e9b6f2ae3c8 Mon Sep 17 00:00:00 2001 From: Sam Tsai Date: Thu, 24 Oct 2024 15:44:41 -0400 Subject: [PATCH] fix: use normalize instead of replace --- src/rules/alias.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/alias.ts b/src/rules/alias.ts index 315b3c6..2f29a04 100644 --- a/src/rules/alias.ts +++ b/src/rules/alias.ts @@ -49,7 +49,7 @@ function findAlias( // Remove basedir and slash in start const slicedImportPath = importPath .slice(baseDir.length + 1) - .slice(path.dirname(matchedPath.replace(/^\.\//, '')).length + 1); + .slice(path.dirname(path.normalize(matchedPath)).length + 1); // Remove asterisk from end of alias const replacedPathSegments = path .join(path.dirname(alias), slicedImportPath)