Skip to content

Commit d722247

Browse files
committed
[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.
1 parent b89d6c8 commit d722247

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

local-cli/util/Config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const Config = {
189189
extraNodeModules: Object.create(null),
190190
getAssetExts: () => [],
191191
getBlacklistRE: () => blacklist(),
192-
getEnableBabelRCLookup: () => true,
192+
getEnableBabelRCLookup: () => false,
193193
getPlatforms: () => [],
194194
getPolyfillModuleNames: () => [],
195195
getProjectRoots: () => {

0 commit comments

Comments
 (0)