Co-Pilot / 辅助式
更新于 24 days ago
vite-react-best-practices
Cclaudiocebpaz
0.0k
claudiocebpaz/vite-react-best-practices
💡 摘要
该项目提供了使用Vite构建和优化React单页面应用程序的全面指南。
🎯 适合人群
React开发者前端工程师DevOps专业人士技术团队负责人软件架构师
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
安全分析低风险
自述文件没有直接指示任何安全风险,但不当处理环境变量可能会暴露敏感数据。确保验证和清理所有输入,并安全管理环境变量。
name: vite-react-best-practices description: Comprehensive React and Vite SPA performance, architecture, and deployment guidelines. Use this skill when building, reviewing, or refactoring React applications built with Vite (SPA). Covers Vite-specific build configurations, static hosting requirements, and core React performance patterns. license: MIT metadata: author: ant-gravity version: "1.1.0"
Vite React Best Practices
A senior-level guide for building production-ready React Single Page Applications (SPAs) with Vite.
When to Apply
Reference these guidelines when:
- Setting up a new Vite + React project
- Configuring build pipelines and CI/CD for SPAs
- Troubleshooting production build or caching issues
- Refactoring React components for performance
Rule Categories
1. Vite SPA Deployment (CRITICAL)
- Static Rewrites - Mandatory for client-side routing.
- Caching Strategy - Immutable assets, no-cache index.html.
- Build Validation - Preview before push.
- Environment Variables -
VITE_prefix and security.
2. React Core Performance
- Route Splitting - Lazy load pages.
- Server State - Use React Query/SWR.
- Memoization - When to use useMemo/useCallback.
- Image Optimization - CLS prevention.
3. Architecture & Cleanup
- Colocation - Feature-based structure.
- Anti-Patterns: Import from Dist - Avoid bundling twice.
- Troubleshooting - Common Vite fixes.
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
五维分析
清晰度9/10
创新性7/10
实用性9/10
完整性8/10
可维护性8/10
优缺点分析
优点
- 提供Vite和React的全面指南。
- 专注于性能和最佳实践。
- 对新手和经验丰富的开发者都有用。
缺点
- 对初学者来说可能会感到压倒。
- 需要对Vite和React有一定了解。
- 不是逐步教程。
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 claudiocebpaz.
