Skip to content

Commit

Permalink
fix: use official hash* options for hashes (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Sep 20, 2024
1 parent 06587e5 commit 9544c3e
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,6 @@ function getModulesOptions(rawOptions, esModule, exportType, loaderContext) {
({ auto } = rawModulesOptions);
}

// eslint-disable-next-line no-underscore-dangle
const { outputOptions } = loaderContext._compilation;
const needNamedExport =
exportType === "css-style-sheet" || exportType === "string";
const namedExport =
Expand All @@ -539,10 +537,27 @@ function getModulesOptions(rawOptions, esModule, exportType, loaderContext) {
exportGlobals: false,
localIdentName: "[hash:base64]",
localIdentContext: loaderContext.rootContext,
localIdentHashSalt: outputOptions.hashSalt,
localIdentHashFunction: outputOptions.hashFunction,
localIdentHashDigest: outputOptions.hashDigest,
localIdentHashDigestLength: outputOptions.hashDigestLength,
// eslint-disable-next-line no-underscore-dangle
localIdentHashSalt:
loaderContext.hashSalt ||
// TODO remove in the next major release
// eslint-disable-next-line no-underscore-dangle
loaderContext._compilation.outputOptions.hashSalt,
localIdentHashFunction:
loaderContext.hashFunction ||
// TODO remove in the next major release
// eslint-disable-next-line no-underscore-dangle
loaderContext._compilation.outputOptions.hashFunction,
localIdentHashDigest:
loaderContext.hashDigest ||
// TODO remove in the next major release
// eslint-disable-next-line no-underscore-dangle
loaderContext._compilation.outputOptions.hashDigest,
localIdentHashDigestLength:
loaderContext.hashDigestLength ||
// TODO remove in the next major release
// eslint-disable-next-line no-underscore-dangle
loaderContext._compilation.outputOptions.hashDigestLength,
// eslint-disable-next-line no-undefined
localIdentRegExp: undefined,
// eslint-disable-next-line no-undefined
Expand Down

0 comments on commit 9544c3e

Please sign in to comment.