This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ exports.GenerateNativeScriptEntryPointsPlugin = (function () {
5656 entryChunk = chunk ;
5757 } else {
5858 chunk . files . forEach ( fileName => {
59- requireChunkFiles += `require("./${ fileName } ");` ;
59+ if ( ! this . isHMRFile ( fileName ) ) {
60+ requireChunkFiles += `require("./${ fileName } ");` ;
61+ }
6062 } ) ;
6163 }
6264
@@ -72,8 +74,10 @@ exports.GenerateNativeScriptEntryPointsPlugin = (function () {
7274 throw new Error ( `${ GenerationFailedError } File "${ fileName } " not found for entry "${ entryPointName } ".` ) ;
7375 }
7476
75- const currentEntryFileContent = compilation . assets [ fileName ] . source ( ) ;
76- compilation . assets [ fileName ] = new RawSource ( `${ requireDeps } ${ currentEntryFileContent } ` ) ;
77+ if ( ! this . isHMRFile ( fileName ) ) {
78+ const currentEntryFileContent = compilation . assets [ fileName ] . source ( ) ;
79+ compilation . assets [ fileName ] = new RawSource ( `${ requireDeps } ${ currentEntryFileContent } ` ) ;
80+ }
7781 } ) ;
7882 }
7983
@@ -84,5 +88,9 @@ exports.GenerateNativeScriptEntryPointsPlugin = (function () {
8488 }
8589 }
8690
91+ GenerateNativeScriptEntryPointsPlugin . prototype . isHMRFile = function ( fileName ) {
92+ return fileName . indexOf ( "hot-update" ) > - 1 ;
93+ }
94+
8795 return GenerateNativeScriptEntryPointsPlugin ;
8896} ) ( ) ;
You can’t perform that action at this time.
0 commit comments