Skip to content

Commit

Permalink
Initialize hash conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
lvivski committed Nov 18, 2022
1 parent 8241da7 commit 12cb3fe
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 12cb3fe

Please sign in to comment.