Skip to content
Back to skills

Stack Vite

ASecurity

Vite frontend build tool — configuration, plugins, asset loading

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 6, 2026
ai-agentsapifrontendbackendsecurityperformance

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 20, 2026

npx -y skills add Snakeblack/ospec-workflow --skill stack-vite --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stack Vite?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stack Vite
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snakeblack-stack-vite/badge)](https://www.skillsdirectory.com/skills/snakeblack-stack-vite)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stack-vite
description: "Vite frontend build tool — configuration, plugins, asset loading"
license: MIT AND Commons-Clause
metadata:
  author: "affaan-mustafa, manuel-retamozo-garcia"
  version: "1.0"
capabilities: [vite]
---

# Vite Patterns

Build tool and dev server patterns for Vite 8+ projects. Covers configuration, environment variables, proxy setup, library mode, dependency pre-bundling, and common production pitfalls.

## When to Use

- Configuring `vite.config.ts` or `vite.config.js`
- Setting up environment variables or `.env` files
- Configuring dev server proxy for API backends
- Optimizing build output (chunks, minification, assets)
- Publishing libraries with `build.lib`
- Troubleshooting dependency pre-bundling or CJS/ESM interop

## Core Rules

1. **Dev vs Build Engines**: Dev serves files as native ESM (transpiled on demand via esbuild). Production builds use Rolldown/Rollup. Always smoke-test with `vite preview` before deploying.
2. **Type Checking Gap**: Vite build transpiles but does NOT type-check. You must run `tsc --noEmit` in CI or use `vite-plugin-checker`.
3. **Environment Security**: Only `VITE_`-prefixed environment variables are exposed to the client. Secrets must NEVER use the prefix. Never pass empty string `loadEnv(mode, cwd, '')` as it leaks server secrets.
4. **Performance Aliases**: Avoid hand-rolling aliases. Use `vite-tsconfig-paths` to reuse `tsconfig.json` configurations.
5. **Barrel Files**: Avoid importing from index/barrel files in the dev server hot-path as it triggers loading of all re-exported files.

## References

For full code examples, plugin configurations, manual chunk setups, and server proxy details, refer to:
* [Vite Configuration & Build Optimization Patterns](references/patterns.md)

Files in this skill

  • SKILL.md1.7 KB
  • references/patterns.md15 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.