Skip to content

Commit acca85f

Browse files
committed
fix: use normalize instead of replace
1 parent b0bbb56 commit acca85f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rules/alias.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function findAlias(
4949
// Remove basedir and slash in start
5050
const slicedImportPath = importPath
5151
.slice(baseDir.length + 1)
52-
.slice(path.dirname(matchedPath.replace(/^\.\//, '')).length + 1);
52+
.slice(path.dirname(path.normalize(matchedPath)).length + 1);
5353
// Remove asterisk from end of alias
5454
const replacedPathSegments = path
5555
.join(path.dirname(alias), slicedImportPath)

0 commit comments

Comments
 (0)