From d722247f8955bbfa0df838b744a444eaa1b2cf65 Mon Sep 17 00:00:00 2001 From: James Ide Date: Thu, 7 Sep 2017 19:13:02 -0700 Subject: [PATCH] [packager][breaking-change] Default enableBabelRCLookup (recursive) to false This is a breaking change that tells Metro to look at only the project's .babelrc file. Previously it would look at .babelrc files under node_modules and would run into issues because it didn't have the version of Babel nor the plugins/presets that `node_modules/randompackage/.babelrc` wanted. So as a workaround, people would write a postinstall step that deletes `node_modules/**/.babelrc`, which worked well. This flag (`getEnableBabelRCLookup = false`) has the same effect and hopefully fixes one source of cryptic bugs people run into. To use the old behavior, create a config file named `rn-cli.config.js` with: ```js module.exports = { getEnableBabelRCLookup() { return true; }, }; ``` Test Plan: Go under node_modules, modify a used module to have a dummy .babelrc (`{"plugins": ["dummy"]}`) and ensure the JS bundle still loads. --- local-cli/util/Config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 7ba6b63837052b..a17645a27ca28a 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -189,7 +189,7 @@ const Config = { extraNodeModules: Object.create(null), getAssetExts: () => [], getBlacklistRE: () => blacklist(), - getEnableBabelRCLookup: () => true, + getEnableBabelRCLookup: () => false, getPlatforms: () => [], getPolyfillModuleNames: () => [], getProjectRoots: () => {