css-modules / css-modulesify

A browserify plugin to load CSS Modules
MIT License
403 stars 47 forks source link

Emit on pack stage of pipeline #98

Closed danielmoore closed 8 years ago

danielmoore commented 8 years ago

This PR moves the CSS and JSON emitting to the pack stage of the Browserify pipeline, similar to how factor-bundle works. This change enables other plugins to listen to the css stream event and react within the Browserify pipeline as well.

This PR also uses module.parent.require to pull in plugins that were given by string. This has no effect in normal situations, but allows this library to be linked in via npm link.

joshwnj commented 8 years ago

Thanks @danielmoore , looks interesting. Sorry for the delay, I'm trying to find some time to give a proper review before merging :)

Btw have you tried using css-modulesify with factor-bundle?

danielmoore commented 8 years ago

I'm actually using this change in conjunction with zoubin/factor-vinylify#1

joshwnj commented 8 years ago

Thanks @danielmoore ! I'll merge this now, and I'm also in the middle of a cleanup which will affect a few things here. So I'll ask you to check it once more after the cleanup.