-
-
Notifications
You must be signed in to change notification settings - Fork 588
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
Follow up to #843, refining exports and browser field interaction #866
Conversation
1f43194
to
1f60002
Compare
It looks like we have some issues with pnpm and the latest major, and some dependency issues. I'll get those cleaned up soon. |
We've just updated |
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 for the PR @Jarreddebeer. I like the idea of having the browser: true
option also enable the browser
condition, so a +1 from me here.
packages/node-resolve/test/fixtures/node_modules/exports-browser/package.json
Outdated
Show resolved
Hide resolved
…rrides pkg.browser
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.
LGTM, I like the unified browser: true
switch here.
Rollup Plugin Name:
node-resolve
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers: #843, #786
Description
This is a follow up to #843 and #786 based on refining the interaction between the exports and browser field. Specifically of the cases tested in #843. It updates the resolution of the exports field to apply browser internal mappings from the browser field only. Update: It appears upstream changes to node-resolve/src/index.js handle the browser internal mappings, so I have removed the files changed relating to that from the PR.
To help aid usability of exports and browser interaction this PR also made it so that setting {browser: true} in the options will also automatically apply the browser exports conditions. This will avoid common pitfalls by having a single configuration for browser mapping.
Tests are adapted from #843 and the output are aligned with webpack output for the web target.
Thanks for your review in advance.