diff --git a/local-cli/bundle/buildBundle.js b/local-cli/bundle/buildBundle.js index aa08e376d798c2..0943ebd4be0082 100644 --- a/local-cli/bundle/buildBundle.js +++ b/local-cli/bundle/buildBundle.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, diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index 7b1dd4e8ef26d2..fc93ca7da96f8c 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -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), diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 91f84c8c141a7a..c01421061c77dc 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -69,7 +69,7 @@ const Config = { ...MetroConfig.DEFAULT, getProjectRoots, getPolyfills, - runBeforeMainModule: [ + getModulesRunBeforeMainModule: () => [ require.resolve('../../Libraries/Core/InitializeCore'), ], }: ConfigT),