8000 Merge pull request #16491 from lvivski/main · webpack/webpack@b67626c · GitHub
[go: up one dir, main page]

Skip to content

Commit b67626c

Browse files
authored
Merge pull request #16491 from lvivski/main
Refactor: Initialize hash conditionally in RealContentHashPlugin
2 parents 4b4ca3b + d4b1d69 commit b67626c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)
0