diff --git a/flow-github/metro.js b/flow-github/metro.js index 2e262712c..03992f6ed 100644 --- a/flow-github/metro.js +++ b/flow-github/metro.js @@ -27,3 +27,39 @@ declare module 'metro/src/lib/bundle-modules/HMRClient' { declare module 'metro/src/lib/TerminalReporter' { declare module.exports: any; } + +declare module 'metro/src/Bundler' { + declare module.exports: any; +} + +declare module 'metro/src/DeltaBundler' { + declare module.exports: any; +} + +declare module 'metro/src/ModuleGraph/types.flow.js' { + declare module.exports: any; +} + +declare module 'metro/src/lib/getMaxWorkers' { + declare module.exports: any; +} + +declare module 'metro/src/lib/createModuleIdFactory' { + declare module.exports: any; +} + +declare module 'metro/src/shared/types.flow' { + declare module.exports: any; +} + +declare module 'metro/src/lib/reporting' { + declare module.exports: any; +} + +declare module 'metro/src/Server' { + declare module.exports: any; +} + +declare module 'metro/src/ModuleGraph/worker/collectDependencies' { + declare module.exports: any; +} diff --git a/local-cli/core/index.js b/local-cli/core/index.js index 95028f0ea..47d099e74 100644 --- a/local-cli/core/index.js +++ b/local-cli/core/index.js @@ -129,7 +129,9 @@ const defaultRNConfig = { */ async function getCliConfig(): Promise { const cliArgs = minimist(process.argv.slice(2)); - const config = await Config.load(path.resolve(__dirname, cliArgs.config)); + const config = await Config.load( + cliArgs.config != null ? path.resolve(__dirname, cliArgs.config) : null, + ); config.transformer.assetRegistryPath = ASSET_REGISTRY_PATH; config.resolver.hasteImplModulePath = defaultConfig.hasteImplModulePath; diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 77f67e379..2222b9bcc 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -84,8 +84,10 @@ const Config = { getProjectPath, getProjectRoots, - async load(configFile: string): Promise { - const config: ConfigT = await loadConfig({config: configFile}); + async load(configFile: ?string): Promise { + const config: ConfigT = await loadConfig( + configFile ? {config: configFile} : {}, + ); return mergeConfig(config, this.DEFAULT); },