diff --git a/lib/HotModuleReplacementPlugin.js b/lib/HotModuleReplacementPlugin.js index d39425b10b5..92221d6646a 100644 --- a/lib/HotModuleReplacementPlugin.js +++ b/lib/HotModuleReplacementPlugin.js @@ -12,7 +12,6 @@ const ModuleHotDeclineDependency = require("./dependencies/ModuleHotDeclineDepen const ConstDependency = require("./dependencies/ConstDependency"); const NullFactory = require("./NullFactory"); const ParserHelpers = require("./ParserHelpers"); -const createHash = require("./util/createHash"); module.exports = class HotModuleReplacementPlugin { constructor(options) { @@ -74,9 +73,7 @@ module.exports = class HotModuleReplacementPlugin { records.moduleHashs = {}; for (const module of compilation.modules) { const identifier = module.identifier(); - const hash = createHash(compilation.outputOptions.hashFunction); - module.updateHash(hash); - records.moduleHashs[identifier] = hash.digest("hex"); + records.moduleHashs[identifier] = module.hash; } records.chunkHashs = {}; for (const chunk of compilation.chunks) { @@ -136,9 +133,7 @@ module.exports = class HotModuleReplacementPlugin { return; for (const module of compilation.modules) { const identifier = module.identifier(); - let hash = createHash(compilation.outputOptions.hashFunction); - module.updateHash(hash); - hash = hash.digest("hex"); + let hash = module.hash; module.hotUpdate = records.moduleHashs[identifier] !== hash; } const hotUpdateMainContent = {