Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions packages/community-cli-plugin/src/utils/loadMetroConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions packages/metro-config/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading