安装react-app-polyfill

1
npm install react-app-polyfill

在入口文件index.js的开头增加如下代码

1
2
3
4
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import 'core-js/stable';
import 'regenerator-runtime/runtime';

修改package.json文件,给browserslist配置项增加ie11

1
2
3
4
5
6
7
8
9
10
11
12
13
14
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all",
"ie 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"ie 11"
]
},
感谢您的阅读,本文由 Astar 版权所有。如若转载,请注明出处:Astar(http://example.com/2021/01/05/react16%E5%9C%A8ie11%E4%B8%8B%E8%BF%90%E8%A1%8C/
微前端框架qiankun实践
vue-cli3兼容ie11