From 6bcad15e7bba7e9bb8cc782121adcd99330ccb26 Mon Sep 17 00:00:00 2001 From: aleclarson Date: Tue, 20 Sep 2016 20:52:30 -0700 Subject: [PATCH] Fix 'isRelativeImport' to allow require('.') and require('..') MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: davidaurelio 👍 Closes https://github.com/facebook/react-native/pull/10006 Differential Revision: D3898703 fbshipit-source-id: 6d88122ed56108d52bc1ae1b14c7ff7c39fd9b9a --- .../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 7a174c5e..9d2dd39e 100644 --- a/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js +++ b/react-packager/src/node-haste/DependencyGraph/ResolutionRequest.js @@ -533,7 +533,7 @@ function resolveKeyWithPromise([key, promise]) { } function isRelativeImport(path) { - return /^[.][.]?[/]/.test(path); + return /^[.][.]?(?:[/]|$)/.test(path); } module.exports = ResolutionRequest;