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. 👋
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 theprocessCss
function and then do some hack with that. My first obstacle there is that it wasn't as easy as addingtokens
to theprocessCss
function since after that call, you are doing thecamelCase
transformation, so I had to move theprocessCss
function where thehook
happens and then do some refactor there to achieve that. My second obstacle was that (I don't know why) you are doingm._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 justmodule.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. 👋