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 =
|
||||
log(createActionStartEntry('Initializing Packager'));
|
||||
opts.reporter.update({type: 'dep_graph_loading'});
|
||||
const haste = DependencyGraph._createHaste(opts);
|
||||
return haste.build().then(({hasteFS, moduleMap}) => {
|
||||
log(createActionEndEntry(initializingPackagerLogEntry));
|
||||
opts.reporter.update({type: 'dep_graph_loaded'});
|
||||
return new DependencyGraph({
|
||||
opts,
|
||||
haste,
|
||||
initialHasteFS: hasteFS,
|
||||
initialModuleMap: moduleMap,
|
||||
});
|
||||
const {hasteFS, moduleMap} = await haste.build();
|
||||
log(createActionEndEntry(initializingPackagerLogEntry));
|
||||
opts.reporter.update({type: 'dep_graph_loaded'});
|
||||
return new DependencyGraph({
|
||||
opts,
|
||||
haste,
|
||||
initialHasteFS: hasteFS,
|
||||
initialModuleMap: moduleMap,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue