安装项目 安装全局yarn npm i yarn -g // 安装项目 npx create-react-app 你的项目名 --template typescript 进入项目目录 cd 你的项目名 安装需要的支持库(redux,react-router-dom) yarn add redux react-redux@types/react-redux -S yarn add react-router-dom @types/react-router-dom -S 安装需要的第三库(antd,babel-plugin-import,axios,mockjs) yarn add babel-plugin-import -D yarn add antd axios mockjs -S node-sass yarn add node-sass 配置babel文件–antd // .babelrc { "plugins" : [ [ "import" , { "libraryName" : "antd" , "libraryDirectory" : "es" , "style" : "css" // `style: true` 会加载 less 文件 } ] ] } 配置mobx—不需要 yarn add mobx mobx-react -s yarn add @babel/plugin