From a23785ca2ef44a0b54e3514ff3a5c9fdcce3876c Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 22 Jan 2016 13:54:24 -0800 Subject: [PATCH] Pass on the bundle name rather than the ID when getting transform options Summary: public This is needed to bring numerical module IDs back. The numerical ID of the main module will always be `0` and is therefore of no use when used as conditional. We have to pass on the name, which will be preserved, when requesting transform options. Reviewed By: martinbigio Differential Revision: D2855106 fb-gh-sync-id: f9bc40e753b1b283ce0b00068e3c9964a541ad9b --- packager/react-packager/src/Bundler/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packager/react-packager/src/Bundler/index.js b/packager/react-packager/src/Bundler/index.js index 1cc28f23d..fda21ace0 100644 --- a/packager/react-packager/src/Bundler/index.js +++ b/packager/react-packager/src/Bundler/index.js @@ -190,6 +190,7 @@ class Bundler { return this.getDependencies(entryFile, isDev, platform).then((response) => { Activity.endEvent(findEventId); bundle.setMainModuleId(response.mainModuleId); + bundle.setMainModuleName(response.mainModuleId); transformEventId = Activity.startEvent('transform'); const moduleSystemDeps = includeSystemDependencies @@ -396,7 +397,7 @@ class Bundler { return this._transformer.loadFileAndTransform( path.resolve(module.path), this._getTransformOptions( - {bundleEntry: bundle.getMainModuleId(), modulePath: module.path}, + {bundleEntry: bundle.getMainModuleName(), modulePath: module.path}, {hot: hot}, ), );