如题,特别是使用 export 或 import 来加载模块,babel 会编译出使用 default 作为属性名的代码:
requiredefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
而 default 在 IE8 中属于关键字,直接导致 IE8 下报错。
使用 commonjs 的模块加载语法来引入或导出模块。