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

Building

Build XRF into target/gamedata before testing, linking, or packaging.

npm run build
npm run cli -- build

Targets

build runs every target by default:

  • scripts
  • externs
  • ui
  • configs
  • translations
  • resources

By default, build runs all targets. Use --include for focused builds and --exclude to skip targets:

npm run cli -- build --include scripts configs
npm run cli -- build --include externs
npm run cli -- build --exclude resources

Options

  • -i, --include <targets...>: build only selected targets.
  • -e, --exclude <targets...>: build all targets except selected targets.
  • -v, --verbose: print verbose build logs.
  • -l, --language <language>: build with a locale from cli/config.json.
  • -f, --filter <patterns...>: regular-expression filters for source paths.
  • -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.
  • --itz, --inject-tracy-zones: inject Tracy profiling zones into compiled scripts.

--filter requires an explicit --include; it cannot be used with the default all-target build.

What a full build does

When all targets run, the build performs these steps:

  1. optionally clean target/gamedata;
  2. compile TypeScript scripts to Lua;
  3. generate the extern manifest and copy it to target/gamedata/extern.json;
  4. render dynamic UI forms and copy static UI XML;
  5. render dynamic configs and copy static LTX/XML configs;
  6. build translations;
  7. copy static resources;
  8. write metadata.json;
  9. collect the build log.

Examples

npm run cli -- build
npm run cli -- build --clean
npm run cli -- build --include ui
npm run cli -- build --include externs
npm run cli -- build --include configs --filter system.ltx
npm run cli -- build --exclude resources
npm run cli -- build --no-lua-logs --inject-tracy-zones

Output

The command writes target/gamedata, target/gamedata/metadata.json, target/gamedata/extern.json, and target/xrf_build.log. Change source files and rebuild rather than editing generated output.