From e2aca0201c55e6550e32e6e0ddc1c7577fcea231 Mon Sep 17 00:00:00 2001 From: Daniel Hay Date: Mon, 1 Dec 2025 09:49:32 +1100 Subject: [PATCH] fix(contentHash): Prevent generation of a contentHash when the set of modules is of size 0 --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 944a33aa..88abbe44 100644 --- a/src/index.js +++ b/src/index.js @@ -786,7 +786,7 @@ class MiniCssExtractPlugin { compilation.runtimeTemplate.requestShortener, ); - if (modules) { + if (modules?.size > 0) { const { hashFunction, hashDigest, hashDigestLength } = outputOptions; const { createHash } = compiler.webpack.util; const hash = createHash(/** @type {string} */ (hashFunction));