-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Support module overrides in the browser field in package.json #1098
Comments
Browser field support is already implemented, so the question would be why this is not applying. Do you have an exact replication here to share? |
@guybedford i think improving the support for imports and exports should be more well defined so that when this filds are supplyed we take the browser fild from there we maybe should drop browser fild support in favor of that. typescript also introduced 2 new resolve algos to address that they call it node12 and nodenext if this is used the imports and exports get strict used. the browser fild overlapps with the imports map implementation done by node https://nodejs.org/api/packages.html#subpath-patterns maybe i should reference this: microsoft/TypeScript#47931 |
@guybedford For example, given the overrides in the "browser" field here: The following |
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ |
just my 5cent and a guide for people who come to this Guide Browser & NodeJS & Everything PackagingCreate indipendent package.json files reference them as workspace in your package.json (root one) then install only the root one your done. |
I think this is still an issue. |
Expected Behavior / Situation
If a package specifies module overrides in its "browser" field in package.json, e.g.
the plugin import logic shall respect these overrides if
{ brower: true }
has been supplied in the config (or if the browser field has been specified as the first priority via themainFields
option)Actual Behavior / Situation
the plugin import logic seems to ignore such overrides, so they have to be monkey-patched with @rollup/plugin-replace.
Modification Proposal
Implement full support for the
browser
field, including support for module import overrides.The text was updated successfully, but these errors were encountered: