-
Notifications
You must be signed in to change notification settings - Fork 99
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
Prefer Node's core modules over file modules #60
Conversation
Hmm, right, I tested the code in JavaScript without thinking too much. Turns out I'll close this PR until a better way is found. |
Apparently there is |
We could use a hardcoded list when node < 9.3.0?
|
Checking |
Works for me, hold on... |
This commit makes this resolver behave like Node does [0]: "Core modules are always preferentially loaded if their identifier is passed to require()" Additionally this increases performance by avoiding unnecessary disk access. For example webpack calls require("crypto") in a loop. This commit fixes #56. [0]: https://nodejs.org/api/modules.html#modules_core_modules
@ljani Thanks! |
Could this be published to npm? Thanks! |
Published in 3.6.0, sorry for the delay :-). |
This commit makes this resolver behave like Node does:
Additionally this increases performance by avoiding unnecessary disk access. For example
webpack
callsrequire("crypto")
in a loop.This commit fixes #56.