css-modules / css-modules-require-hook

A require hook to compile CSS Modules in runtime
MIT License
484 stars 44 forks source link

Add ability to attach the hook to additional extensions #32

Closed sapegin closed 9 years ago

sapegin commented 9 years ago

I use CSS Modules with Sass and I need this functionality to test components with CSS modules.

var hook = require('css-modules-require-hook');

hook({
  extension: ['.scss']
});
mightyaleksey commented 9 years ago

Hi, thank you for your interest! And for the pr ofc :)

I think it will be better to make an array, so the user will be able to set up multiple extensions.

sapegin commented 9 years ago

Good idea, I’ll update the PR.

mightyaleksey commented 9 years ago

Do you mind to change the options' name to extensions?

sapegin commented 9 years ago

Sure. I used the word “extra” to emphasize that it will not disable hooking of the default .css extension.

mightyaleksey commented 9 years ago

yeah, I got it :)

I decided to add another opportunity for preprocessing styles. So you'll be able to provide a custom function through the preprocessCss option. I suppose it will be useful for you.

I will publish the new version when you will finish your pr. If you will need any help - tell me :)

sapegin commented 9 years ago

Done.

mightyaleksey commented 9 years ago

:+1:

mightyaleksey commented 9 years ago

Published - v1.0.6

sapegin commented 9 years ago

Cool, thanks!

:shipit: