@zeffuro/zerith-player
v0.1.0
Published
Static web player and export CLI for Zerith visual novel projects.
Readme
@zeffuro/zerith-player
Static web player and export CLI for Zerith visual novel projects.
Commands
npx @zeffuro/zerith-player --game=. --outDir=dist/game --base=./: build the current game folder as a static site.npx @zeffuro/zerith-player --game=. --outDir=dist/game --zip --zipFile=dist/game.zip: build and create an uploadable zip.npm run dev:playerfrom repo root: launches the player againstgames/classic-vn-starter.npm run build:game -- --game=games/classic-vn-starter: builds a distributable todist/<game-name>.
How it works
scripts/build-game.mjsresolves the game folder and validates thatgame.jsonexists.- The script passes
ZERITH_GAME_DIR,ZERITH_OUT_DIR, andZERITH_BASEinto Vite. vite.config.tsuses those env vars to setpublicDir(game files),build.outDir, and deploybase.- Production build base defaults to
./to keep generated asset URLs portable on itch and subpath hosting. Dev server still uses/. src/main.tsandsrc/runtime/bootstrapPlayer.tsresolve runtime URLs using Vite base, which keeps builds portable under itch subpaths.
Editor export
- The editor
File > Export Game...menu opens an in-editor dialog with target, base, output, and zip options. - Itch preset in the dialog enforces
base=./and enables zip for HTML5 upload compatibility. - Export logs are written to the Console panel so you can inspect build output without leaving the editor.
- Export actions call the same
build:gamepipeline used by the CLI, so output behavior stays consistent.
