Skip to content

Commit

Permalink
fix: use normalize instead of replace
Browse files Browse the repository at this point in the history
  • Loading branch information
samtsai committed Oct 24, 2024
1 parent b0bbb56 commit acca85f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit acca85f

Please sign in to comment.