-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Support "browser" deep module references #62
Comments
Actually, it seems that loadAsFile will need this behavior too. |
justinbmeyer
added a commit
to justinbmeyer/node-resolve
that referenced
this issue
Jan 19, 2015
ghost
pushed a commit
that referenced
this issue
Jan 27, 2015
Merged
This seems addressed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to support re-pathing "deep" directory references with the browser config. This was brought up here in node-browser-resolve. And it was suggested here that the changes partly belong in node-resolve.
To make this change, I will need to change node-resolve to make a better attempt to find the package.json and
opts
hook that supports repathing.loadAsDirectory
, given a path likex = "../node_modules/foo/bar"
will look for package.json in"../node_modules/package.json"
.If given a path without node_modules like:
x = "/Users/justin/dev/project/foo/bar"
, it will look for package.json in each folder until it finds it.If a "deep" module reference is being resolved, a package.json is found, and an
opts.pathFilter
is found,opts.pathFinder(pkg, x, relativeX)
will be called where:If
opts.pathFilter
returns a value, the returned value will be joined from the package.json location and passed toloadAsFile
. Otherwise, x will be used withloadAsFile
.Example:
Thoughts on this, the changes, and the choice of the
pathFilter
name and arguments? Thanks!/cc @defunctzombie
The text was updated successfully, but these errors were encountered: