Skip to content

Commit 6c65cda

Browse files
davidaurelioMartin Konicek
authored and
Martin Konicek
committed
Support relative paths in haste map
Summary: Since all paths are relative when building with the new Buck integration, `HasteMap` needed support for these. Reviewed By: cpojer Differential Revision: D4265888 fbshipit-source-id: 2d454bfd3866028d8d2c268c0fd318b148951dc9
1 parent c74f00e commit 6c65cda

File tree

1 file changed

+5
-1
lines changed
  • packager/react-packager/src/node-haste/DependencyGraph

1 file changed

+5
-1
lines changed

packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const PACKAGE_JSON = path.sep + 'package.json';
2020

2121
class HasteMap extends EventEmitter {
2222
constructor({
23+
allowRelativePaths,
2324
extensions,
2425
files,
2526
moduleCache,
@@ -28,6 +29,7 @@ class HasteMap extends EventEmitter {
2829
platforms,
2930
}) {
3031
super();
32+
this._allowRelativePaths = allowRelativePaths;
3133
this._extensions = extensions;
3234
this._files = files;
3335
this._helpers = helpers;
@@ -126,7 +128,9 @@ class HasteMap extends EventEmitter {
126128
}
127129

128130
_processHastePackage(file, previousName) {
129-
file = path.resolve(file);
131+
if (!this._allowRelativePaths) {
132+
file = path.resolve(file);
133+
}
130134
const p = this._moduleCache.getPackage(file);
131135
return p.isHaste()
132136
.then(isHaste => isHaste && p.getName()

0 commit comments

Comments
 (0)