Compile all worker executables from source and write them to .zonai/executables/. Also regenerates
.dart_tool/zonai/project_main.dart. Does not create a deployment bundle (use zonai build
for that).
zonai compile [flags]
Flags#
| Flag | Description |
|---|---|
--flavor <name> | Config flavor to compile with |
--release | Compile without Dart asserts |
-c, --config <path> | Path to a custom zonai.yaml |
Workers Compiled#
db_config— config workerdb_rules— rules worker (also linked in-process by the project binary)db_operations— operations worker (also linked in-process by the project binary)db_extensions— extensions workerdb_rate_limit— rate limit workerdb_crons— crons worker
When to Use Manually#
In dev mode (zonai serve), Zonai watches source files and recompiles workers automatically — manual
compile is rarely needed during development. Use it for:
- Setting up a fresh clone before starting the server
- Verifying compilation succeeds in CI
- Updating compiled binaries after discarding changes that left executables stale
- Preparing workers before running
zonai ruleswithout starting the server
vs. zonai build#
-
zonai compile— workers only, to.zonai/executables/. Use during development. -
zonai build— workers + project-linkedbuild/zonai+ migrations/settings. Use for deployment.
