joabgonzalez/ai-agents-skills

vite

Fast build tool with HMR for modern web development. Trigger: When configuring Vite, setting up dev server, or optimizing builds.

First seen May 15, 2026

Installation

$ npx skills add joabgonzalez/ai-agents-skills --skill vite

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from joabgonzalez/ai-agents-skills · top by installs.

npx skills add joabgonzalez/ai-agents-skills

Browse all from joabgonzalez/ai-agents-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 8
License Apache 2.0
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.1
LicenseApache 2.0
More metadata
version
1.1
type
tooling
dependencies
{"vite":">=5.0.0 <6.0.0"}

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,871 B
  • docs SUMMARY.md 141 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 6 installs

SKILL.md

Vite

Fast build with native ES modules, HMR. Config, plugins, env vars, optimization.

When to Use

  • Setting up Vite build tool for modern web apps
  • Configuring dev server with HMR
  • Optimizing build performance and bundle size
  • Using Vite plugins (React, Vue, etc.)
  • Configuring environment variables

Don't use for:

  • Webpack config (webpack skill)
  • Legacy builds

Critical Patterns

✅ REQUIRED: Use defineConfig

// ✅ CORRECT: Type-safe config
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
});

// ❌ WRONG: Plain object (no types)
export default {
  plugins: [react()],
};

✅ REQUIRED: Environment Variables with VITE\_ Prefix

// ✅ CORRECT: VITE_ prefix
// .env
VITE_API_URL=https://api.example.com

// Access in code
const apiUrl = import.meta.env.VITE_API_URL;

// ❌ WRONG: No prefix (won't be exposed)
API_URL=https://api.example.com // Not exposed

✅ REQUIRED: Use Plugins for Framework Support

// ✅ CORRECT: Framework plugin
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
});

Conventions

Vite Specific

  • Configure vite.config for project needs
  • Use environment variables with VITE\_ prefix
  • Optimize build output
  • Configure plugins properly
  • Use static asset handling

Decision Tree

React project?
  → Install and use @vitejs/plugin-react

Vue project?
  → Use @vitejs/plugin-vue

Need path aliases?
  → Configure resolve.alias in vite.config

Custom dev server port?
  → Set server.port

Proxy API calls?
  → Configure server.proxy to avoid CORS

Slow build?
  → Check bundle size, use dynamic imports, optimize dependencies

Environment-specific config?
  → Use mode parameter or separate config files

Example

vite.config.ts:

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
  server: {
    port: 3000,
  },
  build: {
    outDir: "dist",
    sourcemap: true,
  },
});

Edge Cases

CommonJS deps: Use optimizeDeps.include to pre-bundle.

Global vars: define option replaces constants at build.

Static assets: public/ copied as-is, imports processed/hashed.

Base path: Set base for subdirectory deploy.

CSS splitting: Auto-splits CSS. build.cssCodeSplit: false combines.


Resources