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
This commit is contained in:
David Aurelio 2016-10-22 06:05:52 -07:00 committed by Facebook Github Bot
parent 18c4ae81e7
commit 74a5b35802

View File

@ -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)) {