@@ -32,7 +32,6 @@ NodeMainTemplatePlugin.prototype.apply = function(mainTemplate) {
3232 var filename = this . outputOptions . filename || "bundle.js" ;
3333 var chunkFilename = this . outputOptions . chunkFilename || "[id]." + filename ;
3434 var chunkMaps = chunk . getChunkMaps ( ) ;
35- var renderedHash = this . renderCurrentHashCode ( hash ) ;
3635 var insertMoreModules = [
3736 "var moreModules = chunk.modules, chunkIds = chunk.ids;" ,
3837 "for(var moduleId in moreModules) {" ,
@@ -46,10 +45,10 @@ NodeMainTemplatePlugin.prototype.apply = function(mainTemplate) {
4645 this . indent ( [
4746 "installedChunks[chunkId] = [callback];" ,
4847 "var filename = __dirname + " + this . applyPluginsWaterfall ( "asset-path" , JSON . stringify ( "/" + chunkFilename ) , {
49- hash : "\" + " + renderedHash + " + \"" ,
48+ hash : "\" + " + this . renderCurrentHashCode ( hash ) + " + \"" ,
5049 hashWithLength : function ( length ) {
51- return "\" + " + renderedHash . slice ( 0 , length ) + " + \"" ;
52- } ,
50+ return "\" + " + this . renderCurrentHashCode ( hash , length ) + " + \"" ;
51+ } . bind ( this ) ,
5352 chunk : {
5453 id : "\" + chunkId + \"" ,
5554 hash : "\" + " + JSON . stringify ( chunkMaps . hash ) + "[chunkId] + \"" ,
@@ -90,10 +89,10 @@ NodeMainTemplatePlugin.prototype.apply = function(mainTemplate) {
9089 ] ) ;
9190 } else {
9291 var request = this . applyPluginsWaterfall ( "asset-path" , JSON . stringify ( "./" + chunkFilename ) , {
93- hash : "\" + " + renderedHash + " + \"" ,
92+ hash : "\" + " + this . renderCurrentHashCode ( hash ) + " + \"" ,
9493 hashWithLength : function ( length ) {
95- return "\" + " + renderedHash . slice ( 0 , length ) + " + \"" ;
96- } ,
94+ return "\" + " + this . renderCurrentHashCode ( hash , length ) + " + \"" ;
95+ } . bind ( this ) ,
9796 chunk : {
9897 id : "\" + chunkId + \"" ,
9998 hash : "\" + " + JSON . stringify ( chunkMaps . hash ) + "[chunkId] + \"" ,
@@ -127,12 +126,11 @@ NodeMainTemplatePlugin.prototype.apply = function(mainTemplate) {
127126 var hotUpdateMainFilename = this . outputOptions . hotUpdateMainFilename ;
128127 var hotUpdateFunction = this . outputOptions . hotUpdateFunction || Template . toIdentifier ( "webpackHotUpdate" + ( this . outputOptions . library || "" ) ) ;
129128 var chunkMaps = chunk . getChunkMaps ( ) ;
130- var renderedHash = this . renderCurrentHashCode ( hash ) ;
131129 var currentHotUpdateChunkFilename = this . applyPluginsWaterfall ( "asset-path" , JSON . stringify ( hotUpdateChunkFilename ) , {
132- hash : "\" + " + renderedHash + " + \"" ,
130+ hash : "\" + " + this . renderCurrentHashCode ( hash ) + " + \"" ,
133131 hashWithLength : function ( length ) {
134- return "\" + " + renderedHash . slice ( 0 , length ) + " + \"" ;
135- } ,
132+ return "\" + " + this . renderCurrentHashCode ( hash , length ) + " + \"" ;
133+ } . bind ( this ) ,
136134 chunk : {
137135 id : "\" + chunkId + \"" ,
138136 hash : "\" + " + JSON . stringify ( chunkMaps . hash ) + "[chunkId] + \"" ,
@@ -148,10 +146,10 @@ NodeMainTemplatePlugin.prototype.apply = function(mainTemplate) {
148146 }
149147 } ) ;
150148 var currentHotUpdateMainFilename = this . applyPluginsWaterfall ( "asset-path" , JSON . stringify ( hotUpdateMainFilename ) , {
151- hash : "\" + " + renderedHash + " + \"" ,
149+ hash : "\" + " + this . renderCurrentHashCode ( hash ) + " + \"" ,
152150 hashWithLength : function ( length ) {
153- return "\" + " + renderedHash . slice ( 0 , length ) + " + \"" ;
154- }
151+ return "\" + " + this . renderCurrentHashCode ( hash , length ) + " + \"" ;
152+ } . bind ( this )
155153 } ) ;
156154 return Template . getFunctionContent ( self . asyncChunkLoading ? function ( ) {
157155 function hotDownloadUpdateChunk ( chunkId ) {
0 commit comments