Webpack keeps converting async/await to _async_to_generator, how can I disable this feature? #18952
-
|
Dear Webpack community I'm using Webpack in my project, and I've noticed that it's converting my async/await code into _async_to_generator functions in the final output. For compatibility reasons, I’d like to keep the original async/await syntax without this transformation. I've tried tweaking some settings but haven't had any luck yet. Does anyone know how to disable this behavior in Webpack (or perhaps with a specific plugin)? Any advice would be appreciated! This is my Webpack.config.json: const isDev = true; module.exports = { } Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
For more info |
Beta Was this translation helpful? Give feedback.
-
|
You configured swc-loader to output ES6 code but async/await was added in ES2017, which is why it is downlevelling your async/await code. |
Beta Was this translation helpful? Give feedback.


You configured swc-loader to output ES6 code but async/await was added in ES2017, which is why it is downlevelling your async/await code.