-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove extra path shorten when resolving from a dir #13381
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Should we guard against |
I think it's better to fix the importer path too, something like how CSS does currently should be good enough: vite/packages/vite/src/node/plugins/css.ts Line 937 in 5c3fa05
so it's handled properly in the resolver. |
Agree it's better to prevent resolving from dir if possible. IIUC, maybe we could join
basedir is the directory of package.json of dep to optimize?
|
Interesting, resolving as |
I think using |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
Description
fix #13320
When resolving nested packages,
path.dirname
inadvertently shortens the initial resolving path. Although pnpm tolerates this due to its topological structure, Yarn3 does not. To fix this, the proposed PR preventspath.dirname
from being invoked when the importer is already a directory.Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).