From 50cd334f27ac2d29e7f35eb2f56846ecb085dafc Mon Sep 17 00:00:00 2001 From: sorrycc Date: Tue, 14 Aug 2018 11:42:32 +0800 Subject: [PATCH] polyfill with umi-plugin-react --- config/config.js | 1 + src/global.js | 1 - src/polyfill.js | 12 ------------ 3 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 src/global.js delete mode 100644 src/polyfill.js diff --git a/config/config.js b/config/config.js index 43434e10..766780e5 100644 --- a/config/config.js +++ b/config/config.js @@ -20,6 +20,7 @@ export default { default: 'zh-CN', // default zh-CN baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default }, + polyfills: ['ie9'], ...( require('os').platform() === 'darwin' ? { diff --git a/src/global.js b/src/global.js deleted file mode 100644 index 2100827d..00000000 --- a/src/global.js +++ /dev/null @@ -1 +0,0 @@ -import './polyfill'; diff --git a/src/polyfill.js b/src/polyfill.js deleted file mode 100644 index ad1eb6b9..00000000 --- a/src/polyfill.js +++ /dev/null @@ -1,12 +0,0 @@ -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; -- GitLab