From 35bd17f1d6a99368ecf6a7f94902bd550827d0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Mon, 13 Aug 2018 10:26:58 -0700 Subject: [PATCH] Switch babel preset to metro-react-native-babel-preset (#20653) Summary: Fixes #20567 Pull Request resolved: https://github.com/facebook/react-native/pull/20653 Differential Revision: D9296819 Pulled By: hramos fbshipit-source-id: 88953afb9778e3c8cde5576b068888fd882c2220 --- local-cli/init/init.js | 2 +- local-cli/templates/HelloWorld/_babelrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/local-cli/init/init.js b/local-cli/init/init.js index d7497a4a8..54324c152 100644 --- a/local-cli/init/init.js +++ b/local-cli/init/init.js @@ -99,7 +99,7 @@ function generateProject(destinationRoot, newProjectName, options) { }); } if (!options['skip-jest']) { - const jestDeps = `jest babel-jest babel-preset-react-native@^5 react-test-renderer@${reactVersion}`; + const jestDeps = `jest babel-jest metro-react-native-babel-preset@^0.43.5 react-test-renderer@${reactVersion}`; if (yarnVersion) { console.log('Adding Jest...'); execSync(`yarn add ${jestDeps} --dev --exact`, {stdio: 'inherit'}); diff --git a/local-cli/templates/HelloWorld/_babelrc b/local-cli/templates/HelloWorld/_babelrc index a9ce1369e..d4b74b5be 100644 --- a/local-cli/templates/HelloWorld/_babelrc +++ b/local-cli/templates/HelloWorld/_babelrc @@ -1,3 +1,3 @@ { - "presets": ["react-native"] + "presets": ["module:metro-react-native-babel-preset"] }