例如,babel-plugin-transform-async-generator-functions插件可以将异步生成器函数转换为ES2015的生成器函数。 安装插件并配置Babel以使用它。例如,在.babelrc文件中添加"plugins": ["transform-async-generator-functions"]。 修改源代码: 如果更改目标环境或使用转译工具不可行,考虑修改源代码,避免使用异步生成器函数。你...
项目执行 pnpm run dev 的时候控制台疯狂报错 ‘> node_modules/.pnpm/axios@1.4.0/node_modules/axios/lib/helpers/readBlob.js:3:17: error: Transforming async generator functions to the configured target environment ("es2015") is not supported yet 3 │ const readBlob = async function* (blob) ...
(Per-file) Exclusion of (nested) functions, classes and methods Optional transformation of docstrings Replacements based on fully qualified names (e.g. typing.AsyncGenerator is different than foo.typing.AsyncGenerator) Transformation of constructs like asyncio.TaskGroup to a thread based equivalentA...