-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
chore(node-resolve): remove is-builtin-module #1735
Conversation
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.
Great that this is built in now TIL
Makes sense if we're not supporting <16
FYI the engine constraint in here actually specifies 14 or something. Which is why I have used the built in modules list (available in 14), but not Just to be clear If we can bump the engine constraint to 16, we could use the built in function |
Node has shipped `builtinModules` for some time now, so we no longer need a third party package to do this. Once the `engines` constraint is bumped in the `package.json`, we can also move to using the built-in `isBuiltin` function (available since 16.x).
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!
any chance we can get this merged? 👀 would be a good to pull it into a few dependents |
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
import isBuiltinModule from 'is-builtin-module'; | ||
import { builtinModules } from 'module'; |
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.
Won't this cause a behavior change if you're bundling on one version of node, but a newer node has that module available? Or does it not matter because node will never add any new module without the node:
prefix?
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.
It's unlikely they will add any new modules without the prefix as far as I understand
Also the third party package also has a fixed list which won't always be accurate to the runtime node
@shellscape any chance you can take a look at this? would be good to close it off |
any possibility of a review from someone here? would be super nice to merge this so it doesn't get left behind |
Node has shipped
builtinModules
for some time now, so we no longer need a third party package to do this.Once the
engines
constraint is bumped in thepackage.json
, we can also move to using the built-inisBuiltin
function (available since 16.x).Rollup Plugin Name:
node-resolve
This PR contains:
Are tests included?
Breaking Changes?