Control whether Metro tells Babel to lookup .babelrc files
Summary: This adds support to RN's configuration file to let people turn off Babel's behavior of looking up .babelrc files. Most of the support for this feature is in Metro (https://github.com/facebook/metro-bundler/pull/31). Closes https://github.com/facebook/react-native/pull/15136 Differential Revision: D5483241 Pulled By: jeanlauliac fbshipit-source-id: c78096c1574c9f844c9f34aff73e6f97cb0b5e45
This commit is contained in:
Родитель
6ad5e2fa7c
Коммит
113e046444
|
@ -152,6 +152,7 @@ function getPackagerServer(args, config) {
|
|||
assetRegistryPath: ASSET_REGISTRY_PATH,
|
||||
blacklistRE: config.getBlacklistRE(),
|
||||
cacheVersion: '3',
|
||||
enableBabelRCLookup: config.getEnableBabelRCLookup(),
|
||||
extraNodeModules: config.extraNodeModules,
|
||||
getPolyfills: config.getPolyfills,
|
||||
getTransformOptions: config.getTransformOptions,
|
||||
|
|
|
@ -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.
|
||||
|
@ -164,6 +171,7 @@ const Config = {
|
|||
extraNodeModules: Object.create(null),
|
||||
getAssetExts: () => [],
|
||||
getBlacklistRE: () => blacklist(),
|
||||
getEnableBabelRCLookup: () => true,
|
||||
getPlatforms: () => [],
|
||||
getPolyfillModuleNames: () => [],
|
||||
getProjectRoots: () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче