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 i.e. css-loader?localIdentName=[MyCustomMethod]-[hash:base64:5]
?
The css-loader interprets @import and url () like import/require () and will resolve them. To begin, you'll need to install css-loader: Then add the plugin to your webpack config. For example: And run webpack via your preferred method.
The css-loader interprets @import and url () like import/require () and will resolve them. To begin, you'll need to install css-loader: Then add the plugin to your webpack config.
Allow css-loader to export names from global class or id, so you can use that as local name. Type: String|Function Default: based on the modules.namedExport option value, if true - camelCaseOnly, otherwise asIs Style of exported class names.
The loader replaces local selectors with unique identifiers. The chosen unique identifiers are exported by the module. CamelCase is recommended for local selectors. They are easier to use within the imported JS module. You can use :local (#someId), but this is not recommended. Use classes instead of ids.
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With