Skip to content

Commit d4b1d69

Browse files
committed
Initialize hash conditionally
1 parent 8241da7 commit d4b1d69

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/optimize/RealContentHashPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ ${referencingAssets
342342
for (const oldHash of hashesInOrder) {
343343
const assets = hashToAssets.get(oldHash);
344344
assets.sort(comparator);
345-
const hash = createHash(this._hashFunction);
346345
await Promise.all(
347346
assets.map(asset =>
348347
asset.ownHashes.has(oldHash)
@@ -363,6 +362,7 @@ ${referencingAssets
363362
});
364363
let newHash = hooks.updateHash.call(assetsContent, oldHash);
365364
if (!newHash) {
365+
const hash = createHash(this._hashFunction);
366366
for (const content of assetsContent) {
367367
hash.update(content);
368368
}

0 commit comments

Comments
 (0)