vite-config

vite-config is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (1,201 once invoked), scanned A, original, Apache-2.0.

A set of configuration rules for Vite 8, a tool that runs and builds front-end web applications. It covers build settings, environment variables, plugin ordering, and monorepos, which are repositories containing multiple related projects.

In plain words
What is it for?
Use it when setting up or changing Vite configuration for front-end single-page apps, React projects, Cloudflare integrations, or monorepos.
Why use it?
It prevents configuration mistakes that can cause development servers or production builds to behave incorrectly. It also keeps newer Vite 8 options aligned with the project structure.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when setting up or changing Vite configuration for front-end single-page apps, React projects, Cloudflare integrations, or monorepos.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/vite-config
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vite-config

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/vite-config/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/vite-config)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/vite-config"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/vite-config/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for vite-config

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/vite-config"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/vite-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,201 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01201
Opus 5 $0.00000 $0.00600
Sonnet 5 $0.00000 $0.00240
Haiku 4.5 $0.00000 $0.00120

Measured 6d ago against content hash 9da729344366, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

vite-config scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/frontend/vite-config.mdc · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Config shape

  • defineConfig(({ command, mode }) => …) - compare command === "build" / command === "serve" explicitly.
  • appDir from import.meta.url, not process.cwd(). Config-time env: loadEnv(mode, appDir, "VITE_") - .env* is not in process.env during config evaluation.
  • Small build-only plugins inline; extract only when shared across front-* apps. TS bundling issues: vite --configLoader runner.

Vite 8 (Rolldown + Oxc)

  • build.rolldownOptions / optimizeDeps.rolldownOptions - not deprecated rollupOptions / esbuildOptions. build.minify: "oxc". build.commonjsOptions is a no-op.
  • manualChunks (function) works but is deprecated - preserve existing splits when editing; use codeSplitting for refactors.

Plugins (order matters)

devtoolstanstackRouter (before react) → react({ compiler: true }) (native Rust React Compiler via optional peer oxc-transform-react; no Babel pass) → tailwindcsscloudflare → build-only (apply: "build") → conditional via spread. Falsy plugins are skipped. Compiler on → less manual memoization (react.mdc). Do not configure auxiliaryWorkers on front-* to embed worker-api or other backends - HTTP-only SPA boundary.

DevTools

  • DevTools() (embedded plugin) and the top-level devtools config key are alternatives, not complements - enabling the key registers a second DevTools instance on serve and calls start() on build. Stay on the plugin.
  • Keep build.rolldownOptions.devtools set explicitly. @vitejs/devtools only seeds it from DevToolsBuildIntegration, which Vite registers when the top-level devtools key is enabled; that key is absent here, so without the explicit flag no build writes node_modules/.rolldown and the Rolldown dock stays empty (RDDT0001). Populate it with one build.
  • embeddedVisibility: "passive" keeps Vite's floating dock clear of TanStack's; Shift+Alt+D reveals it.
  • The devframe auth code banner is the client auth handshake, not an error. clientAuthTokens is readable only from the top-level key, so it stays un-pre-approved; never set clientAuth: false - it exposes the dev server and filesystem to any browser that can reach the port.
  • @vitest/ui stays a root devDependency: @vitejs/devtools-vitest probes for it at the pnpm workspace root, so an app-local install fails the Vitest dock with VTDT0001 (knip.md).

Read the full file on GitHub · 52 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 52 lines · 0 tokens per session scan A 9da729344366

Subscribe to this mod's changes

vite-config is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed 9d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,201 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.