diff --git a/packages/cli/src/commands/server/runServer.js b/packages/cli/src/commands/server/runServer.js index 08ae789909..8b20376c1f 100644 --- a/packages/cli/src/commands/server/runServer.js +++ b/packages/cli/src/commands/server/runServer.js @@ -51,6 +51,7 @@ async function runServer(argv: Array, ctx: ContextT, args: Args) { port: args.port, resetCache: args.resetCache, watchFolders: args.watchFolders, + projectRoot: ctx.root, sourceExts: args.sourceExts, reporter, }); diff --git a/packages/cli/src/tools/loadMetroConfig.js b/packages/cli/src/tools/loadMetroConfig.js index 3d15e59d36..286b5bce1c 100644 --- a/packages/cli/src/tools/loadMetroConfig.js +++ b/packages/cli/src/tools/loadMetroConfig.js @@ -73,6 +73,7 @@ export const getDefaultConfig = (ctx: ContextT) => { export type ConfigOptionsT = {| maxWorkers?: number, port?: number, + projectRoot?: string, resetCache?: boolean, watchFolders?: string[], sourceExts?: string[], @@ -85,20 +86,8 @@ export type ConfigOptionsT = {| * * This allows the CLI to always overwrite the file settings. */ -export default (async function load( - ctx: ContextT, - // $FlowFixMe - troubles with empty object being inexact - options?: ConfigOptionsT = {}, -) { +export default function load(ctx: ContextT, options?: ConfigOptionsT) { const defaultConfig = getDefaultConfig(ctx); - const config = await loadConfig( - { - cwd: ctx.root, - ...options, - }, - defaultConfig, - ); - - return config; -}); + return loadConfig({cwd: ctx.root, ...options}, defaultConfig); +}