mirror of https://github.com/status-im/metro.git
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
c00e669cf5
commit
548733e7e0
|
@ -56,7 +56,6 @@ export type FastFS = {
|
||||||
};
|
};
|
||||||
|
|
||||||
type HasteMapOptions = {|
|
type HasteMapOptions = {|
|
||||||
allowRelativePaths: boolean,
|
|
||||||
extensions: Extensions,
|
extensions: Extensions,
|
||||||
files: Array<string>,
|
files: Array<string>,
|
||||||
helpers: DependencyGraphHelpers,
|
helpers: DependencyGraphHelpers,
|
||||||
|
|
|
@ -61,7 +61,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn {
|
||||||
getTransformedFile,
|
getTransformedFile,
|
||||||
);
|
);
|
||||||
const hasteMap = new HasteMap({
|
const hasteMap = new HasteMap({
|
||||||
allowRelativePaths: true,
|
|
||||||
extensions: ['js', 'json'],
|
extensions: ['js', 'json'],
|
||||||
files,
|
files,
|
||||||
helpers,
|
helpers,
|
||||||
|
|
|
@ -20,7 +20,6 @@ const PACKAGE_JSON = path.sep + 'package.json';
|
||||||
|
|
||||||
class HasteMap extends EventEmitter {
|
class HasteMap extends EventEmitter {
|
||||||
constructor({
|
constructor({
|
||||||
allowRelativePaths,
|
|
||||||
extensions,
|
extensions,
|
||||||
files,
|
files,
|
||||||
moduleCache,
|
moduleCache,
|
||||||
|
@ -29,7 +28,6 @@ class HasteMap extends EventEmitter {
|
||||||
platforms,
|
platforms,
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
this._allowRelativePaths = allowRelativePaths;
|
|
||||||
this._extensions = extensions;
|
this._extensions = extensions;
|
||||||
this._files = files;
|
this._files = files;
|
||||||
this._helpers = helpers;
|
this._helpers = helpers;
|
||||||
|
@ -128,9 +126,6 @@ class HasteMap extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
_processHastePackage(file, previousName) {
|
_processHastePackage(file, previousName) {
|
||||||
if (!this._allowRelativePaths) {
|
|
||||||
file = path.resolve(file);
|
|
||||||
}
|
|
||||||
const p = this._moduleCache.getPackage(file);
|
const p = this._moduleCache.getPackage(file);
|
||||||
return p.isHaste()
|
return p.isHaste()
|
||||||
.then(isHaste => isHaste && p.getName()
|
.then(isHaste => isHaste && p.getName()
|
||||||
|
|
Loading…
Reference in New Issue