fix(resolve): don't use exports field for dir imports#20252
Closed
sapphi-red wants to merge 1 commit intovitejs:mainfrom
Closed
fix(resolve): don't use exports field for dir imports#20252sapphi-red wants to merge 1 commit intovitejs:mainfrom
sapphi-red wants to merge 1 commit intovitejs:mainfrom
Conversation
Member
Author
|
/ecosystem-ci run |
commit: |
|
📝 Ran ecosystem CI on
✅ analogjs, laravel, one, ladle, astro, quasar, storybook, rakkas, marko, sveltekit, unocss, qwik, vite-plugin-pwa, vite-plugin-cloudflare, vite-plugin-react, vite-plugin-svelte, vite-environment-examples, vuepress, vite-plugin-vue, vite-setup-catalogue, vite-rsc, vitepress |
Member
Author
|
It seems these two lines are affected as well. |
Boshen
added a commit
to oxc-project/oxc-resolver
that referenced
this pull request
Jun 26, 2025
closes #571 This is not part of the spec but some vite projects rely on this behavior. See * vitejs/vite#20252 * nodejs/node#58827
Boshen
added a commit
to oxc-project/oxc-resolver
that referenced
this pull request
Jun 26, 2025
closes #571 This is not part of the spec but some vite projects rely on this behavior. See * vitejs/vite#20252 * nodejs/node#58827
Boshen
added a commit
to oxc-project/oxc-resolver
that referenced
this pull request
Jun 26, 2025
closes #571 This is not part of the spec but some vite projects rely on this behavior. See * vitejs/vite#20252 * nodejs/node#58827
Boshen
added a commit
to oxc-project/oxc-resolver
that referenced
this pull request
Jun 26, 2025
) closes #571 This is not part of the spec but some vite projects rely on this behavior. Opt-in by `allowPackageExportsInDirectoryResolve: true`. See * vitejs/vite#20252 * nodejs/node#58827
github-merge-queue bot
pushed a commit
to rolldown/rolldown
that referenced
this pull request
Jun 26, 2025
For vitejs/vite#20252 --------- Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Member
Author
|
The behavior can now be aligned on native plugin side. |
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
For
require('./dir'), Node.js does not use theexportsfield ofdir/package.json.(Spec:
LOAD_AS_DIRECTORY(X) step 1.b)But Vite currently uses the
exportsfield in that case.This PR aligns the behavior to Node.js. This also aligns with oxc-resolver's behavior.
Note that this PR will break this line in nuxt.
https://github.com/nuxt/nuxt/blob/a7d21ece19e69703aac5fbb1f7bf53f0dfc5751f/test/setup-env.ts#L3