You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to bundle a JavaScript library that uses async functions and then use that library, I get ReferenceError: regeneratorRuntime is not defined, even when using --target node.
I found that the issue is resolved by adding { target: { node: "16" } } to the options of babel-preset-o in createInputConfig in src/rollup-config.ts, since instead of the async/await keywords being transformed to use regeneratorRuntime, they are just passed through to the output as is. Though I'm not sure exactly what value node should be instead of "16". Also, perhaps esmodules: true should be also added to target like it was before? (see below)
When I try to bundle a JavaScript library that uses async functions and then use that library, I get
ReferenceError: regeneratorRuntime is not defined
, even when using--target node
.I found that the issue is resolved by adding
{ target: { node: "16" } }
to the options ofbabel-preset-o
increateInputConfig
insrc/rollup-config.ts
, since instead of theasync
/await
keywords being transformed to useregeneratorRuntime
, they are just passed through to the output as is. Though I'm not sure exactly what valuenode
should be instead of"16"
. Also, perhapsesmodules: true
should be also added totarget
like it was before? (see below)bunchee/src/rollup-config.ts
Lines 60 to 63 in 9b67e95
The text was updated successfully, but these errors were encountered: