build: a phone-sized bundle carrying one campaign

The static build ships every edition, and v0.5 alone is a 9.2 MB module holding
a thousand levels — fine over localhost, not over a phone connection. This
rewrites the campaign registry to name a single edition, then follows the import
graph from src/app.js, so the editions nobody asked for are never reached. 22
modules, 645 KB of code.

Art is the part an import graph cannot find: the tile sheet and icon sheet are
loaded by code, the background, tray and fonts by stylesheets. Both sources are
scanned and anything named but missing aborts the build, because a missing tile
sheet degrades to the fallback renderer and looks like a design choice rather
than a broken build. That is how the first bundle shipped: playable, with every
icon gone and "棋子图片加载失败" in the toast.

Stylesheets under design/ reach the art with ../assets/, which climbs out of a
bundle once inlined into a page at the root, so they are rewritten before they
are scanned — what gets collected is what the page will actually request.

--standalone emits a complete HTML document for an ordinary static host;
the default emits body content only, for hosts that supply the skeleton.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
cabinw
2026-09-14 18:32:03 +08:00
co-authored by Claude Opus 5
parent 6f3dddbeee
commit 2c01b613bd
2 changed files with 116 additions and 0 deletions
+3
View File
@@ -11,3 +11,6 @@ bench/report.json
bench/hex-bench/
bench/hex-bench.zip
bench/pack/
# Phone bundle: regenerated by scripts/build-phone.mjs
/build/