MCPcopy Index your code
hub / github.com/webpack/css-loader / generateScopedName

Function generateScopedName

src/utils.js:756–803  ·  view source on GitHub ↗
(exportName, resourceFile, rawCss, node)

Source from the content-addressed store, hash-verified

754 extractImports(),
755 modulesScope({
756 generateScopedName(exportName, resourceFile, rawCss, node) {
757 let localIdent;
758
759 if (typeof getLocalIdent !== "undefined") {
760 localIdent = getLocalIdent(
761 loaderContext,
762 localIdentName,
763 unescape(exportName),
764 {
765 context: localIdentContext,
766 hashSalt: localIdentHashSalt,
767 hashFunction: localIdentHashFunction,
768 hashDigest: localIdentHashDigest,
769 hashDigestLength: localIdentHashDigestLength,
770 hashStrategy,
771 regExp: localIdentRegExp,
772 node,
773 },
774 );
775 }
776
777 // A null/undefined value signals that we should invoke the default
778 // getLocalIdent method.
779 if (typeof localIdent === "undefined" || localIdent === null) {
780 localIdent = defaultGetLocalIdent(
781 loaderContext,
782 localIdentName,
783 unescape(exportName),
784 {
785 context: localIdentContext,
786 hashSalt: localIdentHashSalt,
787 hashFunction: localIdentHashFunction,
788 hashDigest: localIdentHashDigest,
789 hashDigestLength: localIdentHashDigestLength,
790 hashStrategy,
791 regExp: localIdentRegExp,
792 node,
793 },
794 );
795
796 return escapeLocalIdent(localIdent).replace(
797 /\\\[local\\]/gi,
798 exportName,
799 );
800 }
801
802 return escapeLocalIdent(localIdent);
803 },
804 exportGlobals: options.modules.exportGlobals,
805 }),
806 ];

Callers

nothing calls this directly

Calls 4

getLocalIdentFunction · 0.85
unescapeFunction · 0.85
defaultGetLocalIdentFunction · 0.85
escapeLocalIdentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…