Skip to content

Commit

Permalink
metro-bundler: allow different run-before-main-module depending on en…
Browse files Browse the repository at this point in the history
…try point

Reviewed By: davidaurelio

Differential Revision: D6248242

fbshipit-source-id: 9471820fce926e676170e3024bd48c9d7335c1a7
  • Loading branch information
Jean Lauliac authored and facebook-github-bot committed Nov 7, 2017
1 parent a6465d1 commit 503b452
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion local-cli/bundle/buildBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function buildBundle(
assetRegistryPath: ASSET_REGISTRY_PATH,
blacklistRE: config.getBlacklistRE(),
extraNodeModules: config.extraNodeModules,
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
getPolyfills: config.getPolyfills,
getTransformOptions: config.getTransformOptions,
globalTransformCache: null,
Expand All @@ -125,7 +126,6 @@ function buildBundle(
providesModuleNodeModules: providesModuleNodeModules,
resetCache: args.resetCache,
reporter: new TerminalReporter(terminal),
runBeforeMainModule: config.runBeforeMainModule,
sourceExts: defaultSourceExts.concat(sourceExts),
transformCache: TransformCaching.useTempDir(),
transformModulePath: transformModulePath,
Expand Down
2 changes: 1 addition & 1 deletion local-cli/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ function getPackagerServer(args, config, reporter) {
cacheVersion: '3',
enableBabelRCLookup: config.getEnableBabelRCLookup(),
extraNodeModules: config.extraNodeModules,
getModulesRunBeforeMainModule: config.getModulesRunBeforeMainModule,
getPolyfills: config.getPolyfills,
getTransformOptions: config.getTransformOptions,
globalTransformCache: null,
Expand All @@ -194,7 +195,6 @@ function getPackagerServer(args, config, reporter) {
postProcessModules: config.postProcessModules,
projectRoots: args.projectRoots,
providesModuleNodeModules: providesModuleNodeModules,
runBeforeMainModule: config.runBeforeMainModule,
reporter,
resetCache: args.resetCache,
sourceExts: defaultSourceExts.concat(args.sourceExts),
Expand Down
2 changes: 1 addition & 1 deletion local-cli/util/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const Config = {
...MetroConfig.DEFAULT,
getProjectRoots,
getPolyfills,
runBeforeMainModule: [
getModulesRunBeforeMainModule: () => [
require.resolve('../../Libraries/Core/InitializeCore'),
],
}: ConfigT),
Expand Down

0 comments on commit 503b452

Please sign in to comment.