Skip to content

Commit 06587e5

Browse files
fix: use official createHash for hashes (#1618)
1 parent a7f5288 commit 06587e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,12 @@ function defaultGetLocalIdent(
327327
let localIdentHash = "";
328328

329329
for (let tier = 0; localIdentHash.length < hashDigestLength; tier++) {
330-
// eslint-disable-next-line no-underscore-dangle
331-
const hash = loaderContext._compiler.webpack.util.createHash(hashFunction);
330+
const hash = (
331+
loaderContext.utils.createHash ||
332+
// TODO remove in the next major release
333+
// eslint-disable-next-line no-underscore-dangle
334+
loaderContext._compiler.webpack.util.createHash
335+
)(hashFunction);
332336

333337
if (hashSalt) {
334338
hash.update(hashSalt);

0 commit comments

Comments
 (0)