Skip to content

Commit

Permalink
Pass on the bundle name rather than the ID when getting transform opt…
Browse files Browse the repository at this point in the history
…ions

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
  • Loading branch information
davidaurelio authored and facebook-github-bot-5 committed Jan 22, 2016
1 parent a0c5fb9 commit a23785c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packager/react-packager/src/Bundler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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},
),
);
Expand Down

0 comments on commit a23785c

Please sign in to comment.