Error: Multiple configuration files found. Please remove one: - package.json - C:\XXX\xxx\.babelrc

Error: Multiple configuration files found. Please remove one:

  • package.json
  • C:\xxx\xxx\xxx\workspace\react-mobile.babelrc

出错原因:
package.json里和 .babelrc里出现了两份一样的配置

解决问题:
package.json或者.babelrc里保留一份配置即可

如, 我上述的两个文件中都有如下的配置,我只保留了.babelrc 里的配置:

{
  "plugins": [
    [
      "@babel/plugin-proposal-decorators",
      {
        "legacy": true
      }
    ],
    ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }]
  ],
  "presets": [
    "react-app",
    "@babel/preset-env"
  ]
}

你可能感兴趣的:(JavaScript,babel,json)