-
Notifications
You must be signed in to change notification settings - Fork 41
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
Expose require.resolve.paths()
#20
Conversation
@zertosh Is there any hope of getting this merged and released? It's a terrific module that benefits our application's performance significantly, but breaks the node SDK in this one small but important way. I have a potential workaround to monkey patches the gap, but it's much uglier than this actual fix. |
Let me take a look at re-syncing |
Thanks! |
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.
New PR coming up
@@ -161,6 +162,7 @@ class NativeCompileCache { | |||
require.resolve = function(request, options) { | |||
return Module._resolveFilename(request, mod, false, options); | |||
}; | |||
require.resolve.paths = resolvePaths; |
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.
paths
depends on the calling module: https://github.com/nodejs/node/blob/v12.2.0/lib/internal/modules/cjs/helpers.js#L26-L29
As-is, every module that uses require.paths
would be doing so using the v8-compile-cache
's require.paths
- not the one unique to them.
Published the fix as |
Thank you! |
As outlined in #17 - overriding
require.resolve
removesrequire.resolve.paths
from existence. This PR ensures it is proxies as-is.Closes #17