Skip to content

Commit

Permalink
Merge pull request #16491 from lvivski/main
Browse files Browse the repository at this point in the history
Refactor: Initialize hash conditionally in RealContentHashPlugin
  • Loading branch information
TheLarkInn committed Feb 6, 2023
2 parents 4b4ca3b + d4b1d69 commit b67626c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/optimize/RealContentHashPlugin.js
Expand Up @@ -342,7 +342,6 @@ ${referencingAssets
for (const oldHash of hashesInOrder) {
const assets = hashToAssets.get(oldHash);
assets.sort(comparator);
const hash = createHash(this._hashFunction);
await Promise.all(
assets.map(asset =>
asset.ownHashes.has(oldHash)
Expand All @@ -363,6 +362,7 @@ ${referencingAssets
});
let newHash = hooks.updateHash.call(assetsContent, oldHash);
if (!newHash) {
const hash = createHash(this._hashFunction);
for (const content of assetsContent) {
hash.update(content);
}
Expand Down

0 comments on commit b67626c

Please sign in to comment.