Permalink
Browse files

metro-bundler: allow different run-before-main-module depending on en…

…try point

Reviewed By: davidaurelio

Differential Revision: D6248242

fbshipit-source-id: 9471820fce926e676170e3024bd48c9d7335c1a7
  • Loading branch information...
jeanlauliac authored and facebook-github-bot committed Nov 7, 2017
1 parent a6465d1 commit 503b4521a6ce6bb2282631df616440fa71416d25
Showing with 3 additions and 3 deletions.
  1. +1 −1 local-cli/bundle/buildBundle.js
  2. +1 −1 local-cli/server/runServer.js
  3. +1 −1 local-cli/util/Config.js
@@ -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,
@@ -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,
@@ -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,
@@ -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),
View
@@ -69,7 +69,7 @@ const Config = {
...MetroConfig.DEFAULT,
getProjectRoots,
getPolyfills,
runBeforeMainModule: [
getModulesRunBeforeMainModule: () => [
require.resolve('../../Libraries/Core/InitializeCore'),
],
}: ConfigT),

0 comments on commit 503b452

Please sign in to comment.