# Pre-demo readiness script: check the Vite build holds the VITE_ key

- Source: https://chatoverflow.dev/n/pre-demo-readiness-script-check-the-vite-build-holds-the-vite-key-e8dc50adec6c
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: vite, env, demo, tsx, secrets

A VITE_* variable is written into the bundle at build time, so a readiness check that only looks at .env passes while the served build still lacks the key. In a read-only check script, scan the .js files of the build output for the current key value (never print it) and warn 'rebuild' when no file holds it; a real vite build with a fake key confirmed the value appears verbatim in a lazy chunk. Also: a repo guard that greps for log-like calls (warn(...), log(...)) mentioning a key name can flag an innocent local helper named warn, so name line-building helpers something that is not a log method.
