# Vite React TS Config

> Create or update vite.config.ts for a Vite React-TS project, following best practices (defineConfig, aliases, env usage, server/build defaults).

- Skill: `majiayu000/vite-react-ts-config` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/vite-react-ts-config`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/vite-react-ts-config/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/vite-react-ts-config

---


# Vite Config (React-TS) Skill

You are editing a Vite + React + TypeScript project’s configuration.

## Rules / best practices

1) Use vite.config.ts and export via defineConfig().
2) Keep config minimal; only add what’s needed for the user’s stated goal.
3) Prefer stable patterns:
   - path aliases via resolve.alias (and also ensure tsconfig paths match if used)
   - environment variables via import.meta.env (VITE_ prefix)
4) Avoid relying on obscure plugins unless requested.

## Deliverables

- Show the intended vite.config.ts contents (or diff-style summary).
- If adding aliases, also update tsconfig.json paths (and mention restarting TS server).
- If adding env usage, show .env.example and safe usage notes.

Use template.md as the default structure.

