Nai*_*dim 11 internet-explorer create-react-app
随着Create React App 3.0的发布以及浏览器列表的添加,添加对IE 11的支持变得微不足道,但是如果您不知道在哪里查找,则很难找到这些步骤。该文档列出了“受支持的浏览器”,并显示了默认的浏览器列表配置(https://facebook.github.io/create-react-app/docs/supported-browsers-features),但这并不是您所需要的全部。
使用生产设置检查browserl.ist时,您会发现IE 11的使用率比Edge仍然高(https://browserl.ist/?q=%3E0.2%25%2C+not+dead%2C+not+op_mini + all),使用默认的CRA 3应用程序,您将在main.chunk.js中收到语法错误,而在使用IE 11的应用程序中将收到其他错误。
Nai*_*dim 41
要停止错误并获得在IE 11中运行的默认create-react-app React应用程序:
npx create-react-app [AppName]import 'react-app-polyfill/ie11';到index.js的非常顶部import 'react-app-polyfill/stable';在index.js的第一行下方添加IE 11 是一场噩梦。有一些事情可能会解决问题:
react-app-polyfill你可以更新的主要事情是一个伟大的点开始。该文档非常容易实现:https : //github.com/facebook/create-react-app/tree/master/packages/react-app-polyfill。babel-plugin-transform-arrow-functions是您最好的解决方案。它在文档中有很好的解释:https : //babeljs.io/docs/en/babel-plugin-transform-arrow-functions。browserslist.| 归档时间: |
|
| 查看次数: |
7285 次 |
| 最近记录: |