File tree Expand file tree Collapse file tree
packages/cli-plugin-metro/src/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,10 +92,17 @@ export default async function loadMetroConfig(
9292 overrideConfig . reporter = options . reporter ;
9393 }
9494
95- const projectConfig = await resolveConfig ( undefined , ctx . root ) ;
95+ const cwd = ctx . root ;
96+ const projectConfig = await resolveConfig ( options . config , cwd ) ;
9697
9798 if ( projectConfig . isEmpty ) {
98- throw new CLIError ( `No metro config found in ${ ctx . root } ` ) ;
99+ if ( options . config ) {
100+ throw new CLIError (
101+ `No Metro config found at configured config path '${ options . config } '` ,
102+ ) ;
103+ }
104+
105+ throw new CLIError ( `No Metro config found in ${ cwd } ` ) ;
99106 }
100107
101108 logger . debug ( `Reading Metro config from ${ projectConfig . filepath } ` ) ;
@@ -119,7 +126,10 @@ This warning will be removed in future (https://github.com/facebook/metro/issues
119126 }
120127
121128 return mergeConfig (
122- await loadConfig ( { cwd : ctx . root , ...options } ) ,
129+ await loadConfig ( {
130+ cwd,
131+ ...options ,
132+ } ) ,
123133 overrideConfig ,
124134 ) ;
125135}
You can’t perform that action at this time.
0 commit comments