Vite advanced config
Use when auditing React Vite configurations for conservative static signals, development-server security, and Vite 7/Rollup versus Vite 8/Rolldown compatibility.From its SKILL.md
npx -y skills add dgabreuu/react-skill-pack --skill vite-advanced-configAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.5 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Vite Configuration for React
Purpose
This skill performs reproducible triage of a React project's vite.config.js, .ts, .mjs, or .mts. It looks for explicitly risky options or settings that deserve measurement; it does not turn healthy Vite defaults into “problems.” The report is advisory: only a real build and loading profile can confirm a performance gain.
Primary compatibility: Node 22.13+, Vite 8, and current React. The guidance also applies to Vite 7 (Rollup) and React 18 projects; when the version cannot be determined, the script does not assume a migration.
Memory and patterns
Read the local MEMORY.md and follow ../.shared/SKILL-MEMORY-PROTOCOL.md; use node "<skills-root>/.shared/src/memory-cli.js" append ... for actionable results. The utility validates, renumbers, and retains up to 12 entries.
Before making decisions influenced by existing code, follow ../.shared/PATTERN-LEARNING-PROTOCOL.md and query the repository catalog with node "<skills-root>/.shared/src/pattern-learning/pattern-cli.js" query ...; after confirming a new or refined pattern in the code, consolidate it with node "<skills-root>/.shared/src/pattern-learning/pattern-cli.js" upsert ....
When to use
- Review
build,server, andoptimizeDepsbefore an infrastructure change. - Investigate published source maps, exposed development hosts, or redundant pre-bundling.
- Plan migration of
build.rollupOptionsormanualChunksfrom Vite 7 to Vite 8 and Rolldown. - Compare a minifier, chunk splitting, or target using a reproducible production artifact.
When not to use
- The bottleneck is a re-render or React component; use the component, memoization, or state skills.
- The project does not use Vite.
- The question requires concluding that one option is faster without a build and comparable metrics.
Recommended workflow
- Record the commit, Node and Vite versions, target browser, and build command.
- Run the auditor in JSON mode with
--dry-run. - Review each finding against mode-specific configuration (development or production) and network context.
- Make one change at a time. Build the same fixture with cold and warm caches for at least three repetitions.
- Compare median time, raw, gzip, and Brotli bytes, and the initial browser flow. Record failures and variance as well; a structural or readability change without a measurable difference is not a performance gain.
node "<skill-dir>/scripts/audit-vite-config.js" ./app --format json --dry-run
node "<skill-dir>/scripts/audit-vite-config.js" ./app --output validation-results/vite --force
--output writes both Markdown and JSON, and the JSON contains schemaVersion: 1. All other output behavior follows the shared CLI contract in ../.shared/README.md.
What the auditor reports
- Static
build.sourcemap: true: confirm whether the map belongs in the production artifact and whether publishing sources is acceptable. build.minify: "terser": an informational signal to measure build cost and size against the version's default minifier (esbuild in Vite 7, Oxc in Vite 8); terser is not automatically better.server.allowedHosts: trueor['*']: exposure risk; prefer explicit hosts.server.host: true,0.0.0.0, or::: the server is reachable through every interface; combine deliberate exposure with an allowlist.optimizeDeps.includecontainingreactorreact-dom: usually redundant; retain it only for a reproducible discovery error.build.rollupOptionswhenpackage.jsondeclares Vite 8 or later: a Rolldown compatibility signal. Rollup remains valid in Vite 7 and is not reported.
The auditor does not report the absence of minify, sourcemap, manualChunks, optimizeDeps, cssCodeSplit, or treeshake: those defaults are valid, and manual code splitting can worsen caching and loading. It also does not assume that a resolve.extensions list or plugin is required.
Vite 7/Rollup and Vite 8/Rolldown
Read the declared vite version before changing APIs. Keep rollupOptions in Vite 7 when the result is measured. In Vite 8, treat the finding as a planned migration: validate bundle equivalence and only then adopt Rolldown options supported by the installed version. Do not remove server.host or server.allowedHosts during this migration.
Known limitations
- Analysis is static and deliberately conservative: spreads, imports, and values calculated outside the file produce an informational signal or require manual review.
- The script does not execute the configuration, know which
modewill be used, or measure chunks. Conditional values are not classified as static risks. - Bundle size, TTFB, LCP, parse and execution time, and request count must be collected through the build or browser; the scanner promises no gain percentage.
Files
scripts/audit-vite-config.js: CLI and TypeScript AST analysis.config/vite.config.recommended.js: small, safe baseline without assumedmanualChunks.examples/before/andexamples/after/: teaching fixture; the “after” example is not a universal recipe.checklists/vite-checklist.md: manual review and measurement protocol.
Constraints
- Do not add dependencies to the audited project.
- Do not publish source maps, expose hosts, or add manual chunks without justification and measurement.
- Preserve deliberate security configuration and record environment limitations.
What ships with it: 7 files
22.4 KB alongside SKILL.md, 5 of them executable
checklists/
- vite-checklist.md2.6 KB
config/
- vite.config.recommended.jsruns562 B
examples/
- after/vite.config.jsruns415 B
- before/vite.config.jsruns769 B
scripts/
- audit-vite-config.jsruns12.7 KB
tests/
- audit-vite-config.test.jsruns5.3 KB
- MEMORY.md135 B