其他分享
首页 > 其他分享> > Support for the experimental syntax ‘decorators-legacy‘ isn‘t currently enab

Support for the experimental syntax ‘decorators-legacy‘ isn‘t currently enab

作者:互联网

缺少插件,不支持装饰模式

解决步骤

1 npm install -D @babel/plugin-proposal-decorators

2 npm run eject(如不执行该命令,可能导致修改无法生效)

3 修改package.json中的babel配置
"babel": {
    "presets": [
      "react-app"
    ],
    "plugins": [
      [
        "@babel/plugin-proposal-decorators",
        {
          "legacy": true
        }
      ]
    ]
 }

标签:enab,npm,plugin,babel,Support,currently,legacy,proposal,decorators
来源: https://blog.csdn.net/wq123123423432/article/details/120585595