Skip to content

Add ability to attach the hook to additional extensions #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2015
Merged

Add ability to attach the hook to additional extensions #32

merged 1 commit into from
Sep 10, 2015

Conversation

sapegin
Copy link
Contributor

@sapegin sapegin commented Sep 10, 2015

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
Copy link
Member

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
Copy link
Contributor Author

sapegin commented Sep 10, 2015

Good idea, I’ll update the PR.

@mightyaleksey
Copy link
Member

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

@sapegin
Copy link
Contributor Author

sapegin commented Sep 10, 2015

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

@mightyaleksey
Copy link
Member

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 sapegin changed the title Add ability to attach the hook to additional extension Add ability to attach the hook to additional extensions Sep 10, 2015
@sapegin
Copy link
Contributor Author

sapegin commented Sep 10, 2015

Done.

@mightyaleksey
Copy link
Member

👍

mightyaleksey added a commit that referenced this pull request Sep 10, 2015
Add ability to attach the hook to additional extensions
@mightyaleksey mightyaleksey merged commit 3a59f5b into css-modules:master Sep 10, 2015
@mightyaleksey
Copy link
Member

Published - v1.0.6

@sapegin
Copy link
Contributor Author

sapegin commented Sep 10, 2015

Cool, thanks!

:shipit:

@sapegin sapegin deleted the extraextension branch September 10, 2015 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants