vite icon indicating copy to clipboard operation
vite copied to clipboard

fix: handle resolve optional peer deps

Open bluwy opened this issue 3 years ago • 0 comments

Description

fix #6007

Introduce __vite-optional-peer-dep prefix (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?

  • [x] Bug fix
  • [x] New Feature
  • [ ] Documentation update
  • [ ] Other

Before submitting the PR, please make sure you do the following

  • [x] Read the Contributing Guidelines.
  • [x] Read the Pull Request Guidelines and follow the Commit Convention.
  • [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • [x] Ideally, include relevant tests that fail without this PR but pass with it.

bluwy avatar Jul 23 '22 15:07 bluwy