diff --git a/packages/metro-bundler/src/node-haste/index.js b/packages/metro-bundler/src/node-haste/index.js index e4b502ec..55bf309a 100644 --- a/packages/metro-bundler/src/node-haste/index.js +++ b/packages/metro-bundler/src/node-haste/index.js @@ -115,20 +115,19 @@ class DependencyGraph extends EventEmitter { }); } - static load(opts: Options): Promise { + static async load(opts: Options): Promise { 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, }); }