Loading...
Loading...
Vite build tool configuration and ecosystem. Covers vite.config.ts setup, plugin authoring and popular plugins, dev server configuration (proxy, HMR, HTTPS), build optimization (chunking, tree-shaking, manual chunks, rollupOptions), library mode for publishing packages, SSR configuration, environment variables (.env handling), multi-page apps, CSS handling (PostCSS, CSS modules, preprocessors), and asset handling. Use when configuring Vite projects, authoring Vite plugins, optimizing builds, setting up dev server proxies, configuring SSR, handling environment variables, or troubleshooting Vite issues.
npx skill4agent add oakoss/agent-skills vite| Pattern | API | Key Points |
|---|---|---|
| Config file | | Type-safe config with IDE support |
| Conditional config | | Different config per command/mode |
| Path alias | | Map |
| Dev proxy | | Forward API requests to backend |
| HMR config | | WebSocket host/port/protocol |
| HTTPS dev | | Pass TLS cert/key options |
| Build target | | ES module target for output |
| Manual chunks | | Control code splitting |
| Library mode | | Publish ES/CJS/UMD packages |
| SSR build | | Server-side rendering config |
| Env variables | | Client-exposed env vars |
| loadEnv | | Load env vars in config |
| CSS modules | | Scoped CSS class names |
| Preprocessors | | Sass/Less/Stylus options |
| PostCSS | | Inline or external PostCSS config |
| Static assets | | Returns resolved public URL |
| Plugin | | Hook-based plugin system |
| Virtual module | | Generate modules at build time |
| Multi-page | | Multiple HTML entry points |
| Mistake | Correct Pattern |
|---|---|
Exposing secrets via | Only prefix client-safe vars with |
Using | Use |
Modifying | Always use |
| Not externalizing peer deps in library mode | Add React/Vue to |
| Creating QueryClient-style singletons in SSR | Ensure per-request state in SSR to avoid cross-request leaks |
Inline PostCSS config alongside | Use one or the other; inline config disables config file search |
Setting | |
Using | Use |
ExploreTaskcode-reviewerIf theskill is available, delegate test configuration and Vitest setup to it. If thevitest-testingskill is available, delegate Tailwind CSS configuration and utility patterns to it. If thetailwindskill is available, delegate React component patterns and hooks to it. If thereact-patternsskill is available, delegate TypeScript configuration and type patterns to it. If thetypescript-patternsskill is available, delegate monorepo workspace configuration to it.pnpm-workspace