Invalidate Babel Cache

Is there a good way to use watchman to do something like:

  • If a .graphql file changes, reset the babel cache

This is because we need to use the babel plugin (instead of the webpack version) of graphql-tag to compile these

There might be a way to do this easily with some configuration but I can’t think of it off the top of my head.

The way that occurs to me to do this is to write some kind of daemon that watches the .graphql files that you want to watch and then deletes the babel cache whenever it detects a chance or somehow triggers a retranspilation.

So, yes, you can certainly do this but I’m not aware of a super easy way to do it. Someone else may be. Maybe they will chime in on this thread!