Documentation (https://github.com/webpack/css-loader#local-scope) mentions these variables in one of the examples:
You can configure the generated ident with the localIdentName query parameter (default [hash:base64]). Example: css-loader?localIdentName=[path][name]---[local]---[hash:base64:5] for easier debugging.
I cannot find more documentation. Specifically what variables are available aside from [path], [name] and [local]?
I have looked into extract-text-webpack-plugin documentation and it only mentions (https://github.com/webpack/extract-text-webpack-plugin#api):
filename the filename of the result file. May contain [name], [id] and [contenthash].
- [name] the name of the chunk
- [id] the number of the chunk
- [contenthash] a hash of the content of the extracted file
Was looking up for the same info, found this: https://github.com/webpack/loader-utils/blob/master/index.js#L197
It seems that ext, name, path and hash are the only tokens available. Then, there is the regExp thingy but I don't know yet how to use it.
@qur2 always include commit or a tag when referring to the source code, e.g. https://github.com/webpack/loader-utils/blob/v0.2.12/index.js#L197
Otherwise link becomes historically useless as soon as any changes have been made to that file.
Alright, that makes sense, thanks for the advice.
From duped issue:
[name]
[local]
[path]
[hash:base64:5]
folder
ext
emoji:XXXX
loader-utils repo and/or hopefully on webpack.js.org :)
So is there a place in the documentation that covers these?
Copied from https://github.com/webpack/loader-utils:
The following tokens are replaced in the
nameparameter:
[ext] the extension of the resource[name] the basename of the resource[path] the path of the resource relative to the context query parameter or option.[folder] the folder of the resource is in.[emoji] a random emoji representation of options.content[emoji:<length>] same as above, but with a customizable number of emojis[hash] the hash of options.content (Buffer) (by default it's the hex digest of the md5 hash)[<hashType>:hash:<digestType>:<length>] optionally one can configurehashTypes, i. e. sha1, md5, sha256, sha512digestTypes, i. e. hex, base26, base32, base36, base49, base52, base58, base62, base64length the length in chars[N] the N-th match obtained from matching the current file name against options.regExp
Most helpful comment
Copied from https://github.com/webpack/loader-utils:
[ext]the extension of the resource[name]the basename of the resource[path]the path of the resource relative to thecontextquery parameter or option.[folder]the folder of the resource is in.[emoji]a random emoji representation ofoptions.content[emoji:<length>]same as above, but with a customizable number of emojis[hash]the hash ofoptions.content(Buffer) (by default it's the hex digest of the md5 hash)[<hashType>:hash:<digestType>:<length>]optionally one can configurehashTypes, i. e.sha1,md5,sha256,sha512digestTypes, i. e.hex,base26,base32,base36,base49,base52,base58,base62,base64lengththe length in chars[N]the N-th match obtained from matching the current file name againstoptions.regExp