Skip to content

Commit 503b452

Browse files
Jean Lauliacfacebook-github-bot
Jean Lauliac
authored andcommitted
metro-bundler: allow different run-before-main-module depending on entry point
Reviewed By: davidaurelio Differential Revision: D6248242 fbshipit-source-id: 9471820fce926e676170e3024bd48c9d7335c1a7
1 parent a6465d1 commit 503b452

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

local-cli/bundle/buildBundle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ function buildBundle(
112112
assetRegistryPath: ASSET_REGISTRY_PATH,
113113
blacklistRE: config.getBlacklistRE(),
114114
extraNodeModules: config.extraNodeModules,
115+
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
115116
getPolyfills: config.getPolyfills,
116117
getTransformOptions: config.getTransformOptions,
117118
globalTransformCache: null,
@@ -125,7 +126,6 @@ function buildBundle(
125126
providesModuleNodeModules: providesModuleNodeModules,
126127
resetCache: args.resetCache,
127128
reporter: new TerminalReporter(terminal),
128-
runBeforeMainModule: config.runBeforeMainModule,
129129
sourceExts: defaultSourceExts.concat(sourceExts),
130130
transformCache: TransformCaching.useTempDir(),
131131
transformModulePath: transformModulePath,

local-cli/server/runServer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ function getPackagerServer(args, config, reporter) {
182182
cacheVersion: '3',
183183
enableBabelRCLookup: config.getEnableBabelRCLookup(),
184184
extraNodeModules: config.extraNodeModules,
185+
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
185186
getPolyfills: config.getPolyfills,
186187
getTransformOptions: config.getTransformOptions,
187188
globalTransformCache: null,
@@ -194,7 +195,6 @@ function getPackagerServer(args, config, reporter) {
194195
postProcessModules: config.postProcessModules,
195196
projectRoots: args.projectRoots,
196197
providesModuleNodeModules: providesModuleNodeModules,
197-
runBeforeMainModule: config.runBeforeMainModule,
198198
reporter,
199199
resetCache: args.resetCache,
200200
sourceExts: defaultSourceExts.concat(args.sourceExts),

local-cli/util/Config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const Config = {
6969
...MetroConfig.DEFAULT,
7070
getProjectRoots,
7171
getPolyfills,
72-
runBeforeMainModule: [
72+
getModulesRunBeforeMainModule: () => [
7373
require.resolve('../../Libraries/Core/InitializeCore'),
7474
],
7575
}: ConfigT),

0 commit comments

Comments
 (0)