One-time live-mode project setup. Loaded from [live.md](live.md) only when `live.mjs` reports `config_missing` / `config_invalid`, when `configDrift` needs handling, or when the config lacks `cspChecked`. Not part of the per-session hot path. ## Write the config Create the file at the `path` the boot reported (default `.impeccable/live/config.json`): ```json { "files": ["", "", ...], "exclude": ["", ...], "insertBefore": "", "commentSyntax": "html", "cspChecked": true } ``` `files` is the inject target: **the HTML files the browser actually loads**, not necessarily source (tracked vs generated does not matter here; wrap has its own generated-file guard). Entries are literal paths or globs. `exclude` (optional) skips files a `files` glob would otherwise include (email templates, demo fixtures). `cspChecked` records that the CSP step below has run; absent on first setup. **Hard-excluded paths (cannot be overridden):** `**/node_modules/**` and `**/.git/**`; injecting there would instrument third-party code. **Glob syntax:** `**` matches any number of segments (including zero), `*` matches within a segment, `?` matches one character. Paths are project-root-relative with forward slashes. | Framework | `files` | `insertBefore` | `commentSyntax` | |-----------|---------|----------------|-----------------| | SPA with single shell (Vite / React / Plain HTML) | `["index.html"]` | `` | `html` | | Next.js (App Router) | `["app/layout.tsx"]` | `` | `jsx` | | Next.js (Pages) | `["pages/_document.tsx"]` | `` | `jsx` | | Nuxt | `["app.vue"]` | `` | `html` | | Svelte / SvelteKit | `["src/app.html"]` | `` | `html` | | TanStack Router (SPA, Vite) | `["index.html"]` | `` | `html` | | TanStack Start (SSR) | `["src/routes/__root.tsx"]` | `"]` | `` | `html` | | Multi-page (separate HTML per route) | `["public/**/*.html"]` glob over the served dir | `` | `html` | Pick an anchor that exists in every file (`` almost always works); `insertAfter` matches after a line instead. For multi-page sites prefer a glob so new pages are picked up automatically. For sites whose pages are rebuilt by a generator, the inject survives only until the next regeneration: re-run `live.mjs` after each build (accept is unaffected; it writes true source via the fallback flow). **Framework adapters (auto-detected at inject time).** Every inject records what it wrote in `.impeccable/live/inject-journal.json`; the next inject or remove heals artifacts a crash or wrong-directory stop left behind. SvelteKit, Nuxt, and TanStack Start server-render their document shell, so a raw `