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

Commit

Permalink
Updated metro config warning to reflect SDK 41 by default. (#3325)
Browse files Browse the repository at this point in the history
* Updated metro config to reflect SDK 41 by default.

* Update writeMetroConfig.ts

* Update writeMetroConfig.ts
  • Loading branch information
EvanBacon authored Mar 25, 2021
1 parent 1095103 commit 657832f
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit 657832f

Please sign in to comment.