使用Vite/CRA搭建(最新版本)React 19.1+TypeScript 5.9+React-Router 6.4+Redux 5.01+Antd 5.27开发环境及安装开发工具

使用Vite搭建React历史版本的开发环境

一、使用Vite安装:

1、安装React+TypeScript,使用如下命令:

npm create vite antd-demo

或单独安装TypeScript

如何在React项目中引入TypeScript?

2、安装React-Router

按照如下文档安装,安装时如果一直等待,可以先删掉node_modules目录和package-lock.json文件再重新执行安装。

React 18.2中使用React Router 6.4

3、安装Redux

React 18.2中使用Redux 5.0.1(结合TS使用)

4、安装Antd

npm install antd --save

5、安装完成后的package.json

{
  "name": "react-vite-demo",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  },
  "dependencies": {
    "antd": "^5.27.6",
    "react": "^19.1.1",
    "react-dom": "^19.1.1",
    "react-redux": "^9.2.0",
    "react-router-dom": "6.4",
    "redux": "^5.0.1"
  },
  "devDependencies": {
    "@eslint/js": "^9.36.0",
    "@types/node": "^24.6.0",
    "@types/react": "^19.1.16",
    "@types/react-dom": "^19.1.9",
    "@types/react-redux": "^7.1.34",
    "@types/redux": "^3.6.31",
    "@vitejs/plugin-react": "^5.0.4",
    "eslint": "^9.36.0",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-react-refresh": "^0.4.22",
    "globals": "^16.4.0",
    "typescript": "~5.9.3",
    "typescript-eslint": "^8.45.0",
    "vite": "^7.1.7"
  }
}

6、tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
    
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值