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: import with query with exports/browser field #7098

Merged
merged 7 commits into from Mar 29, 2022

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Feb 26, 2022

Description

The previous PR (#7073) did fix for cases like .png?url which becomes url regardless of ?url, but did not work with other cases.

This PR fix for those. For example, .json?url, .wasm?url. (I overlooked .json?url was broken...)

fix #6725
fix #7281

Additional context

refs #7097

Thanks @MadLittleMods for mentioning.


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.

packages/vite/src/node/plugins/resolve.ts Outdated Show resolved Hide resolved
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry didn't mean to approve this 😅

@sapphi-red sapphi-red changed the title fix: import with query with exports field fix: import with query with exports/browser field Mar 4, 2022
@sapphi-red sapphi-red requested a review from bluwy March 7, 2022 18:49
@@ -772,7 +777,7 @@ function packageEntryFailure(id: string, details?: string) {

function resolveExports(
pkg: PackageData['data'],
key: string,
keyWithQuery: string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's nice if we can leave this back as key

packages/vite/src/node/plugins/resolve.ts Outdated Show resolved Hide resolved
@sapphi-red sapphi-red requested a review from bluwy March 9, 2022 09:04
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Mar 9, 2022
@MadLittleMods
Copy link
Contributor

Friendly poke to merge 🙇. Is there anything left after approval?

@patak-dev patak-dev merged commit 9ce6732 into vitejs:main Mar 29, 2022
@sapphi-red sapphi-red deleted the fix/import-with-query-exports-field branch March 30, 2022 07:19
sapphi-red added a commit to sapphi-red/web-noise-suppressor that referenced this pull request Mar 30, 2022
MadLittleMods added a commit to element-hq/hydrogen-web that referenced this pull request Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
4 participants