mikkelkrogsholm/dev-skills

vite

Vite — next-generation frontend build tool with instant dev server and optimized production builds.

First seen Mar 2, 2026

Installation

$ npx skills add mikkelkrogsholm/dev-skills --skill vite

Summary

  • Vite — next-generation frontend build tool with instant dev server and optimized production builds.
  • Use when building with Vite or asking about its APIs, configuration, plugins, SSR, environment variables, or integration with frameworks.
  • Fetch live documentation for up-to-date details.

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 mikkelkrogsholm/dev-skills · top by installs.

npx skills add mikkelkrogsholm/dev-skills

Browse all from mikkelkrogsholm/dev-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 6
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,099 B
  • docs SUMMARY.md 300 B

History

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

SKILL.md

Vite

CRITICAL: Your training data for Vite is unreliable. APIs change between versions and memorized patterns may be wrong or deprecated. Before writing any code, you MUST use WebFetch to read the live docs:

WebFetch("https://vite.dev/llms.txt";)

Do not proceed without fetching this URL first. Never assume a config option or plugin API exists — verify against current docs.

Vite is a frontend build tool that serves source files via native ES modules during development and uses Rollup for optimized production builds.

Key Capabilities

Vite has several built-in features developers commonly add external packages for:

  • TypeScript: Transpiled natively via esbuild (20-30x faster than tsc) — no ts-loader or babel-preset-typescript needed. Note: Vite only transpiles, it does not type-check; run tsc --noEmit separately.
  • CSS Modules: Any file named *.module.css is automatically a CSS module returning a scoped object — no extra plugin needed.
  • CSS Pre-processors: .scss, .sass, .less, .styl work out of the box — just npm install the preprocessor itself, no Vite plugin required.
  • JSON named imports: import { version } from './package.json' works and is tree-shaken — no need for a JSON loader plugin.
  • Glob imports: import.meta.glob('./dir/*.js') handles dynamic multi-module imports natively — no require.context workaround needed.
  • Web Workers: Standard new Worker(new URL('./worker.js', import.meta.url)) syntax is supported natively alongside the ?worker query suffix.
  • Static asset transforms: Query suffixes ?url, ?raw, ?inline change how assets are imported — no file-loader/url-loader equivalents needed.
  • Env variables: Built-in .env file loading with import.meta.env — no dotenv-webpack or similar needed.

Best Practices

VITE prefix is required for client exposure. Only variables prefixed with VITE are exposed to client code via import.meta.env. Variables without this prefix are intentionally hidden to prevent secrets from leaking into the browser bundle. Coming from webpack's DefinePlugin, this is the single most common missed step.

Env variables are always strings. import.meta.env.VITEPORT is "3000" not 3000. Cast explicitly: Number(import.meta.env.VITEPORT) or import.meta.env.VITE_FLAG === 'true'.

.env changes require a server restart. Vite reads .env files at startup — modifying them does not trigger HMR. Many developers waste time waiting for a reload that never comes.

NODEENV and --mode are independent. Running vite build --mode staging still sets NODEENV=production. To change NODEENV, set it as a shell variable: NODEENV=development vite build.