-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix exports
field
#5626
Fix exports
field
#5626
Conversation
🦋 Changeset detectedLatest commit: 603bd7a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 603bd7a:
|
…oduleResolution: bundler`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @emmatown
closes #5595
closes #4859
The
exports
field added in #5559 was wrong in a few ways, arethetypeswrong explains this well:This PR makes react-select use Preconstruct's exports field feature which does things correctly, I've also checked the build output on this branch with arethetypeswrong and it reports no errors. Of note is that there is still no bundle for Node ESM, the
.mjs
file used when theimport
condition matches just re-exports from the CJS bundle but fixes the default export (this is new to Preconstruct and is what"importConditionDefaultExport": "default"
is doing), the lack of a Node ESM bundle is intentional so the dual package hazard can't happen. Bundlers will use themodule
condition to still have ESM there. There is also intentionally notypes
condition, that's unnecessary because Typescript will resolve to theimport
ordefault
conditions and use the.d.mts
and.d.ts
files next to the implementations.