How can I get the issuer of a css request in `css-loader` getLocalIdent?

Viewed 114

I want to use the getLocalIdent function for changing the css-module classes output name. Actually I want to access the issuer file name of a CSS file. for example, if I import my CSS file in a.js file, I want to get the a.js filename (or path) in the getLocalIdent.

In the development mode, I can access it with context._module.issuer.issuer.resource but in the production, _module.issuer is null.

How can I access to the issuer string?

getLocalIdent: (context, _localIdentName, localName, _options) => {
    return generateScopedName(localName, context._module.issuer.issuer.resource);
},
0 Answers
Related