Skip to content
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

feat(node-resolve): allow preferBuiltins to be a function #1694

Merged

Conversation

younggglcy
Copy link
Contributor

@younggglcy younggglcy commented Mar 17, 2024

Rollup Plugin Name: @rollup/plugin-node-resolve

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

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: resolves #1655

Description

I think #1665 proposes a nice feature that gives preferBuiltins a more fine-grained control, so I'm trying to resolve this a little inactive issue.

This PR only makes node-resolve accept a function parameter to preferBuiltins to introduce as little as possible without changing the existing API.

#1665 also proposes that it should match the behavior of the external rollup configuration. But I think in most cases, we only need to mark some modules as non-builtins, e.g., deprecated modules like punycode. And this is somehow contrary to the behavior of the external.

Is accepting a function enough or should we add some extra configs? I'm willing to contribute if we need to make more changes.

@younggglcy younggglcy requested a review from tjenkinson as a code owner March 17, 2024 10:08
@younggglcy younggglcy force-pushed the feat/node_resolve_prefer_bulitins branch from 9eaa425 to 7e12e8c Compare June 6, 2024 11:30
@younggglcy younggglcy requested a review from tada5hi as a code owner June 6, 2024 11:30
@younggglcy younggglcy force-pushed the feat/node_resolve_prefer_bulitins branch from 7e12e8c to 9eaa425 Compare June 6, 2024 11:36
@shellscape
Copy link
Collaborator

@younggglcy please take a look at the conflict that popped up. we're good to merge once that's resolved.

@younggglcy
Copy link
Contributor Author

@younggglcy please take a look at the conflict that popped up. we're good to merge once that's resolved.

Sure, I'll handle it off work

@younggglcy younggglcy force-pushed the feat/node_resolve_prefer_bulitins branch from 9eaa425 to 7642e85 Compare September 23, 2024 16:57
@younggglcy younggglcy force-pushed the feat/node_resolve_prefer_bulitins branch from 7642e85 to 5c24008 Compare September 23, 2024 17:12
@younggglcy
Copy link
Contributor Author

@younggglcy please take a look at the conflict that popped up. we're good to merge once that's resolved.

Done.
Please let me know if I missed something.

@shellscape
Copy link
Collaborator

thanks!

@shellscape shellscape merged commit 032055b into rollup:master Sep 23, 2024
5 checks passed
@younggglcy younggglcy deleted the feat/node_resolve_prefer_bulitins branch September 29, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node-resolve: allow more granular config of preferBuiltins
3 participants