Skip to content
affaan-m avatar

Vite Patterns

Vite build tool patterns covering config, plugins, HMR, env variables, proxy, SSR, and library mode.

CCM score
73 of 100
skills.sh installs
9.2K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers config structure, plugin selection, HMR API usage, environment variables, dev proxy, SSR, library mode, and pre-bundling
  • Includes a table of key config options (root, base, envPrefix, build.minify, build.sourcemap) and a list of essential plugins
  • Enforces the rule that only public values belong in VITE_ variables, because those are inlined into the client bundle at build time
  • Designed for projects using vite.config.ts that need type checking alongside vite build, since Vite does not type-check during builds

Install

$ npx -y skills add affaan-m/ecc --skill vite-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Vite Patterns

Build tool and dev server patterns for Vite 8+ projects. Covers configuration, environment variables, proxy setup, library mode, dependency pre-bundling, and common production pitfalls.

When to Use

  • Configuring vite.config.ts or vite.config.js
  • Setting up environment variables or .env files
  • Configuring dev server proxy for API backends
  • Optimizing build output (chunks, minification, assets)
  • Publishing libraries with build.lib
  • Troubleshooting dependency pre-bundling or CJS/ESM interop
  • Debugging HMR, dev server, or build errors
  • Choosing or ordering Vite plugins

How It Works

Details

Repository
github.com/affaan-m/ecc
Category
Frontend & UI Code
First seen
Jul 14, 2026

Questions

What does the vite-patterns skill help with?

The vite-patterns skill covers Vite build tool patterns, including vite.config.ts setup, plugins, HMR, environment variables, dev server proxy, SSR, library mode, dependency pre-bundling and build optimization. It activates when you work with vite.config.ts, Vite plugins or Vite-based projects. The SKILL.md targets Vite 8 and later projects.

How do I install the vite-patterns skill?

Run npx -y skills add affaan-m/ecc --skill vite-patterns -y in your project to install it. After that, the agent can apply Vite config, plugin and environment variable guidance when you edit vite.config.ts or other Vite files.

Which Vite topics does vite-patterns cover in detail?

The skill includes config structure with defineConfig and loadEnv, a table of key config options, and guidance on choosing essential plugins such as React SWC, vite-plugin-checker and vite-tsconfig-paths. It also explains how to write a minimal custom plugin and how import.meta.hot handles HMR state. Environment variables are covered, with the rule that only VITE_-prefixed values reach client code.

Is the VITE_ prefix safe for storing secrets with vite-patterns?

No, the skill warns that any VITE_-prefixed variable is statically inlined into the client bundle at build time and can be extracted from shipped JavaScript. Secrets such as API tokens and private keys should stay server-side behind an API or serverless function. Only public values like API URLs and feature flags belong in VITE_ variables.

More from affaan-m/ecc

All 257

Similar to Vite Patterns

More Frontend & UI Code