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

Add main file for babel-node #10719

wants to merge 3 commits into
base: master


Copy link

dword-design commented Nov 15, 2019

Q                       A
Fixed Issues?
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

It sometimes makes sense to require.resolve a package in order to look for certain information/files. E.g. parses the binaries from packages in order to find out if it's an unused dependency. However, this requires the packages to have a main file. This PR simply adds lib/babel-node.js as the main fine.


This comment has been minimized.

Copy link

JLHwung commented Nov 15, 2019

I'm conservative on this change as adding a main entry will enable people to use require("@babel/node"), which we are not meant for.

Could Special options help depcheck to detech @babel/node?


This comment has been minimized.

Copy link
Contributor Author

dword-design commented Nov 15, 2019

Hey @JLHwung, bin special is in fact the special I'm using. This uses resolveFrom, which in turn uses require.resolve. Other options like resolve-bin also use require.resolve, so it always seems to come down to that :P.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.