xcatliu / react-ie8

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

webpack-dev-server --inline --hot 报错 #45

Closed shfshanyue closed 7 years ago

shfshanyue commented 7 years ago

--hot 会生成一个 hotCreateRequire 的函数,其中有 indexOf,而 IE8 不支持

if(me.hot.active) {
/******/                if(installedModules[request]) {
/******/                    if(installedModules[request].parents.indexOf(moduleId) < 0)
/******/                        installedModules[request].parents.push(moduleId);
/******/                    if(me.children.indexOf(request) < 0)
/******/                        me.children.push(request);
/******/                } else hotCurrentParents = [moduleId];
/******/            }
jiachaosun commented 7 years ago

Same problem + 1.

xcatliu commented 7 years ago

dev 环境下不支持 IE8 没关系吧,production 环境下支持就行了

shfshanyue commented 7 years ago

@xcatliu 是这样子的,非常感谢