vite-config

vite-config is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (1,888 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/. Also seen: mentions AGENTS.md.

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,888 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.01888
Opus 5.5 $0.00000 $0.00755
Sonnet 5.5 $0.00000 $0.00378
Haiku 4.5 $0.00000 $0.00189

Measured 1mo ago against content hash 86b6cb57c841, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 54 lines

How it starts

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

Vite Config (front-*)

Config shape

  • defineConfig(({ command, mode }) => …), comparing command === "build" / command === "serve" explicitly.
  • appDir from import.meta.url, not process.cwd(). Config-time env: loadEnv(mode, envDir, "VITE_") - .env* is not in process.env while the config evaluates. envDir is false under SKIP_ENV_FILES and appDir otherwise, and the returned config sets the same envDir: the agent sandbox cannot read .env*, and the Cloudflare Vite plugin aborts on an unreadable env file (root AGENTS.md, Environment).
  • Small build-only plugins stay inline; extract one only when front-* apps share it. TS bundling issues: vite --configLoader runner.

Vite 8 (Rolldown + Oxc)

  • build.rolldownOptions / optimizeDeps.rolldownOptions, not the deprecated rollupOptions / esbuildOptions; build.minify: "oxc"; build.commonjsOptions is a no-op.
  • Chunk groups live in codeSplitting.groups; never add the deprecated manualChunks.

Plugins (order matters)

tanstackDevtools (@tanstack/devtools-vite) → tanstackRouter (before react) → react({ compiler: { reportDiagnostics: true } }) (native Rust React Compiler via the optional peer oxc-transform-react; no Babel pass) → tailwindcss → cloudflare → build-only (apply: "build"), with sentryVitePlugin last.

  • Keep reportDiagnostics: without it, a component the compiler skips loses memoization silently instead of printing a Vite warning, and rule frontend/react forbids manual memo.

  • cloudflare({ types: { generate: false } }): the assets-only SPA reads no env. Worker settings (name, assets, observability per mode) live in cloudflare.config.ts.

  • @cloudflare/vite-plugin is pinned exactly to a numbered 2.0 beta (2.0.0-beta.v.N): cf requires >=2.0.0-0 <3, and beta numbers change behavior (v.3 errors on legacy config, v.6 turns the dev registry on), so a range would float onto untested behavior.

  • No config-identity workaround plugin: plugin 2.0 no longer replaces server.config (1.x's copy made the injected DevTools script 500).

Read the full file on GitHub · 54 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. 1mo ago Changed · +1 lines 86b6cb57c841
  2. 1mo ago Changed · +2 lines afef6b2b24b6
  3. 2mo ago Changed c22256f25816
  4. 2mo ago Changed 00aa2529faa0
  5. 2mo ago Changed 8d288b0795a1
  6. 2mo ago Changed · -1 lines b1a4b3586374
  7. 2mo 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 7d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,888 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.

Related

vite-config compared with cursor rules from other repositories

vite-config next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
vite-configlouisbrulenaudet/monorepo-templateCursor rule197d agoApache-2.0A0Cursor
react_hooksnphausg/ai-agent-skillsCursor rule24mo agoApache-2.0A87Cursor
react-typescript-autousrrname/cursorrulesCursor rule117mo agoISCA0Cursor
nextjs-react19-autousrrname/cursorrulesCursor rule117mo agoISCA482Cursor
react-component-templatehumanstack/vibe-coding-templateCursor rule2511y agononeA6Cursor
nextjs-standardshumanstack/vibe-coding-templateCursor rule2511y agononeA0Cursor
react-chakra-ui-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A248Cursor