Use absolute paths from repo root
Summary: Rather than using relative paths from the build root, this switches all paths to absolute paths from the build root. This makes integration with a lot of tooling easier. Reviewed By: jeanlauliac Differential Revision: D4285474 fbshipit-source-id: 80d20e0f6dc61a310e72112b9654628bff81a4f0
This commit is contained in:
parent
a47678b3e9
commit
cf3ae6c32a
|
@ -56,7 +56,6 @@ export type FastFS = {
|
|||
};
|
||||
|
||||
type HasteMapOptions = {|
|
||||
allowRelativePaths: boolean,
|
||||
extensions: Extensions,
|
||||
files: Array<string>,
|
||||
helpers: DependencyGraphHelpers,
|
||||
|
|
|
@ -61,7 +61,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn {
|
|||
getTransformedFile,
|
||||
);
|
||||
const hasteMap = new HasteMap({
|
||||
allowRelativePaths: true,
|
||||
extensions: ['js', 'json'],
|
||||
files,
|
||||
helpers,
|
||||
|
|
|
@ -20,7 +20,6 @@ const PACKAGE_JSON = path.sep + 'package.json';
|
|||
|
||||
class HasteMap extends EventEmitter {
|
||||
constructor({
|
||||
allowRelativePaths,
|
||||
extensions,
|
||||
files,
|
||||
moduleCache,
|
||||
|
@ -29,7 +28,6 @@ class HasteMap extends EventEmitter {
|
|||
platforms,
|
||||
}) {
|
||||
super();
|
||||
this._allowRelativePaths = allowRelativePaths;
|
||||
this._extensions = extensions;
|
||||
this._files = files;
|
||||
this._helpers = helpers;
|
||||
|
@ -128,9 +126,6 @@ class HasteMap extends EventEmitter {
|
|||
}
|
||||
|
||||
_processHastePackage(file, previousName) {
|
||||
if (!this._allowRelativePaths) {
|
||||
file = path.resolve(file);
|
||||
}
|
||||
const p = this._moduleCache.getPackage(file);
|
||||
return p.isHaste()
|
||||
.then(isHaste => isHaste && p.getName()
|
||||
|
|
Loading…
Reference in New Issue