[英]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.