Closed mightyaleksey closed 9 years ago
I've published it in a beta version: https://github.com/css-modules/css-modules-require-hook/releases/tag/2.0.0-beta2
So you may try to use it.
Okay, published it: https://github.com/css-modules/css-modules-require-hook/releases/tag/2.0.0
Since many ppl use the require hook together with webpack, I think we can make the simplier API for the require hook and provide opportunity to specify the same patterns as for the css-loader. So the user will be able to provide the string pattern for the
generateScopedName
option:I'm going to make another module (What will be the name?) which will implement that. It will be possible to use it with css-modulesify also, so we will get the similar API in our tools. Module will use interpolatename function and solve the problem with the
[local]
pattern. Smthing like:Also I will same the opportunity to provide custom functions.
https://github.com/css-modules/postcss-modules-scope/blob/master/src/index.js#L38 https://github.com/webpack/css-loader/blob/master/lib/processCss.js#L148-L150 https://github.com/webpack/css-loader/blob/master/lib/getLocalIdent.js