Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Updated metro config warning to reflect SDK 41 by default. #3325

Merged
merged 3 commits into from
Mar 25, 2021
Merged
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
18 changes: 9 additions & 9 deletions packages/expo-cli/src/commands/eject/writeMetroConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function writeMetroConfig({
* hashAssetFiles plugin manually.
*/

const updatingMetroConfigStep = CreateApp.logNewSection('Adding Metro bundler configuration');
const updatingMetroConfigStep = CreateApp.logNewSection('Adding Metro bundler config');

try {
const sourceConfigPath = path.join(tempDir, 'metro.config.js');
Expand All @@ -34,7 +34,7 @@ export function writeMetroConfig({
const contents = createFileHash(fs.readFileSync(targetConfigPath, 'utf8'));
const targetContents = createFileHash(fs.readFileSync(sourceConfigPath, 'utf8'));
if (contents !== targetContents) {
throw new CommandError('Existing Metro configuration found; not overwriting.');
throw new CommandError('Existing Metro config found; not overwriting.');
} else {
// Nothing to change, hide the step and exit.
updatingMetroConfigStep.stop();
Expand All @@ -46,22 +46,22 @@ export function writeMetroConfig({
pkg.metro ||
fs.existsSync(path.join(projectRoot, 'rn-cli.config.js'))
) {
throw new CommandError('Existing Metro configuration found; not overwriting.');
throw new CommandError('Existing Metro config found; not overwriting.');
}

fs.copySync(sourceConfigPath, targetConfigPath);
updatingMetroConfigStep.succeed('Added Metro bundler configuration.');
updatingMetroConfigStep.succeed('Added Metro config.');
} catch (e) {
updatingMetroConfigStep.stopAndPersist({
symbol: '⚠️ ',
text: chalk.yellow('Metro bundler configuration not applied:'),
text: chalk.yellow('Skipped Metro config updates:'),
});
Log.nested(`\u203A ${e.message}`);
Log.nested(
`\u203A You will need to add the ${chalk.bold(
'hashAssetFiles'
)} plugin to your Metro configuration.\n ${Log.chalk.dim(
learnMore('https://docs.expo.io/bare/installing-updates/')
`\u203A You will need to extend the default ${chalk.bold(
'@expo/metro-config'
)} in your Metro config.\n ${Log.chalk.dim(
learnMore('https://docs.expo.io/guides/customizing-metro')
)}`
);
Log.newLine();
Expand Down