Skip to content

Commit

Permalink
fix: resolve.dedupe may set incorrect path (#4106)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Dec 2, 2024
1 parent ecc92d6 commit cdfb5f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ function applyAlias({
paths: [rootPath],
});

const trailing = sep === '/' ? pkgName : pkgName.split('/').join(sep);
// Ensure the package path is `node_modules/@scope/package-name`
const trailing = ['node_modules', ...pkgName.split('/')].join(sep);
while (
!pkgPath.endsWith(trailing) &&
pkgPath.includes('node_modules')
Expand Down

0 comments on commit cdfb5f5

Please sign in to comment.