简体   繁体   English

自定义Webpack CSS-loader“localIdentName”查询标记占位符?

[英]Custom Webpack CSS-loader “localIdentName” Query Tag Placeholders?

I'm brand new to Webpack and have been playing around with the css-loader. 我是Webpack的新手,并且一直在使用css-loader。 On the Github page under "Local Scope" there's information about specifying a localIdentName query tag with your own custom values like: [path][name]---[local]---[hash:base64:5] . 在“本地范围”下的Github页面上,有关于使用您自己的自定义值指定localIdentName查询标记的信息,例如: [path][name]---[local]---[hash:base64:5] This tag allows us to specify how the class should be named after being processed. 此标记允许我们指定在处理后如何命名类。

Is it possible for us to define our own custom value placeholders for this query tag ie css-loader?localIdentName=[MyCustomMethod]-[hash:base64:5] ? 我们是否可以为此查询标记定义我们自己的自定义值占位符,即css-loader?localIdentName=[MyCustomMethod]-[hash:base64:5]

I don't think it is possible to put an arbitrary custom token there, but the documentation for loader-utils (which is used by css-loader) lists a number of other useful predefined tokens such as [folder] or [emoji] . 我不认为可以在那里放置任意自定义标记,但loader-utils (由css-loader使用)的文档列出了许多其他有用的预定义标记,例如[folder][emoji] Maybe they'll do? 也许他们会这样做?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM