"devDependencies": { "babel-core": "6.26.3", "babel-loader": "7.1.4", "babel-plugin-transform-class-properties": "6.24.1", "babel-plugin-transform-decorators-legacy": "1.3.5", "babel-preset-env": "1.7.0", "babel-preset-react": "^6.24.1", "webpack": "4.12.1", "webpack-cli": "3.0.8" }, "dependencies": { "mobx": "5.0.3", "mobx-react": "5.2.3", "prop-types": "15.6.2", "react": "16.4.1", "react-dom": "16.4.1" }
猜测因为你的 webpack.config.js 中对于babel-loader的 plugins 顺序写反了,正确的顺序是 ['transform-decorators-legacy', 'transform-class-properties'],请参见 https://www.imooc.com/qadetail/264047 谢谢。
是这样的 对 没错