我试图在节点服务器上启动我的应用程序并收到错误:
未捕获错误:locals [0]似乎不是启用了热模块替换API的module
对象。您应该在Babel配置中使用env
部分禁用生产中的react-transform-hmr。我已经关注了这个链接:
{
"presets": ["es2015", "stage-0"],
"env": {
// only enable it when process.env.NODE_ENV is 'development' or undefined
"development": {
"plugins": [["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
// if you use React Native, pass "react-native" instead:
"imports": ["react"],
// this is important for Webpack HMR:
"locals": ["module"]
}]
// note: you can put more transforms into array
// this is just one of them!
}]]
}
}
}
现在,我该怎么办?通过评论或更改某些行?