const { override } = require("customize-cra"); // import { override } from "customize-cra"; const path = require("path"); module.exports = override((config) => { config.resolve.alias = { "@": path.resolve(__dirname, "src"), }; return config; }); ## 修改package.js文件内容 ```js //修改这部分内容 "scripts": { "start": "react-app-rewired start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" },
重新安装
npm install react-app-rewired customize-cra --save
ok