Expose getResolverMainFields() config param

Reviewed By: mjesun

Differential Revision: D8380198

fbshipit-source-id: 3d5b7a5873095db2b90a23b5054fb94579df3f1a
This commit is contained in:
Rafael Oleza 2018-06-12 13:43:47 -07:00 committed by Facebook Github Bot
parent e3c5524bc6
commit 39d9d71adb
3 changed files with 5 additions and 2 deletions

View File

@ -88,6 +88,7 @@ async function buildBundle(
extraNodeModules: config.extraNodeModules,
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
getPolyfills: config.getPolyfills,
getResolverMainFields: config.getResolverMainFields,
getRunModuleStatement: config.getRunModuleStatement,
getTransformOptions: config.getTransformOptions,
hasteImplModulePath: config.hasteImplModulePath,

View File

@ -187,6 +187,7 @@ function getPackagerServer(args, config, reporter) {
dynamicDepsInPackages: config.dynamicDepsInPackages,
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
getPolyfills: config.getPolyfills,
getResolverMainFields: config.getResolverMainFields,
getRunModuleStatement: config.getRunModuleStatement,
getTransformOptions: config.getTransformOptions,
hasteImplModulePath: config.hasteImplModulePath,

View File

@ -73,11 +73,12 @@ const Config = {
DEFAULT: ({
...MetroConfig.DEFAULT,
getBlacklistRE,
getProjectRoots,
getPolyfills,
getModulesRunBeforeMainModule: () => [
require.resolve('../../Libraries/Core/InitializeCore'),
],
getProjectRoots,
getPolyfills,
getResolverMainFields: () => ['react-native', 'browser', 'main'],
getTransformModulePath: () =>
require.resolve('metro/src/reactNativeTransformer'),
}: ConfigT),