From 74a5b35802e56cefef73c8b23fe72e3be39dc03f Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Sat, 22 Oct 2016 06:05:52 -0700 Subject: [PATCH] Add support for relative paths to ResolutionRequest Summary: This makes ResolutionRequest stop calling `dirname` when arriving at `"."`, not only at `parse(path).root`. Needed for Buck integration, as we are using relative paths there Reviewed By: cpojer Differential Revision: D4058723 fbshipit-source-id: d1856043193cfad3f750577ba0f63f03f8effe7a --- .../src/node-haste/DependencyGraph/ResolutionRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js b/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js index ef31b4a5..dff5b745 100644 --- a/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js +++ b/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js @@ -356,7 +356,7 @@ class ResolutionRequest { const searchQueue = []; for (let currDir = path.dirname(fromModule.path); - currDir !== realPath.parse(fromModule.path).root; + currDir !== '.' && currDir !== realPath.parse(fromModule.path).root; currDir = path.dirname(currDir)) { const searchPath = path.join(currDir, 'node_modules'); if (this._fastfs.dirExists(searchPath)) {