如何在`css-loader` getLocalIdent中获取CSS请求的发布者?

问题描述

我想使用getLocalIdent函数来更改css-module类的输出名称。实际上,我想访问CSS文件的颁发者文件名。例如,如果我将CSS文件导入到a.js文件中,我想在a.js中获得getLocalIdent文件名(或路径)。

在开发模式下,我可以使用context._module.issuer.issuer.resource访问它,但是在生产环境中,_module.issuer为空。

如何访问发行人字符串?

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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...