css-modules / css-modules-require-hook

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

add tokens to processCss function #94

Closed nescalante closed 5 years ago

nescalante commented 7 years ago

Hi all! 🤚 I am doing some hack with the css-modules-require-hook lib. For my use case, I am needing to receive the tokens generated in the processCss function and then do some hack with that. My first obstacle there is that it wasn't as easy as adding tokens to the processCss function since after that call, you are doing the camelCase transformation, so I had to move the processCss function where the hook happens and then do some refactor there to achieve that. My second obstacle was that (I don't know why) you are doing m._compile(module.exports = ${JSON.stringify(tokens)}, filename); to return the tokens, and for my use case I was needing to add a function to that tokens. So I changed it to just module.exports == tokens. If you have a solid reason to do this compile, please let me know.

Let me know if this changes looks of for you and also if you need some change from my side. Thanks in advance for your time. 👋

nescalante commented 7 years ago

is this repo still being maintained?

nescalante commented 5 years ago

Closing since outdated