mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 08:05:34 +00:00
metro-bundler: allow different run-before-main-module depending on entry point
Reviewed By: davidaurelio Differential Revision: D6248242 fbshipit-source-id: 9471820fce926e676170e3024bd48c9d7335c1a7
This commit is contained in:
parent
a6465d1c17
commit
503b4521a6
@ -112,6 +112,7 @@ function buildBundle(
|
|||||||
assetRegistryPath: ASSET_REGISTRY_PATH,
|
assetRegistryPath: ASSET_REGISTRY_PATH,
|
||||||
blacklistRE: config.getBlacklistRE(),
|
blacklistRE: config.getBlacklistRE(),
|
||||||
extraNodeModules: config.extraNodeModules,
|
extraNodeModules: config.extraNodeModules,
|
||||||
|
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
|
||||||
getPolyfills: config.getPolyfills,
|
getPolyfills: config.getPolyfills,
|
||||||
getTransformOptions: config.getTransformOptions,
|
getTransformOptions: config.getTransformOptions,
|
||||||
globalTransformCache: null,
|
globalTransformCache: null,
|
||||||
@ -125,7 +126,6 @@ function buildBundle(
|
|||||||
providesModuleNodeModules: providesModuleNodeModules,
|
providesModuleNodeModules: providesModuleNodeModules,
|
||||||
resetCache: args.resetCache,
|
resetCache: args.resetCache,
|
||||||
reporter: new TerminalReporter(terminal),
|
reporter: new TerminalReporter(terminal),
|
||||||
runBeforeMainModule: config.runBeforeMainModule,
|
|
||||||
sourceExts: defaultSourceExts.concat(sourceExts),
|
sourceExts: defaultSourceExts.concat(sourceExts),
|
||||||
transformCache: TransformCaching.useTempDir(),
|
transformCache: TransformCaching.useTempDir(),
|
||||||
transformModulePath: transformModulePath,
|
transformModulePath: transformModulePath,
|
||||||
|
@ -182,6 +182,7 @@ function getPackagerServer(args, config, reporter) {
|
|||||||
cacheVersion: '3',
|
cacheVersion: '3',
|
||||||
enableBabelRCLookup: config.getEnableBabelRCLookup(),
|
enableBabelRCLookup: config.getEnableBabelRCLookup(),
|
||||||
extraNodeModules: config.extraNodeModules,
|
extraNodeModules: config.extraNodeModules,
|
||||||
|
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
|
||||||
getPolyfills: config.getPolyfills,
|
getPolyfills: config.getPolyfills,
|
||||||
getTransformOptions: config.getTransformOptions,
|
getTransformOptions: config.getTransformOptions,
|
||||||
globalTransformCache: null,
|
globalTransformCache: null,
|
||||||
@ -194,7 +195,6 @@ function getPackagerServer(args, config, reporter) {
|
|||||||
postProcessModules: config.postProcessModules,
|
postProcessModules: config.postProcessModules,
|
||||||
projectRoots: args.projectRoots,
|
projectRoots: args.projectRoots,
|
||||||
providesModuleNodeModules: providesModuleNodeModules,
|
providesModuleNodeModules: providesModuleNodeModules,
|
||||||
runBeforeMainModule: config.runBeforeMainModule,
|
|
||||||
reporter,
|
reporter,
|
||||||
resetCache: args.resetCache,
|
resetCache: args.resetCache,
|
||||||
sourceExts: defaultSourceExts.concat(args.sourceExts),
|
sourceExts: defaultSourceExts.concat(args.sourceExts),
|
||||||
|
@ -69,7 +69,7 @@ const Config = {
|
|||||||
...MetroConfig.DEFAULT,
|
...MetroConfig.DEFAULT,
|
||||||
getProjectRoots,
|
getProjectRoots,
|
||||||
getPolyfills,
|
getPolyfills,
|
||||||
runBeforeMainModule: [
|
getModulesRunBeforeMainModule: () => [
|
||||||
require.resolve('../../Libraries/Core/InitializeCore'),
|
require.resolve('../../Libraries/Core/InitializeCore'),
|
||||||
],
|
],
|
||||||
}: ConfigT),
|
}: ConfigT),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user