diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index 1541e0e5cff..90e92e70dd7 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -158,6 +158,7 @@ function getPackagerServer(args, config) { assetExts: defaultAssetExts.concat(args.assetExts), blacklistRE: config.getBlacklistRE(), cacheVersion: '3', + enableBabelRCLookup: config.getEnableBabelRCLookup(), extraNodeModules: config.extraNodeModules, getTransformOptions: config.getTransformOptions, hasteImpl: config.hasteImpl, diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 3085969f86f..24d618a4a45 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -49,6 +49,13 @@ export type ConfigT = { */ getBlacklistRE(): RegExp, + /** + * Specify whether or not to enable Babel's behavior for looking up .babelrc + * files. If false, only the .babelrc file (if one exists) in the main project + * root is used. + */ + getEnableBabelRCLookup(): boolean, + /** * Specify any additional polyfill modules that should be processed * before regular module loading. @@ -158,6 +165,7 @@ const Config = { extraNodeModules: Object.create(null), getAssetExts: () => [], getBlacklistRE: () => blacklist(), + getEnableBabelRCLookup: () => true, getPlatforms: () => [], getPolyfillModuleNames: () => [], getProjectRoots: () => {