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 field #7073

Merged

Conversation

sapphi-red
Copy link
Member

Description

fix #6725

Additional context


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.

@Niputi Niputi added the p3-minor-bug An edge case that only affects very specific usage (priority) label Feb 24, 2022
@Niputi Niputi changed the title fix: import with query with exports field (fix #6725) fix: import with query with exports field Feb 24, 2022
@patak-dev patak-dev merged commit 88ded7f into vitejs:main Feb 24, 2022
@sapphi-red sapphi-red deleted the fix/import-with-query-exports-field branch February 24, 2022 22:24
MadLittleMods added a commit to element-hq/hydrogen-web that referenced this pull request Feb 26, 2022
Fix #686
Fix #682

Instead of deleting the whole `target/` directory, leave it alone so the symlink
driving the `npm link`/`yarn link` stays in tact.

Leave Vite builds in their build directories (`/lib-build`/`/asset-build`)
so you can `vite build --watch` to build on local changes and still have a
consisent place to reference in the `package.json` `exports`. Previously,
everything relied on `build.sh` which does a bunch of moving and renaming
and made it hard to rebuild on changes.

Add back support for CommonJS (adding the `package.json` `exports`).

The last piece is making sure the `?url` imports (`import workerPath from 'hydrogen-view-sdk/main.js?url';`)
work still. It looks like this may have just been solved via
vitejs/vite#6725 -> vitejs/vite#7073
(literally 2 days ago) and we just need to wait for the next Vite release 🎉
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot import wasm as URL from a package which has exports field declared in package.json
4 participants