File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
packages/cli-plugin-metro/src/tools Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export type ConfigLoadingContext = Pick<
2020 'root' | 'reactNativePath' | 'platforms'
2121> ;
2222
23+ declare global {
24+ var __REACT_NATIVE_METRO_CONFIG_LOADED : boolean ;
25+ }
26+
2327/**
2428 * Get the config options to override based on RN CLI inputs.
2529 */
@@ -98,6 +102,9 @@ export default async function loadMetroConfig(
98102 logger . debug ( `Reading Metro config from ${ projectConfig . filepath } ` ) ;
99103
100104 if (
105+ ! global . __REACT_NATIVE_METRO_CONFIG_LOADED &&
106+ // TODO(huntie): Remove this check from 0.73 onwards (all users will be on
107+ // the next major @react -native/metro-config version)
101108 ! / [ ' " ' ] @ r e a c t - n a t i v e \/ m e t r o - c o n f i g [ ' " ' ] / . test (
102109 fs . readFileSync ( projectConfig . filepath , 'utf8' ) ,
103110 )
You can’t perform that action at this time.
0 commit comments