Skip to content

Commit

Permalink
Add global hook to assert that base Metro config is called (#38126)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38126

Towards react-native-community/cli#1987. Will be paired with a CLI PR targeting React Native 0.72.1.

Changelog: None

Reviewed By: motiz88

Differential Revision: D47125080

fbshipit-source-id: 9c5eb9ed791ace7a1314ebc26e4dcf494cf190e1
  • Loading branch information
huntie authored and facebook-github-bot committed Jun 29, 2023
1 parent 0bd6b28 commit 99ef03d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/metro-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ function getDefaultConfig(
watchFolders: [],
};

// Set global hook so that the CLI can detect when this config has been loaded
global.__REACT_NATIVE_METRO_CONFIG_LOADED = true;

return mergeConfig(
getBaseConfig.getDefaultValues(projectRoot),
config,
Expand Down

0 comments on commit 99ef03d

Please sign in to comment.