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

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

作者:互联网

//1. 安装依赖
npm i customize-cra react-app-rewired @babel/plugin-proposal-decorators
//2. 项目根目录下建config-overrides.js 加入代码:
const { override, addDecoratorsLegacy } = require('customize-cra');
module.exports = override(
 addDecoratorsLegacy()
);
//3.修改package.json文件
"scripts": {
     "start": "react-app-rewired start",
     "build": "react-app-rewired build",
     "test": "react-app-rewired test",
     "eject": "react-app-rewired eject"
}
//4. 重启项目
npm start

标签:babel,Support,currently,enabled,react,start,build,app,rewired
来源: https://blog.csdn.net/lovepink527/article/details/121330226