agentleFS
TheBeardedBearSASTheBeardedBearSAS/claude-craft/.claude/references/vite/CLAUDE.md

claude-craft / vite

CLAUDE.md108 starsChanged 17 days agoMITView on GitHub

⚠️ Tier-3 / Community — This stack is community-maintained and scoped strictly to framework-agnostic Vite usage. It does not cover React/Vue/Angular/Svelte's own Vite dev-server integration — those are documented in each stack's own tooling.md (@.claude/references/react/, @.claude/references/vuejs/, @.claude/references/angular/, @.claude/references/svelte/). Scope framework-agnostic uniquement. Pour Vite en tant que dev-server React/Vue/Angular/Svelte, voir le tooling.md de ce stack. Source : Vite 8 blog | Rolldown Vite n'a pas de modèle de composant propre — c'est un build tool et un dev server. Ce stack…

The file

Files
CLAUDE.md

Vite 8.3 (framework-agnostic) - Quick Reference

⚠️ Tier-3 / Community — This stack is community-maintained and scoped strictly to framework-agnostic Vite usage. It does not cover React/Vue/Angular/Svelte's own Vite dev-server integration — those are documented in each stack's own tooling.md (@.claude/references/react/, @.claude/references/vuejs/, @.claude/references/angular/, @.claude/references/svelte/).

Scope framework-agnostic uniquement. Pour Vite en tant que dev-server React/Vue/Angular/Svelte, voir le tooling.md de ce stack.

Versions Requises (2026)

ComposantVersionNotes
Vite8.3.xRolldown bundler par défaut (voir rolldown.md)
TypeScript5.6+Strict mode obligatoire
Vitest4.1+Browser Mode stable pour workers/WASM
Node.js^20.19.0 ou >=22.12.0Prérequis de Vite 8 (engines)
vite-plugin-dts5.xGénération .d.ts pour build.lib

Source : Vite 8 blog | Rolldown

Ce que couvre ce stack

Vite n'a pas de modèle de composant propre — c'est un build tool et un dev server. Ce stack documente les 4 usages framework-agnostic de Vite :

ShapeDescriptionDoc
Vanilla SPAindex.html comme point d'entrée source, TypeScript/JS pur ou Web Components (Lit)architecture.md §1
Library authoringbuild.lib + vite-plugin-dts, publication npm ESM/CJSarchitecture.md §2
Multi-page app (MPA)top-level input avec plusieurs entrées HTMLarchitecture.md §3
Workers / WASMEntrées ?worker, ?worker&inline, modules WebAssemblyarchitecture.md §4

Hors scope (explicitement)

  • Intégration Vite comme dev-server pour React (@vitejs/plugin-react) → voir @.claude/references/react/
  • Intégration Vite comme dev-server pour Vue.js (@vitejs/plugin-vue) → voir @.claude/references/vuejs/
  • Intégration Vite comme dev-server pour Angular (@angular/build basé sur esbuild/Vite) → voir @.claude/references/angular/
  • Intégration Vite comme dev-server pour Svelte/SvelteKit (@sveltejs/vite-plugin-svelte) → voir @.claude/references/svelte/

Ce stack ne documente aucun modèle de composant (pas de JSX, pas de SFC, pas de runes) — uniquement la configuration de build, les entrées, les plugins et l'outillage Vite lui-même.

Points clés 2026

Vite 8 — Rolldown par défaut

Depuis Vite 8, Rolldown (port Rust de Rollup, par l'équipe Vite/VoidZero) remplace esbuild comme bundler de production par défaut. Build 3-5× plus rapide, API de configuration largement compatible avec rollupOptions historique (déprécié depuis Vite 8 au profit de rolldownOptions) — voir rolldown.md pour les différences (ex : manualChunks objet supprimé au profit de codeSplitting.groups).

Vanilla SPA — point d'entrée index.html

<!-- index.html -->
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Vite App</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>

Vite traite index.html comme un fichier source, pas un template statique : les balises <script type="module"> et les chemins relatifs sont résolus et transformés au build.

Library authoring — build.lib

// vite.config.ts
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';

export default defineConfig({
  plugins: [dts({ include: ['src'], rollupTypes: true })],
  build: {
    lib: {
      entry: 'src/index.ts',
      formats: ['es', 'cjs'],
    },
    rolldownOptions: {
      external: ['some-peer-dependency'],
    },
  },
});

Multi-page app — input (top-level)

// vite.config.ts
import { defineConfig } from 'vite';
import { resolve } from 'node:path';

export default defineConfig({
  // top-level `input` (also used by the dev server); build.rolldownOptions.input overrides it for build only
  input: {
    main: resolve(__dirname, 'index.html'),
    admin: resolve(__dirname, 'admin/index.html'),
  },
});

Workers / WASM

// Worker dédié (module worker, pattern supporté nativement par Vite)
const worker = new Worker(new URL('./worker.ts', import.meta.url), { type: 'module' });

// WASM (import direct, instancié via ?init)
import init, { compute } from './pkg/compute.wasm?init';
await init();
console.log(compute(42));

Checklist Rapide

  • Vite 8.3.x avec Rolldown (défaut) — pas de manualChunks objet
  • Project shape unique et non ambigu (vanilla SPA / library / MPA / workers-wasm)
  • TypeScript strict mode + vite-env.d.ts référencé
  • Vitest >= 80% coverage, Browser Mode pour workers/WASM
  • ESLint flat config (eslint.config.js)
  • vite-plugin-dts pour toute library — .d.ts vérifiés dans dist/
  • Aucun secret exposé via envPrefix (VITE_*)

Documentation Complète

  • architecture.md — Les 4 project shapes, arborescences ASCII
  • coding-standards.md — Conventions vite.config.ts, nommage vite-plugin-*
  • tooling.md — ESLint flat config, tsc --noEmit, scripts npm
  • quality-tools.md — CI/CD, bundle analysis, pre-commit hooks
  • testing.md — Vitest framework-agnostic (modules, plugins, workers/WASM)
  • security.md — envPrefix, define(), CSP multi-page, sandboxing WASM
  • rolldown.md — Migration esbuild → Rolldown (Vite 8)
  • project-context.md — Template de contexte projet

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.