The SPA fallback must load the hashed assets of the build that is actually
published, so it cannot be a frozen copy of an index document. The new
scripts/generate-404.mjs writes dist/404.html from the built dist/index.html
and runs last in the build, after vite build has copied publicDir.
The generator resolves the dist directory from its own location, so it
behaves the same from the repository root and from public/, where npm runs
it. It refuses to write a fallback that has no app mount point or that
references files missing from the build output, so a broken build fails
loudly instead of shipping a blank page.
The two frozen copies (public/404.html, public/public/404.html) are
removed; dist/404.html is a generated artefact with no committed source
copy.
Two plain-Node check scripts, no new runtime dependency, that enforce the
BEAT design rules and the copy discipline mechanically. Both exit non-zero
when they find something and print file, line and column for every hit.
scripts/check-design-rules.mjs covers README.md and public/src: no emoji
characters, no gradient utilities or gradient declarations, no inline style
attributes, no <style> blocks in Vue components, and no icon markup other
than FontAwesome components or classes.
scripts/check-banned-terms.mjs reads the banned-term list from
scripts/banned-terms.txt, so the list can be tuned without touching the
script. It scans the site copy (string literals, template text and
user-visible attributes) and the README headings.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>