Skip to content

Commit

Permalink
Add CRA note to caveats
Browse files Browse the repository at this point in the history
facebook/create-react-app#2730 (comment)

We don't want users thinking they have to purge the cache, as this will be very detrimental to their rebuild speed.
  • Loading branch information
Timer committed Oct 3, 2018
1 parent 1785a0f commit d5a1caf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -158,6 +158,8 @@ Are you trying to make your own macros that works with `babel-plugin-macros`? Go

#### Babel cache problem

>**Note:** This issue is not present when used in Create React App.
Most of the time you'll probably be using this with the babel cache enabled in webpack to rebuild faster. If your macro function is **not pure** which gets different output with same code (e.g., IO side effects) it will cause recompile mechanism fail. Unfortunately you'll also experience this problem while developing your macro as well. If there's not a change to the source code that's being transpiled, then babel will use the cache rather than running your macro again.

For now, to force recompile the code you can simply add a cache busting comment in the file:
Expand Down

0 comments on commit d5a1caf

Please sign in to comment.