Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

TargetSourceOutput
scriptssrc/engine/scriptsLua .script files in target/gamedata/scripts and related output folders.
uisrc/engine/forms plus static UI XMLUI XML under target/gamedata/configs/ui.
configssrc/engine/configsStatic and generated config files under target/gamedata/configs.
translationssrc/engine/translationsXML string tables under target/gamedata/configs/text.
resourcesconfigured resource rootsStatic 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 are scripts, ui, configs, translations, and resources.
  • -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 default all target set.
  • -l, --language <language>: use a locale from cli/config.json. The default is ukr.
  • -c, --clean: remove target/gamedata before 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.
  • --filter with the default all include set fails; choose a concrete target first.
  • TypeScriptToLua diagnostics fail the script build. Run npm run typecheck for a focused error list.