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
  • Loading branch information
huntie committed Jun 1, 2023
1 parent a2e90fd commit 83ac6ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 111 deletions.
87 changes: 0 additions & 87 deletions packages/cli-plugin-metro/src/tools/getDefaultMetroConfig.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/cli-plugin-metro/src/tools/loadMetroConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fs from 'fs';
import path from 'path';
import {
ConfigT,
Expand All @@ -9,7 +8,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 @@ -95,28 +93,6 @@ export default async function loadMetroConfig(

logger.debug(`Reading Metro config from ${projectConfig.filepath}`);

if (
!/['"']@react-native\/metro-config['"']/.test(
fs.readFileSync(projectConfig.filepath, 'utf8'),
)
) {
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' +
'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(
await loadConfig({cwd: ctx.root, ...options}),
overrideConfig,
Expand Down

0 comments on commit 83ac6ea

Please sign in to comment.