Skip to content
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: respect bare imports in browser field of package.json #9441

Closed
wants to merge 2 commits into from

Conversation

zhenyasav
Copy link

Description

This helps vite respect bare package imports in browser fields of package.json. We (@wittjosiah) discovered this when trying to use sodium-universal in a vite app, which asks for this substitution of sodium-native:

  "browser": {
    "sodium-native": "sodium-javascript"
  },

Relevant code in vite seemed to be assuming all such browser values are relative paths and not bare imports

Additional context

We're not sure if we're breaking anything else, and this problem seems related to (but not covered by) the solution in #8709

Let us know how to make this better and we'll get it there, thank you for your time!

Grand merci, Vite team!

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

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

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

@zhenyasav zhenyasav mentioned this pull request Oct 10, 2022
31 tasks
@sapphi-red
Copy link
Member

Thanks for the PR! Sorry for missing this PR.
Closing as #11219 is merged.

@sapphi-red sapphi-red closed this Mar 12, 2023
@wittjosiah wittjosiah deleted the wittjosiah/browser-mapping branch March 12, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants