support-ie8

polyfill

在页面引入 polyfil

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

其他资源

使用特定的构建工具

  • 👍 使用 es3ify-loader

使用特定版本的构建工具

构建工具兼容配置

  • ℹ️ React hot reload 不支持IE8,本地开发阶段要测试IE8请取消热更新.
  • ℹ️ uglify@2.7.0之后的版本 设置 screw-ie8: false compress: { warnings: false, screw_ie8: false }, mangle: { screw_ie8: false }, output: { screw_ie8: false }
  • ℹ️ babel-presets-es2015 设置 loose: true ,避免出现 Object.defineProperty "presets": [ ["es2015", { "loose": true }] ]

使用特定版本的第三方包

  • 👍 react@1.14.8 react@15.*.* 不兼容IE8
  • 👍 react-router@2.3.0 2.3.0 以上版本存在 Object.defineProperty
  • 👍 redux@3.*.* redux 4 不支持IE8 Redux 4 breaking changes

不要使用特定版本的第三方包

不要使用的第三包

webpack 注意事项

// 不兼容IE8
import { Tabs } from "antd"
// 兼容IE8
import Tabs from "antd/lib/tabs"

IE Debug

禁用内存保护(IE8没有)

image

image

禁用崩溃重启

image

找到调试工具

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

image

普通刷新清除不了IE缓存

image