@@ -8,7 +8,7 @@ module.exports = function() {
88 var hotApplyOnUpdate = true ;
99 var hotCurrentHash = $hash$ ; // eslint-disable-line no-unused-vars
1010 var hotCurrentModuleData = { } ;
11- var hotMainModule = true ; // eslint-disable-line no-unused-vars
11+ var hotCurrentChildModule ; // eslint-disable-line no-unused-vars
1212 var hotCurrentParents = [ ] ; // eslint-disable-line no-unused-vars
1313 var hotCurrentParentsTemp = [ ] ; // eslint-disable-line no-unused-vars
1414
@@ -20,14 +20,16 @@ module.exports = function() {
2020 if ( installedModules [ request ] ) {
2121 if ( installedModules [ request ] . parents . indexOf ( moduleId ) < 0 )
2222 installedModules [ request ] . parents . push ( moduleId ) ;
23- } else hotCurrentParents = [ moduleId ] ;
23+ } else {
24+ hotCurrentParents = [ moduleId ] ;
25+ hotCurrentChildModule = request ;
26+ }
2427 if ( me . children . indexOf ( request ) < 0 )
2528 me . children . push ( request ) ;
2629 } else {
2730 console . warn ( "[HMR] unexpected require(" + request + ") from disposed module " + moduleId ) ;
2831 hotCurrentParents = [ ] ;
2932 }
30- hotMainModule = false ;
3133 return $require$ ( request ) ;
3234 } ;
3335 var ObjectFactory = function ObjectFactory ( name ) {
@@ -82,7 +84,7 @@ module.exports = function() {
8284 _selfAccepted : false ,
8385 _selfDeclined : false ,
8486 _disposeHandlers : [ ] ,
85- _main : hotMainModule ,
87+ _main : hotCurrentChildModule !== moduleId ,
8688
8789 // Module API
8890 active : true ,
@@ -135,7 +137,7 @@ module.exports = function() {
135137 //inherit from previous dispose call
136138 data : hotCurrentModuleData [ moduleId ]
137139 } ;
138- hotMainModule = true ;
140+ hotCurrentChildModule = undefined ;
139141 return hot ;
140142 }
141143
0 commit comments