Twin.macro: Gatsby caching issue

Created on 6 Mar 2020  路  5Comments  路  Source: ben-rogerson/twin.macro

Hey!

I'm using twin.macro within a Gatsby site.

My setup is basically the same as in the readme.

I've created a custom tailwind.config.js and changed a few colors.

However, the new colors are only picked up after I manually delete the node_modules/.cache folder.

I've got no experience in using Babel macros but shouldn't the cache be cleared -- at least -- when I restart my dev server?

Or how is changing the tailwind config supposed to work?

Thank you for your amazing work!

Most helpful comment

Hey Robin
You're right, the cache _should_ be cleared when you restart your server.

And ideally, you shouldn't have to restart during development. This will be tackled in one of the next versions of Twin. I'll be sure to test in gatsby to see if it resolves the same problem you're experiencing.

Check this thread for some workarounds.

Cheers for giving twin a try :)

All 5 comments

Hey Robin
You're right, the cache _should_ be cleared when you restart your server.

And ideally, you shouldn't have to restart during development. This will be tackled in one of the next versions of Twin. I'll be sure to test in gatsby to see if it resolves the same problem you're experiencing.

Check this thread for some workarounds.

Cheers for giving twin a try :)

Actually, This problem is come from babel macro itself, learn more babel-cache-problem

You're right, that's an issue that we can't solve right now.
tailwind.macro - the package twin was forked from, has the ability to pick up live tailwind.config.js changes without a build script restart.

Any updates on this?

Not great news but I hit some major roadblocks and backed out. Without major structural code changes, I'm unsure if it's accomplishable. Firmly in the 'too hard' bucket for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abhijithvijayan picture abhijithvijayan  路  8Comments

hendrul picture hendrul  路  3Comments

JoseRFelix picture JoseRFelix  路  4Comments

denvash picture denvash  路  6Comments

axe312ger picture axe312ger  路  7Comments