mirror of https://github.com/status-im/metro.git
packager: node-haste: async load()
Reviewed By: cpojer Differential Revision: D4673384 fbshipit-source-id: 816529f8947079b4003c8e91443e221184fd589d
This commit is contained in:
parent
e2ffd8d08b
commit
e1a2633f69
|
@ -115,20 +115,19 @@ class DependencyGraph extends EventEmitter {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static load(opts: Options): Promise<DependencyGraph> {
|
static async load(opts: Options): Promise<DependencyGraph> {
|
||||||
const initializingPackagerLogEntry =
|
const initializingPackagerLogEntry =
|
||||||
log(createActionStartEntry('Initializing Packager'));
|
log(createActionStartEntry('Initializing Packager'));
|
||||||
opts.reporter.update({type: 'dep_graph_loading'});
|
opts.reporter.update({type: 'dep_graph_loading'});
|
||||||
const haste = DependencyGraph._createHaste(opts);
|
const haste = DependencyGraph._createHaste(opts);
|
||||||
return haste.build().then(({hasteFS, moduleMap}) => {
|
const {hasteFS, moduleMap} = await haste.build();
|
||||||
log(createActionEndEntry(initializingPackagerLogEntry));
|
log(createActionEndEntry(initializingPackagerLogEntry));
|
||||||
opts.reporter.update({type: 'dep_graph_loaded'});
|
opts.reporter.update({type: 'dep_graph_loaded'});
|
||||||
return new DependencyGraph({
|
return new DependencyGraph({
|
||||||
opts,
|
opts,
|
||||||
haste,
|
haste,
|
||||||
initialHasteFS: hasteFS,
|
initialHasteFS: hasteFS,
|
||||||
initialModuleMap: moduleMap,
|
initialModuleMap: moduleMap,
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue