mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove RN metro-config migration checks (#57648)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57648 Legacy check, clean up. Changelog: [Internal] ___ Differential Revision: D113396915 fbshipit-source-id: 697b65f1a02a98949f490b2cc94d0864d52d1472
This commit is contained in:
1 parent
855548c640
commit
bf691fa53c
2 files changed
-19
No files matched your search
@@ -96,8 +96,6 @@ export default async function loadMetroConfig(
|
||||
|
||||
// Get the RN defaults before our customisations
|
||||
const defaultConfig = RNMetroConfig.getDefaultConfig(ctx.root);
|
||||
// Unflag the config as being loaded - it must be loaded again in userland.
|
||||
global.__REACT_NATIVE_METRO_CONFIG_LOADED = false;
|
||||
|
||||
// Add our defaults to `@react-native/metro-config` before the user config
|
||||
// loads them.
|
||||
@@ -119,20 +117,6 @@ export default async function loadMetroConfig(
|
||||
|
||||
debug(`Reading Metro config from ${projectConfig.filepath}`);
|
||||
|
||||
if (!global.__REACT_NATIVE_METRO_CONFIG_LOADED) {
|
||||
const warning = `
|
||||
=================================================================================================
|
||||
From React Native 0.73, your project's Metro config should extend '@react-native/metro-config'
|
||||
or it will fail to build. Please copy the template at:
|
||||
https://github.com/react-native-community/template/blob/main/template/metro.config.js
|
||||
This warning will be removed in future (https://github.com/facebook/metro/issues/1018).
|
||||
=================================================================================================
|
||||
`;
|
||||
|
||||
for (const line of warning.trim().split('\n')) {
|
||||
console.warn(line);
|
||||
}
|
||||
}
|
||||
return loadConfig({
|
||||
cwd,
|
||||
...options,
|
||||
|
||||
@@ -99,9 +99,6 @@ export function getDefaultConfig(projectRoot: string): ConfigT {
|
||||
watchFolders: [],
|
||||
};
|
||||
|
||||
// Set global hook so that the CLI can detect when this config has been loaded
|
||||
global.__REACT_NATIVE_METRO_CONFIG_LOADED = true;
|
||||
|
||||
const metroDefaults = getBaseConfig.getDefaultValues(projectRoot);
|
||||
|
||||
return mergeConfig(metroDefaults, reactNativeDefaults, frameworkDefaults);
|
||||
|
||||
Reference in new issue
Block a user