internet-explorer - 如何在 Internet Explorer 10 或更高版本中使用 Create-React-App
问题描述
我正在使用 create-react-app 为公司 Intranet 开发代码。它是一个基于微软的系统,所以使用 IE 是必不可少的。不幸的是,我尝试过的任何东西都无法让我在 Internet Exploder 中加载它。
这是我的 package.json 文件。让我知道是否需要其他文件。不幸的是,我对 Babel 和 webpack 并不熟悉,所以我需要我能得到的所有帮助。
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^4.4.1",
"bootstrap-social": "^5.1.1",
"font-awesome": "^4.7.0",
"http-proxy-middleware": "^0.20.0",
"jquery": "^3.4.1",
"popper": "^1.0.1",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-bootstrap": "^1.0.0-beta.16",
"react-dom": "^16.12.0",
"react-nested-menu": "^1.0.9",
"react-popper": "^1.3.7",
"react-redux": "^7.1.3",
"react-redux-form": "^1.16.14",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"reactstrap": "^8.2.0",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && xcopy /E /Q /H /Y build c:\\inetpub\\ReactFrontEnd",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
">0.2%",
"not dead",
"not op_mini all",
"ie 11",
"ie 10"
]
},
"proxy": "http://localhost:81/",
"devDependencies": {
"@babel/polyfill": "^7.8.3",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3"
}
}
谢谢你。
解决方案
我尝试搜索这个问题,发现最近"react-scripts": "3.3.0"出现了一些问题,因为这个项目不适用于 IE 浏览器。
我建议你尝试使用"react-scripts": "3.2.0"。它可以帮助解决这个问题。
进行此更改后尝试清除 node_modules/.cache。
参考:
推荐阅读
- c# - 我需要代码如何在特定时间启动流程
- angular - Git如何添加没有url的子模块?
- javascript - 我想为 JavaScript 文件中的变量生成交叉引用列表
- javascript - 在函数组件中引用没有“this”的局部变量
- python - Django - is_valid 为身份验证内置登录表单返回 false
- glsl - 没有看到较低级别的着色器语法错误
- java - 如何在另一种方法中访问该方法?
- python - 如何控制 spyder 中的绘图显示?
- ml.net - ML.NET 模型生成器生成代码以返回多个预测结果
- reactjs - 在 AWS S3 和 CloudFront 中托管 React 路由器应用程序时出现 403 Access Denied 错误