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
This commit is contained in:
David Aurelio 2016-01-22 13:54:24 -08:00 committed by facebook-github-bot-5
parent baa6d7fb24
commit 42e508efb8
1 changed files with 2 additions and 1 deletions

View File

@ -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},
),
);