css-modules / css-modules-require-hook

A require hook to compile CSS Modules in runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto installing the hook

just-boris opened this issue · comments

I am going to use this hook for my Mocha tests alongside the babel-register for js. So, I supposed to run Mocha using the following command:

mocha --compilers js:babel-register,css:css-modules-require-hook

But it doesn't work because you export hook, but don't do actual register. So, it would be good to have an ability to setup require hook with default settings by passing a single require statement:

require('css-modules-require-hook/register');

What do you think about it?

Actually it was already implemented. You need to specify the external file: cmrh.conf.js and call require('css-modules-require-hook/preset');

Also, it would work without external file. In this case default settings would be applied.

That's exactly that I am looking for. Maybe I did not get this because of its name, but anyway.

Thank you!