xcatliu / react-ie8

Make your React app work in IE8
http://react-ie8.xcatliu.com/
998 stars 162 forks source link

报错了,不知道为啥... #21

Closed gggin closed 8 years ago

gggin commented 8 years ago

image

gggin commented 8 years ago

使用了还有es5-shime的标准用法

new webpack.optimize.UglifyJsPlugin({ compressor: { screw_ie8: true } })

xcatliu commented 8 years ago

可以看到报错内容吗? 代码不压缩的时候不会报错吗?

另外可以加上 sourceMap,这样可以看到压缩前的代码(不过好像 IE8 还不支持),详见:https://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin

gggin commented 8 years ago

太贴心了 不压缩也会报错 image

image

xcatliu commented 8 years ago

看上去是 default 的问题。

default 是 es3 的关键字,不能直接作为 object 的 key,否则会在 IE8 里面报错。

可能需要 es3ify-loader

相关 issue:https://github.com/xcatliu/react-ie8/issues/1

gggin commented 8 years ago

Thank you!

xcatliu commented 8 years ago

You are welcome!