Build
build compiles and copies XRF source assets into target/gamedata. Use it before linking the project into a game
installation, packaging a mod, or validating generated configs/scripts.
npm run cli -- build
What it builds
| Target | Source | Output |
|---|---|---|
scripts | src/engine/scripts | Lua .script files in target/gamedata/scripts and related output folders. |
ui | src/engine/forms plus static UI XML | UI XML under target/gamedata/configs/ui. |
configs | src/engine/configs | Static and generated config files under target/gamedata/configs. |
translations | src/engine/translations | XML string tables under target/gamedata/configs/text. |
resources | configured resource roots | Static assets copied into target/gamedata. |
The build also writes target/gamedata/metadata.json and stores a build log under target/logs.
Options
-i, --include <targets...>: build only selected targets. Choices arescripts,ui,configs,translations, andresources.-e, --exclude <targets...>: skip selected targets. This conflicts with--include.-f, --filter <targets...>: filter copied/generated files by regular-expression strings. Use it only with a specific included target, not with the defaultalltarget set.-l, --language <language>: use a locale fromcli/config.json. The default isukr.-c, --clean: removetarget/gamedatabefore building.--nl, --no-lua-logs: strip Lua logger calls from the compiled script output.--na, --no-asset-overrides: skip configured override and locale resource roots when copying resources.--itz, --inject-tracy-zones: inject Tracy profiling zones while compiling scripts.-v, --verbose: print verbose build logs.
Examples
npm run cli -- build --clean
npm run cli -- build --include scripts configs
npm run cli -- build --include configs --filter system.ltx
npm run cli -- build --exclude resources
npm run cli -- build --include scripts --no-lua-logs
Failure notes
- Unsupported locales fail before asset copying starts.
--filterwith the defaultallinclude set fails; choose a concrete target first.- TypeScriptToLua diagnostics fail the script build. Run
npm run typecheckfor a focused error list.