Skip to content

Commit

Permalink
fix: pass --projectRoot argument to Metro (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador authored and thymikee committed Mar 22, 2019
1 parent c6d46b3 commit 88d7459
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/cli/src/commands/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ async function runServer(argv: Array<string>, ctx: ContextT, args: Args) {
port: args.port,
resetCache: args.resetCache,
watchFolders: args.watchFolders,
projectRoot: ctx.root,
sourceExts: args.sourceExts,
reporter,
});
Expand Down
19 changes: 4 additions & 15 deletions packages/cli/src/tools/loadMetroConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const getDefaultConfig = (ctx: ContextT) => {
export type ConfigOptionsT = {|
maxWorkers?: number,
port?: number,
projectRoot?: string,
resetCache?: boolean,
watchFolders?: string[],
sourceExts?: string[],
Expand All @@ -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);
}

0 comments on commit 88d7459

Please sign in to comment.