AgentSkillsCN

vite

Vite 性能优化指南。在编写、审查或重构 Vite 配置与项目时,应使用此技能,以确保实现最优性能模式。适用于涉及 Vite 配置、构建优化、依赖预打包、插件开发、包分析,或 HMR 问题的任务。

SKILL.md
--- frontmatter
name: vite
description: Vite performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring Vite configuration and projects to ensure optimal performance patterns. Triggers on tasks involving Vite config, build optimization, dependency pre-bundling, plugin development, bundle analysis, or HMR issues.

Vite Best Practices

Comprehensive performance optimization guide for Vite applications. Contains 42 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Configuring Vite for a new project
  • Troubleshooting slow dev server startup
  • Optimizing production bundle size
  • Debugging HMR issues
  • Writing or evaluating Vite plugins
  • Migrating from Webpack or other bundlers

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Dependency Pre-bundlingCRITICALdeps-
2Plugin PerformanceCRITICALplugin-
3Bundle OptimizationCRITICALbundle-
4Import ResolutionHIGHimport-
5Build ConfigurationHIGHbuild-
6Development ServerMEDIUM-HIGHdev-
7CSS OptimizationMEDIUMcss-
8Advanced PatternsLOW-MEDIUMadvanced-

Quick Reference

1. Dependency Pre-bundling (CRITICAL)

2. Plugin Performance (CRITICAL)

3. Bundle Optimization (CRITICAL)

4. Import Resolution (HIGH)

5. Build Configuration (HIGH)

6. Development Server (MEDIUM-HIGH)

7. CSS Optimization (MEDIUM)

8. Advanced Patterns (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information