create-react-app mobx 不支持 修饰器
1.npm run eject (返编译)
2.npm i (全部重新安装依赖)
3.npm install --save-dev babel-plugin-transform-decorators-legacy (安装该模块中间可能有告警自行消除即可)
4.npm install @babel/plugin-proposal-decorators
5.在 package.json 里修改 babel 如下所示
"babel": {
"plugins":[
[ "@babel/plugin-proposal-decorators", { "legacy":true } ], [ "@babel/plugin-proposal-class-properties", { "loose":true } ]
],
"presets":[
"react-app"
]
},
6npm start就可以了
相关推荐
82530995 2020-10-15
ruanhongbiao 2020-08-16
FEvivi 2020-06-16
FEvivi 2020-06-13
PANH 2020-06-12
zhongweinan 2020-06-10
PANH 2020-06-07
PANH 2020-06-01
82530995 2020-05-10
webfullStack 2020-04-26
zhongweinan 2020-04-24
FEvivi 2020-04-17
FEvivi 2020-04-15
zhongweinan 2020-03-03
zhongweinan 2020-02-21
PANH 2020-02-19
PANH 2020-01-23
zhongweinan 2020-01-21
上海彭彭 2020-01-14