react-router4.0在IE9/10下报这个错,why?

最近把项目升级到了react-router 4.0。
其他浏览器都正常,只有IE10和IE9版本,报了一个错:
图片描述

语法错误?
npm包用的都是最新的,大概有这些:

"dependencies": {
    "antd": "^2.13.2",
    "babel-polyfill": "^6.26.0",
    "lodash": "^4.17.4",
    "prop-types": "^15.5.10",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-redux": "^5.0.6",
    "react-router": "^4.2.0",
    "react-router-dom": "^4.2.2",
    "react-router-redux": "^5.0.0-alpha.6",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "reqwest": "^2.0.5"
  },
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-plugin-import": "^1.5.0",
    "babel-plugin-transform-decorators": "^6.24.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "babel-runtime": "^6.26.0",
    "css-loader": "^0.28.7",
    "eslint": "^4.7.1",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-react": "^7.3.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^0.11.2",
    "happypack": "^4.0.0",
    "html-webpack-plugin": "^2.30.1",
    "less": "^2.7.2",
    "less-loader": "^4.0.5",
    "node-sass": "^4.5.3",
    "postcss-loader": "^2.0.6",
    "react-hot-loader": "^3.0.0-beta.7",
    "sass-loader": "^6.0.6",
    "style-loader": "^0.18.2",
    "url-loader": "^0.5.9",
    "webpack": "^3.6.0",
    "webpack-dev-server": "^2.8.2"
  }

以前用react-router 3.0 时,是可以兼容到IE9的。
升成react-router 4.0 后,IE9/10都不行了。
不知道是我哪里没配置正确吗?
有大神有配好的react-router4.0以上的脚手架参考吗?

阅读 3.7k
1 个回答

不是react-router的问题
是webpack配置的问题。
开发环境配置的config,最终打包成一个bundle.js.不知道为什么就是不支持IE9/10

但正式打包发布后,可以支持IE9/10

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题