关于 vite-react
Vite React Template 是供开发者构建 React 应用的起始项目,采用 TypeScript。它包含 React 19、Vite 7、ESLint 和热模块替换,并提供设置、构建与部署说明。
主要功能
- 01配置 React 19 和 Vite 7
- 02TypeScript 配置
- 03包含 ESLint
- 04支持热模块替换
- 05提供构建和部署说明
适用场景
- 01启动 React 应用项目
- 02使用 TypeScript 和 HMR 开发
- 03构建可部署的应用
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ rebyteai-template/ rebyte-skills --skill vite-react安装后在 Claude Code 中输入/vite-react确认已加载。
详细介绍
Vite React 模板
一个完整的 Vite + React 项目,包含 TypeScript、ESLint 和热模块替换。
技术栈
- 框架:React 19
- 构建工具:Vite 7
- 语言:TypeScript
- 包管理器:npm
- 输出:
dist目录 - 开发端口:5173
设置
1. 克隆模板
git clone --depth 1 https://github.com/Eng0AI/vite-react-template.git .
如果目录不为空:
git clone --depth 1 https://github.com/Eng0AI/vite-react-template.git _temp_template
mv _temp_template/* _temp_template/.* . 2>/dev/null || true
rm -rf _temp_template
2. 移除 Git 历史(可选)
rm -rf .git
git init
3. 安装依赖
npm install
构建
npm run build
构建前会运行 TypeScript 编译(tsc -b && vite build)。
部署
Vercel(推荐)
vercel pull --yes -t $VERCEL_TOKEN
vercel build --prod -t $VERCEL_TOKEN
vercel deploy --prebuilt --prod --yes -t $VERCEL_TOKEN
Netlify
netlify deploy --prod --dir=dist
开发
npm run dev
启用 HMR 后,在 http://localhost:5173 打开。
评论
支持 Markdown