Improve Flow coverage

Reviewed By: mjesun

Differential Revision: D6999089

fbshipit-source-id: 5dfaef91909060b5a2bec0030048e97c2c2c3698
This commit is contained in:
Peter van der Zee 2018-02-19 03:56:35 -08:00 committed by Facebook Github Bot
parent 2a327fb19d
commit dd48bb1fa3
1 changed files with 17 additions and 8 deletions

View File

@ -157,14 +157,23 @@ class Server {
this._fileChangeListeners = [];
this._platforms = new Set(this._opts.platforms);
const bundlerOpts = Object.create(this._opts);
bundlerOpts.globalTransformCache = options.globalTransformCache;
bundlerOpts.watch = this._opts.watch;
bundlerOpts.reporter = reporter;
bundlerOpts.asyncRequireModulePath =
// This slices out options that are not part of the strict BundlerOptions
/* eslint-disable no-unused-vars */
const {
createModuleIdFactory,
getModulesRunBeforeMainModule,
moduleFormat,
silent,
...bundlerOptionsFromServerOptions
} = this._opts;
/* eslint-enable no-unused-vars */
this._bundler = new Bundler({
...bundlerOptionsFromServerOptions,
asyncRequireModulePath:
options.asyncRequireModulePath ||
'metro/src/lib/bundle-modules/asyncRequire';
this._bundler = new Bundler(bundlerOpts);
'metro/src/lib/bundle-modules/asyncRequire',
});
// changes to the haste map can affect resolution of files in the bundle
this._bundler.getDependencyGraph().then(dependencyGraph => {