Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[metro-resolver] Respect transitive deps when using
nodeModulesPaths
This fixes #737 take a look at the issue for more info. I've also added a test case to hopefully catch this in the future. The order of the paths is important in this change. Without this change, the `allDirPaths` looks like this: ``` [ '/other-root/node_modules/banana-module', '/other-root/node_modules/banana/node_modules/banana-module', '/other-root/node_modules/node_modules/banana-module', '/other-root/node_modules/banana-module', '/node_modules/banana-module' ] ``` See how the `banana-module` nested inside `banana` is second & not first. With this change `allDirPaths` is update to this: ``` [ '/other-root/node_modules/banana/node_modules/banana-module', '/other-root/node_modules/node_modules/banana-module', '/other-root/node_modules/banana-module', '/node_modules/banana-module', '/other-root/node_modules/banana-module' ] ``` We correctly attempt to resolve the transitive `banan-module` dependency first.
- Loading branch information