From b86bda15e5400891ed29fd65f2863c17ee5b7dee Mon Sep 17 00:00:00 2001 From: nx-thaddeusaid Date: Sun, 17 May 2026 21:24:13 -0700 Subject: [PATCH] build(vite): pin entry script to assets/app.js for stable wrapper-template reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The roguewar.org server template that produces /warmap currently hardcodes or auto-extracts one script tag from dist/index.html and gets the wrong file: it loads /warmap/assets/vendor-ui-.js (the react-select + lucide-react chunk) instead of the actual entry. Without the entry, React never mounts and the page renders only the dark body background. Pinning the entry to assets/app.js gives the wrapper template a single stable URL that does not change across builds. Vendor chunks and CSS keep their content-hashed names — they are loaded by the entry via dynamic imports and the modulepreload links Vite emits, not by the wrapper. The deploy server should cache app.js with a short max-age (or no-cache) since its URL no longer cache-busts; everything it imports is still content-hashed and can be cached aggressively. Co-Authored-By: Claude Opus 4.7 --- vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 6b2bd9e..2789d8b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,6 +19,13 @@ export default defineConfig(({ mode }) => { chunkSizeWarningLimit: 700, rollupOptions: { output: { + // Pin the entry filename so the roguewar.org wrapper template can + // hardcode a single stable URL (/warmap/assets/app.js). Vendor + // chunks and CSS keep their content-hash for cache-busting; they + // are loaded by the entry, not by the wrapper template. The server + // should serve app.js with a short/no-cache header so deploys take + // effect promptly. + entryFileNames: 'assets/app.js', manualChunks(id) { if (id.includes('/konva') || id.includes('/react-konva')) { return 'vendor-konva';