Via CLI

Via Node API

Options throwIfClosureRequired

In cases such as the following it’s impossible to rewrite let/const without adding an additional function and closure while transforming:

for(leti=0;i<5;i++){setTimeout(()=>console.log(i),1);}

In extremely performance-sensitive code, this can be undesirable. If "throwIfClosureRequired": true is set, Babel throws when transforming these patterns instead of automatically adding an additional function.