巴别塔 7 | @babel/preset-env | useBuiltIns 用法——为什么要手动指定 core-js 版本?

问题描述

这是我在不设置 expect(received).toBe(expected) // Object.is equality Expected: "dupa" Received: null 选项的情况下使用 @babel/preset-env"useBuiltIns": "usage" 时得到的错误

corejs

我不明白为什么我们必须手动指定 WARNING (@babel/preset-env): We noticed you're using the 'useBuiltIns' option without declaring a core-js version. Currently,we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel,we recommend explicitly setting the core-js version you are using via the 'corejs' option. You should also be sure that the version you pass to the 'corejs' option matches the version specified in your package.json's 'dependencies' section. 版本。 babel 不能通过检查 core-js 文件中的内容自行解决吗?

否则,每次升级 package.json 时,我们都必须记住更新其在 core-js 内的关联版本号。这太容易忘记了。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)