Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to import core-js/stable and regenerator-runtime/runtime when using @babel/preset-env with useBuiltIns:'usage'?

I use babel 7.8.3 together with @babel/preset-env, useBuiltIns: 'usage' and corejs: 3. The documentation for @babel/preset-env is not clear to me.

Do I need to add the following lines at the top of my entry file or is it done automatically by babel?

import 'core-js/stable';
import 'regenerator-runtime/runtime';
like image 530
wube Avatar asked Jan 20 '26 00:01

wube


1 Answers

Don't need to add import code by yourself when use usage.

And no more need to manually include the regenerator-runtime helper when compiling generators after babel/core >= 7.18

like image 51
taoliujun Avatar answered Jan 21 '26 17:01

taoliujun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!