@@ -12,7 +12,6 @@ const ModuleHotDeclineDependency = require("./dependencies/ModuleHotDeclineDepen
1212const ConstDependency = require ( "./dependencies/ConstDependency" ) ;
1313const NullFactory = require ( "./NullFactory" ) ;
1414const ParserHelpers = require ( "./ParserHelpers" ) ;
15- const createHash = require ( "./util/createHash" ) ;
1615
1716module . exports = class HotModuleReplacementPlugin {
1817 constructor ( options ) {
@@ -74,9 +73,7 @@ module.exports = class HotModuleReplacementPlugin {
7473 records . moduleHashs = { } ;
7574 for ( const module of compilation . modules ) {
7675 const identifier = module . identifier ( ) ;
77- const hash = createHash ( compilation . outputOptions . hashFunction ) ;
78- module . updateHash ( hash ) ;
79- records . moduleHashs [ identifier ] = hash . digest ( "hex" ) ;
76+ records . moduleHashs [ identifier ] = module . hash ;
8077 }
8178 records . chunkHashs = { } ;
8279 for ( const chunk of compilation . chunks ) {
@@ -136,9 +133,7 @@ module.exports = class HotModuleReplacementPlugin {
136133 return ;
137134 for ( const module of compilation . modules ) {
138135 const identifier = module . identifier ( ) ;
139- let hash = createHash ( compilation . outputOptions . hashFunction ) ;
140- module . updateHash ( hash ) ;
141- hash = hash . digest ( "hex" ) ;
136+ let hash = module . hash ;
142137 module . hotUpdate = records . moduleHashs [ identifier ] !== hash ;
143138 }
144139 const hotUpdateMainContent = {
0 commit comments