diff --git a/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js b/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js index f59cbdd3f31602..0ca654a2c456f3 100644 --- a/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js +++ b/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js @@ -20,6 +20,7 @@ const PACKAGE_JSON = path.sep + 'package.json'; class HasteMap extends EventEmitter { constructor({ + allowRelativePaths, extensions, files, moduleCache, @@ -28,6 +29,7 @@ class HasteMap extends EventEmitter { platforms, }) { super(); + this._allowRelativePaths = allowRelativePaths; this._extensions = extensions; this._files = files; this._helpers = helpers; @@ -126,7 +128,9 @@ class HasteMap extends EventEmitter { } _processHastePackage(file, previousName) { - file = path.resolve(file); + if (!this._allowRelativePaths) { + file = path.resolve(file); + } const p = this._moduleCache.getPackage(file); return p.isHaste() .then(isHaste => isHaste && p.getName()