Open glebmachine opened 8 years ago
@glebmachine What does CSS modules have to do with Jade?
CSS modules export object like:
{
.className: unique_hash_for_this_classname1,
.className2: unique_hash_for_this_classname2,
}
All css selectors become local without BEM.
Okay. So do you want the template function to be called with this object (the locals) that CSS modules exports?
Hm, is it possible to use require function right into template, like in the jade-loader or plain node js?
From my understanding, jade-loader
will return the template function for you. That template function takes a locals object that it uses to substitute into the template when executed. Maybe try using that. See here.
Yes, they provide global variables into template scope, so, require become available from template scope.
var css = require('style.css')
div(class=css.className1)
vid(class=css.className2)
Hi!)
Can you add
css-modules
support please. https://github.com/css-modules/css-modules fr: https://github.com/css-modules/webpack-demo