React Hot Loader
错误Warning: [react-router] You cannot change ; it will be ignoredWarning: [react-router] You cannot change ; it will be ignored错误类型原因:// src/index.js// Hot Module Replacement APIif (...
·
错误
Warning: [react-router] You cannot change ; it will be ignored
Warning: [react-router] You cannot change ; it will be ignored
错误类型
原因:
// src/index.js
// Hot Module Replacement API
if (module.hot) {
module.hot.accept();
}
看这个issues
链接1
react-transform-hmr
babel-plugin-react-transform
解决方案:
$ npm install --save-dev react-transform-hmr
$ npm install --save-dev babel-plugin-react-transform
.babelrc
{
"presets": [ "es2015", "stage-0", "react"],
"env": {
"build": {
"optional": ["optimisation", "minification"]
},
"development": {
"plugins": [["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"] }]
}]]
}
},
"plugins": [
["transform-runtime"],
["import", {"libraryName": "antd", "style": "css"}]
],
"sourceMaps": true
}
更多推荐
已为社区贡献1条内容
所有评论(0)