Building
The build command compiles and copies XRF source files into X-Ray-compatible gamedata output under target/gamedata.
npm run build
npm run cli -- build
Build Targets
The build target names are:
scriptsuiconfigstranslationsresources
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 --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 fromcli/config.json.-f, --filter <targets...>: filter source files by regular-expression strings.-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.--itz, --inject-tracy-zones: inject Tracy profiling zones into compiled scripts.
Filters must be used with an explicit --include target. The build command rejects filtered implicit all builds.
Build Steps
When all targets run, the build performs these steps:
- optionally clean
target/gamedata; - compile TypeScript scripts to Lua;
- render dynamic UI forms and copy static UI XML;
- render dynamic configs and copy static LTX/XML configs;
- build translations;
- copy static resources;
- write
metadata.json; - 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 configs --filter system.ltx
npm run cli -- build --exclude resources
npm run cli -- build --no-lua-logs --inject-tracy-zones
Output
The command writes generated gamedata to target/gamedata and collects a build log in target/xrf_build.log.
Do not edit target/gamedata by hand. Change the source file and rebuild.