From 97e1db3e6c8da9b0e95a09a75ff1463c8d2043f4 Mon Sep 17 00:00:00 2001 From: Mart?n Bigio Date: Fri, 25 Mar 2016 08:44:38 -0700 Subject: [PATCH] Avoid getting `entryFilePath` on HMR codepath Summary: The HMR codepath is currently broken because of a recent change that tries to compute the absolute entryFile path (needed for RAM Bundling). HMR Bundler's bundles are special as they contains a single file (the file that was transformed). However, for performance reasons we recycle an existing resolution response which contains the polyfills and the module system modules. Reviewed By: sam-swarr Differential Revision: D3098069 fb-gh-sync-id: 23d61aa304cd6f59d4df4840965f5eedda05dc31 fbshipit-source-id: 23d61aa304cd6f59d4df4840965f5eedda05dc31 --- react-packager/src/Bundler/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-packager/src/Bundler/index.js b/react-packager/src/Bundler/index.js index 52bb3ad2..2fd484c0 100644 --- a/react-packager/src/Bundler/index.js +++ b/react-packager/src/Bundler/index.js @@ -385,7 +385,7 @@ class Bundler { // get entry file complete path (`entryFile` is relative to roots) let entryFilePath; - if (response.dependencies.length > 0) { + if (response.dependencies.length > 1) { // skip HMR requests const numModuleSystemDependencies = this._resolver.getModuleSystemDependencies({dev, unbundle}).length;