skills/vite/SKILL.md
Configure and optimize Vite for development, production builds, and library bundling.
npx skillsauth add iberi22/swal-skills ViteInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
VITE_ prefixed vars are exposed to client code — DB_PASSWORD stays server-side, VITE_API_URL is bundledimport.meta.env.VITE_* not process.env — process.env is Node-only and undefined in browser.env.local overrides .env and is gitignored by default — use for local secretsimport.meta.env.MODE is development or production — use for conditional logic, not NODE_ENVoptimizeDeps.include for pre-bundlingrequire() doesn't work in Vite — use import or createRequire from module for dynamic requiresssr.noExternal or optimizeDeps.exclude and let Vite transform themimport pkg from 'pkg'; const { method } = pkgnode_modules/.vite to force rebuild after package changesoptimizeDeps.include for persistent cachenpm link) aren't pre-bundled — add to optimizeDeps.include explicitlyoptimizeDeps.force: true rebuilds every time — only for debugging, kills dev performancevite.config.ts AND tsconfig.json — Vite uses its own, TypeScript uses tsconfigpath.resolve(__dirname, './src') not relative paths — relative breaks depending on working directory@/ alias is not built-in — must configure manually unlike some frameworks// vite.config.ts
resolve: {
alias: { '@': path.resolve(__dirname, './src') }
}
changeOrigin: true rewrites Host header — required for most APIs that check originws: true — HTTP proxy doesn't forward WS by default/api proxies /api/users, /api/ only proxies /api//usersserver: {
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '')
}
}
}
public/ files served at root, not processed — use for favicons, robots.txt, files that need exact pathssrc/assets/ files are processed, hashed, can be imported — use for images, fonts referenced in codeimport logo from './logo.png' — hardcoded paths break after buildnew URL('./img.png', import.meta.url) for dynamic paths — template literals with variables don't workbuild.rollupOptions.output.manualChunks for code splitting — without it, one giant bundlerollup-plugin-visualizer — find unexpected large dependenciesbuild.target defaults to modern browsers — set 'es2015' for legacy support, but increases bundle sizebuild.cssCodeSplit: true (default) — each async chunk gets its own CSS filebuild.lib for npm packages — different config from app modeexternal for peer dependencies — don't bundle React/Vue into your librarytsc — Vite doesn't emit .d.ts filesformats: ['es', 'cjs'] — some consumers still need require()import.meta.hot.accept()server.hmr.overlay: false hides error overlay — useful for custom error handling but hides issuesssr.external for Node-only packages — prevents bundling node_modules in SSR buildssr.noExternal forces bundling — needed for packages with browser-specific imports?inline suffix or configure css.postcss for SSRtesting
Xavier2 as the central context engine for SWAL - intelligent memory, decision-making, and context orchestration. Xavier2 is the CEO brain that stores memories, coordinates agents, and maintains project state.
tools
Delegate coding tasks to Codex, Claude Code, or Pi agents via background process. Use when: (1) building/creating new features or apps, (2) reviewing PRs (spawn in temp dir), (3) refactoring large codebases, (4) iterative coding that needs file exploration. NOT for: simple one-liner fixes (just edit), reading code (use read tool), thread-bound ACP harness requests in chat (for example spawn/run Codex or Claude Code in a Discord thread; use sessions_spawn with runtime:"acp"), or any work in ~/clawd workspace (never spawn agents here). Claude Code: use --print --permission-mode bypassPermissions (no PTY). Codex/Pi/OpenCode: pty:true required.
testing
Validador automático para WorldExams. Verifica integridad técnica y calidad pedagógica, activando regeneración automática si es necesario.
tools
Generador de bundles de preguntas ICFES Colombia (Matemáticas, Lectura Crítica, Ciencias, Sociales, Inglés) para grados 6, 9 y 11 usando MiniMax MCP.