From 29f2602ff9c3c9a9999c54a6004c99d6fd15ebc3 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 29 Jun 2023 08:51:14 -0700 Subject: [PATCH] Add global hook to assert that base Metro config is called (#38126) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38126 Towards https://github.com/react-native-community/cli/issues/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: b3b9d93ba747240f5168021ccb793ffe5d34251d --- packages/metro-config/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/metro-config/index.js b/packages/metro-config/index.js index c43b46a34b8cf9..091b7006e14cd7 100644 --- a/packages/metro-config/index.js +++ b/packages/metro-config/index.js @@ -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,