Browse Source

Compatible with IE10

pull/1742/head
yoyo837 8 years ago
committed by 偏右
parent
commit
fce74f92ce
  1. 3
      package.json
  2. 3
      src/index.js
  3. 12
      src/polyfill.js

3
package.json

@ -45,14 +45,15 @@
"react-dom": "^16.4.1", "react-dom": "^16.4.1",
"react-fittext": "^1.0.0", "react-fittext": "^1.0.0",
"rollbar": "^2.3.4", "rollbar": "^2.3.4",
"setprototypeof": "^1.1.0",
"url-polyfill": "^1.0.10" "url-polyfill": "^1.0.10"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^8.1.2", "babel-eslint": "^8.1.2",
"babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-dva-hmr": "^0.4.1",
"babel-plugin-import": "^1.6.7", "babel-plugin-import": "^1.6.7",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-module-resolver": "^3.1.1", "babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"cross-env": "^5.1.1", "cross-env": "^5.1.1",
"cross-port-killer": "^1.0.1", "cross-port-killer": "^1.0.1",
"enzyme": "^3.1.0", "enzyme": "^3.1.0",

3
src/index.js

@ -1,5 +1,4 @@
import '@babel/polyfill'; import './polyfill';
import 'url-polyfill';
import dva from 'dva'; import dva from 'dva';
import createHistory from 'history/createHashHistory'; import createHistory from 'history/createHashHistory';

12
src/polyfill.js

@ -0,0 +1,12 @@
import '@babel/polyfill';
import 'url-polyfill';
import setprototypeof from 'setprototypeof';
// React depends on set/map/requestAnimationFrame
// https://reactjs.org/docs/javascript-environment-requirements.html
// import 'core-js/es6/set';
// import 'core-js/es6/map';
// import 'raf/polyfill'; 只兼容到IE10不需要,况且fetch的polyfill whatwg-fetch也只兼容到IE10
// https://github.com/umijs/umi/issues/413
Object.setPrototypeOf = setprototypeof;
Loading…
Cancel
Save