fix: handle resolve optional peer deps#9321
Merged
Conversation
bluwy
commented
Jul 23, 2022
9 tasks
patak-dev
approved these changes
Aug 19, 2022
7 tasks
aleclarson
reviewed
Nov 13, 2022
| // if so, we can resolve to a special id that errors only when imported. | ||
| if ( | ||
| basedir !== root && // root has no peer dep | ||
| !isBuiltin(id) && |
Contributor
There was a problem hiding this comment.
These id references should be using nestedPath instead
Member
There was a problem hiding this comment.
@aleclarson I worry we will end up unable to keep track of these comments if you only add them to merged PRs. Would it be possible for you to create a new issue with a reproduction linking to them? Or a PR with a failing test case that others can later work on? If we don't have an open issue or PR in a few days these will be completely buried by new activity.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fix #6007
Introduce
__vite-optional-peer-depprefix (similar to `__vite-browser-external) for packages that are optional peer dependencies.Additional context
Since knowing optional peer dep requires traversing the parent for
package.json, this may incur a small perf cost. But from what I can tell, the logic where I added is rarely called during testing.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).