Build options

Everything zig build accepts and produces in a Verve project.

Options

FlagEffect
-Dpublic-dir=<path>embed a static-asset directory, served at /public/*
-Di18n-dir=<path><locale>.json catalogs (default i18n/; missing dir → empty catalog)
-Di18n-default=<tag>default locale for the lazy catalog
-Dverve-path=<path>default checkout path baked into verve-cli for scaffolds
-Dgtk4=trueLinux: GTK4/WebKitGTK-6 backend instead of GTK3

Steps

zig build              # everything: server, wasm client, island chunks, CLI
zig build run          # build + start the dev server on :8080
zig build docs         # Zig autodoc for the verve module
zig build win-native   # Windows WebView2 host smoke build

The server binary accepts --host and --port flags at run time.

Asset embedding

With -Dpublic-dir=public, every file under public/ is embedded with a content-type guess and a Wyhash digest:

  • served at /public/<name> and /public/<stem>-<hash><ext>
  • ctx.assetHref("site.css") resolves to the hashed URL → far-future cacheable, busts on content change
  • no resolver wired (tests, missing manifest) → falls back to the unhashed path

What a build produces

ArtifactNotes
zig-out/bin/verve-servernative server, all assets + wasm embedded — single-file deploy
zig-out/bin/verve-cliproject scaffolder
client.wasmmain hydration runtime (wasm32-freestanding, ReleaseSmall)
island_<name>.wasmone chunk per island registry entry
verve.jsthe bridge — served at /verve.js

WASM specifics worth knowing

  • Island chunks get a 4 KB stack — keep buffers in globals or the chunk arena, not stack frames.
  • The main client imports its function table from JS; island chunks use private tables — the bridge translates function-pointer indices across, so chunks can't accidentally call through each other's tables.
  • Chunks share the main client's linear memory; stateful chunks link data at 0x1000 — hence one stateful chunk per page.

Next: Tooling & codegen.