react引用mobx报错Support for the experimental syntax

react引用mobx报错Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled
解决方式如下:
1.npm run eject
2.在package.json添加如下代码:

"plugins": [
      [
        "@babel/plugin-proposal-decorators",
        {
          "legacy": true
        }
      ]
    ]

react引用mobx报错Support for the experimental syntax

如果你执行npm run eject是报错,那可能没有本地仓库.git需要先执行以下命令:
1.git init
2.git add .
3.git commit -m ‘init’
然后就可以执行npm run eject了

上一篇:pyqt5多进程程序打包后,运行出现多个窗口的问题


下一篇:webpack打包项目报错:You may need an appropriate loader to handle this file type, currently no loaders are