[英]core-js/babel-polyfill polyfilled functions appear as [native code]
[英]Switching from babel-polyfill to core-js in React app
我在我的React
应用程序中使用babel-polyfill
polyfill 将ECMAScript
转换为 vanilla JS
。 我知道babel-polyfill
现在已被弃用。
我在React
应用程序中收到的警告是:
@babel/polyfill 已弃用。 请分别使用 core-js 和 regenerator-runtime/runtime 的必需部分
我目前在我的package.json
文件中有以下内容:
"devDependencies": {
"babel-polyfill": "^6.26.0",
"redux-devtools": "^3.5.0"
}
可以安全地假设我现在需要以下内容而不是babel-polyfill
吗?
"devDependencies": {
"core-js": "3.6.5",
"regenerator-runtime": "0.13.5"
},
另外,我认为,而不是import 'babel-polyfill';
在我的减速器和组件中,我想我需要以下内容:
import "core-js/stable";
import "regenerator-runtime/runtime";
这些是通过 go 的步骤吗? 我错过了什么吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.