Skills vite
install
source · Clone the upstream repo
git clone https://github.com/TerminalSkills/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/TerminalSkills/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/vite" ~/.claude/skills/terminalskills-skills-vite && rm -rf "$T"
manifest:
skills/vite/SKILL.mdsafety · automated scan (low risk)
This is a pattern-based risk scan, not a security review. Our crawler flagged:
- references .env files
Always read a skill's source content before installing. Patterns alone don't mean the skill is malicious — but they warrant attention.
source content
Vite
Overview
Vite is a next-generation frontend build tool providing instant dev server startup via native ES modules and optimized Rollup-based production builds. It supports React, Vue, Svelte, and vanilla TypeScript projects with advanced bundling strategies, plugin extensibility, and library mode.
Instructions
- When setting up a project, create
with the appropriate framework plugin (vite.config.ts
,@vitejs/plugin-react
), configure@vitejs/plugin-vue
withresolve.alias
mapping to@
, and set environment variables withsrc/
prefix.VITE_ - When configuring the dev server, set up API proxying with
, enable HTTPS withserver.proxy
, and use@vitejs/plugin-basic-ssl
polling for containers or VMs.server.watch - When optimizing builds, configure manual chunks with
for vendor splitting, enable CSS code splitting, and setbuild.rollupOptions.output.manualChunks
for browser compatibility.build.target - When creating plugins, use the Rollup-compatible plugin API with
,resolveId
, andload
hooks, and leverage virtual modules with thetransform
prefix.virtual: - When building libraries, configure
with entry point and output formats (es, cjs, umd), externalize peer dependencies, and usebuild.lib
for TypeScript declaration generation.vite-plugin-dts - When migrating from Webpack, replace
withwebpack.config.js
, swap loaders for Vite plugins, and updatevite.config.ts
env vars toREACT_APP_*
.VITE_* - When integrating testing, use Vitest which shares Vite config and provides instant HMR for tests.
Examples
Example 1: Migrate a Create React App project to Vite
User request: "Convert my CRA project to use Vite instead"
Actions:
- Install Vite and
, remove react-scripts@vitejs/plugin-react - Create
with React plugin and path aliasesvite.config.ts - Rename
environment variables toREACT_APP_*VITE_* - Update
to reference the entry module directlyindex.html
Output: A Vite-powered React project with faster dev startup and HMR.
Example 2: Configure optimized production build
User request: "Set up Vite build with vendor chunk splitting and source maps for Sentry"
Actions:
- Configure
to separate vendor librariesbuild.rollupOptions.output.manualChunks - Enable
for error monitoring integrationbuild.sourcemap - Set
appropriate to browser support requirementsbuild.target - Add
tuning for small asset optimizationbuild.assetsInlineLimit
Output: An optimized production build configuration with proper chunk splitting and debugging support.
Guidelines
- Always use
for client-exposed env vars, neverimport.meta.env.VITE_*
.process.env - Configure
withresolve.alias
prefix mapping to@
for clean imports.src/ - Split vendor chunks manually when default chunking produces too many small files.
- Use
for modern-only apps,build.target: "esnext"
for legacy browser support.@vitejs/plugin-legacy - Enable
in production for error monitoring tools.build.sourcemap - Keep
clean by extracting complex plugin configs into separate files.vite.config.ts - Use
to pre-bundle problematic dependencies that break during dev.optimizeDeps.include