简体   繁体   中英

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

I'm brand new to Webpack and have been playing around with the 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] . 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] ?

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] . Maybe they'll do?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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