fix: resolve nested dependencies (#3254)#3753
fix: resolve nested dependencies (#3254)#3753patak-cat merged 5 commits intovitejs:mainfrom Yelmor:main
Conversation
|
Awesome! So this fix can be merged now? |
I checked the demo and find out that the dependency And I checked the code, vite has it's own way to resolve deps, it creates So using single It seems not easy to extract a independent funciton to resolve sub-deps path from deps directory in vite's way. You may revert this fix for current release, but we still need to find a way to fix the problem. |
* fix: resolve nested dependencies (vitejs#3254) * chore: inline packages * chore: force optimize * chore: cleanup Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
|
@dickeylth would you create a new issue against the latest version of vite (vite@2.8.0-beta.3) so we can properly track the bug report? |
Description
Current vite(2.3.7) cannot resolve nested package on dev mode.
If a project has dependencies like this:
Only
package-a@2.0.0will be load at runtime, andpackage-bactually importpackage-a@2.0.0instead ofpackage-a@1.0.0.Additional context
There was two fixes before.
#3003 uses
resolveDiras module location, which worked. But it mistakenly useflatIdas module path, causing scoped package cannot be resolved.#3053 changed
flatIdtoqualified[flatId], which fixed scoped package problem, but again the nested pacakge problem occurs.I'm not sure if this commit finnally fix the problem, or causing further errors, it passed the tests anyway.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).