-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Vite prefers module main field over exports browser field in library package.json #10103
Comments
I have the same issue, except that even |
Ooofff the way Vite resolves entry points from |
This should be fixed by #11595 |
Well technically resolved. Not "not planned" but nevermind. |
Describe the bug
I have a library that defines:
Contrary to the docs and expected behavior. Vite picks
"module": "./node.mjs"
and I getNode ESM
printed. According to the docs, and Node.JS behavior,exports
should be preferred and used when specified (P.S. Vite AFAIK doesn't use thebrowser
main field).Reproduction
https://stackblitz.com/edit/vitejs-vite-sh5wuy?file=lib/package.json
System Info
Used Package Manager
pnpm
Logs
Click to expand!
It should be
Browser ESM
.Validations
The text was updated successfully, but these errors were encountered: