'@babel/register' not caching plugins and presets correctly #11650
-
Dear community! :D I was looking at long test times in our project. I recorded a CPU profile of a test run and noticed something rather odd. I then ran in a debugger to see what's going on in babel core and noticed that plugins and presets somehow get reloaded all the time whereas they should be loaded from cache. To clarify - I double checked that there is multiple calls to Below
Appreciate your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The problem is that we still need to resolve the plugins every time. If you use |
Beta Was this translation helpful? Give feedback.
-
Wow, thanks, this is a great tip! This reduced our test startup time by 50-70% on average! Wish I'd knew about it earlier :D |
Beta Was this translation helpful? Give feedback.
The problem is that we still need to resolve the plugins every time. If you use
require("plugin name")
instead of just"plugin name"
in your config, you might get a good perf boost because you completely skip Babel's resolution.