support-ie8
March 15, 2018 · View on GitHub
polyfill
在页面引入 polyfil
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
其他资源
使用特定的构建工具
- :+1: 使用
es3ify-loader
使用特定版本的构建工具
- :+1:
webpack@1.13.2https://github.com/SamHwang1990/blog/issues/6 - :+1:
karma@1.3.0https://github.com/karma-runner/karma/issues/2556
构建工具兼容配置
- :information_source: React hot reload 不支持IE8,本地开发阶段要测试IE8请取消热更新.
- :information_source:
uglify@2.7.0之后的版本 设置screw-ie8: falsecompress: { warnings: false, screw_ie8: false }, mangle: { screw_ie8: false }, output: { screw_ie8: false } - :information_source:
babel-presets-es2015设置loose: true,避免出现Object.defineProperty"presets": [ ["es2015", { "loose": true }] ]
使用特定版本的第三方包
- :+1:
react@1.14.8react@15.*.*不兼容IE8 - :+1:
react-router@2.3.02.3.0以上版本存在Object.defineProperty - :+1:
redux@3.*.*redux 4不支持IE8 Redux 4 breaking changes
不要使用特定版本的第三方包
- :warning:
antd@2x - :warning:
react-redux@4.0.1~4.0.3https://github.com/reactjs/react-redux/issues/227
不要使用的第三包
- :warning:
enzyme - :warning:
redux-sagahttps://github.com/redux-saga/redux-saga/issues/313
webpack 注意事项
// 不兼容IE8
import { Tabs } from "antd"
// 兼容IE8
import Tabs from "antd/lib/tabs"
IE Debug
禁用内存保护(IE8没有)

禁用崩溃重启

找到调试工具
吐槽:有时调试工具会出现在屏幕外,导致无法找到。

普通刷新清除不了IE缓存
