@@ -519,8 +519,6 @@ function getModulesOptions(rawOptions, esModule, exportType, loaderContext) {
519
519
( { auto } = rawModulesOptions ) ;
520
520
}
521
521
522
- // eslint-disable-next-line no-underscore-dangle
523
- const { outputOptions } = loaderContext . _compilation ;
524
522
const needNamedExport =
525
523
exportType === "css-style-sheet" || exportType === "string" ;
526
524
const namedExport =
@@ -539,10 +537,27 @@ function getModulesOptions(rawOptions, esModule, exportType, loaderContext) {
539
537
exportGlobals : false ,
540
538
localIdentName : "[hash:base64]" ,
541
539
localIdentContext : loaderContext . rootContext ,
542
- localIdentHashSalt : outputOptions . hashSalt ,
543
- localIdentHashFunction : outputOptions . hashFunction ,
544
- localIdentHashDigest : outputOptions . hashDigest ,
545
- localIdentHashDigestLength : outputOptions . hashDigestLength ,
540
+ // eslint-disable-next-line no-underscore-dangle
541
+ localIdentHashSalt :
542
+ loaderContext . hashSalt ||
543
+ // TODO remove in the next major release
544
+ // eslint-disable-next-line no-underscore-dangle
545
+ loaderContext . _compilation . outputOptions . hashSalt ,
546
+ localIdentHashFunction :
547
+ loaderContext . hashFunction ||
548
+ // TODO remove in the next major release
549
+ // eslint-disable-next-line no-underscore-dangle
550
+ loaderContext . _compilation . outputOptions . hashFunction ,
551
+ localIdentHashDigest :
552
+ loaderContext . hashDigest ||
553
+ // TODO remove in the next major release
554
+ // eslint-disable-next-line no-underscore-dangle
555
+ loaderContext . _compilation . outputOptions . hashDigest ,
556
+ localIdentHashDigestLength :
557
+ loaderContext . hashDigestLength ||
558
+ // TODO remove in the next major release
559
+ // eslint-disable-next-line no-underscore-dangle
560
+ loaderContext . _compilation . outputOptions . hashDigestLength ,
546
561
// eslint-disable-next-line no-undefined
547
562
localIdentRegExp : undefined ,
548
563
// eslint-disable-next-line no-undefined
0 commit comments