-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
moduleDirectories vs modulePaths #1268
Comments
I was also confused by the difference between I had a working setup with
The error message is confusing too - perhaps it should link to the docs for these two options. Apparently |
Same error here. ...
nodeResolve({
moduleDirectories: [path.resolve('./node_modules')],
}), works until I update to the latest version. |
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ |
Yeah this was quite confusing to me as well. Seems like I could just drop-in replace moduleDirectories with modulePaths, but is very unclear on what the difference is exactly and when to use what. |
#1104 (review) here's a bit more info, I believe it was completely missed in this PR that this change was a breaking change. Users of this plugin may have relied on moduleDirectories being paths with '/'s, I certainly did, so breaking that by throwing an error and forcing users to use the new option is definitely a breaking change. |
Documentation Is:
Please Explain in Detail...
The descriptions for the two are not meaningfully different, in addition the link to
NODE_PATH
doesn't work and (assuming I found the current documentation) says roughly the same thing as the other two.I looked at the code and AFAICT
moduleDirectories
identifies stopping directories when trying to find thepackage.json
for a specific json file (i.e. it stops going up looking for further directories at that point). This surprises me because it seems to have nothing to do with the current description in the documentation, but somewhat explains why/
is forbidden (it would also be helpful if the error message mentioned/
explicitly since "name" does not always imply a single path segment).Having read the code, I'd guess that if you specify
a/b/c
as amodulePaths
element,moduleDirectories
should includec
for the same reason it by default includesnode_modules
.The text was updated successfully, but these errors were encountered: