From 06587e54c6a580ee0c20e47021943aa9989acd5c Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:05:18 +0300 Subject: [PATCH] fix: use official `createHash` for hashes (#1618) --- src/utils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index 5d3ae360..f76bf027 100644 --- a/src/utils.js +++ b/src/utils.js @@ -327,8 +327,12 @@ function defaultGetLocalIdent( let localIdentHash = ""; for (let tier = 0; localIdentHash.length < hashDigestLength; tier++) { - // eslint-disable-next-line no-underscore-dangle - const hash = loaderContext._compiler.webpack.util.createHash(hashFunction); + const hash = ( + loaderContext.utils.createHash || + // TODO remove in the next major release + // eslint-disable-next-line no-underscore-dangle + loaderContext._compiler.webpack.util.createHash + )(hashFunction); if (hashSalt) { hash.update(hashSalt);