Skip to content

Commit

Permalink
breaking: Remove fallback flow for Metro config defaults (0.73)
Browse files Browse the repository at this point in the history
Reverts #1896
  • Loading branch information
huntie committed Jun 20, 2023
1 parent 7bac38a commit 054d6e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 100 deletions.
87 changes: 0 additions & 87 deletions packages/cli-plugin-metro/src/tools/getDefaultMetroConfig.ts

This file was deleted.

16 changes: 3 additions & 13 deletions packages/cli-plugin-metro/src/tools/loadMetroConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from 'metro-config';
import {CLIError, logger} from '@react-native-community/cli-tools';
import type {Config} from '@react-native-community/cli-types';
import getDefaultMetroConfig from './getDefaultMetroConfig';
import {reactNativePlatformResolver} from './metroPlatformResolver';

export type {Config};
Expand Down Expand Up @@ -101,20 +100,11 @@ export default async function loadMetroConfig(
)
) {
logger.warn(
'From React Native 0.72, your metro.config.js file should extend' +
"'@react-native/metro-config'. Please see the React Native 0.72 " +
'changelog, or copy the template at:\n' +
'From React Native 0.73, your metro.config.js file should extend' +
"'@react-native/metro-config' or it will fail to build. Please copy " +
'the template at:\n' +
'https://github.com/facebook/react-native/blob/main/packages/react-native/template/metro.config.js',
);
logger.warn('Falling back to internal defaults.');

const loadedConfig = await loadConfig(
{cwd: ctx.root, ...options},
// Provide React Native defaults on top of Metro defaults
getDefaultMetroConfig(ctx),
);

return mergeConfig(loadedConfig, overrideConfig);
}

return mergeConfig(
Expand Down

0 comments on commit 054d6e6

Please sign in to comment.