Skip to content

Build output

KILLSCRIPT loads a module folder or a packaged .KillScript file. It does not load the TypeScript project itself. The CLI therefore produces two forms from the same source:

  • a folder build for installation and hot reload;
  • a packaged build for distribution.

The compiler writes .killscript/build/<ModuleName>/:

ModuleName/
├── module.json
├── config.json
├── inputs.json
├── scripts/
│ ├── main.lua
│ └── server.lua # Reflex modules only
├── images/ # When present in public/
├── sounds/
├── ui/
└── localization.csv
PathSource
module.jsonProject metadata from killscript.config.json
config.jsonTop-level defineSettings() declarations
inputs.jsonTop-level defineControls() declarations
scripts/main.luaEverything reachable from src/client/main.ts
scripts/server.luaEverything reachable from src/server/main.ts
Other filesCopied from public/ with their relative paths

Nested TypeScript files are statically bundled into the two entry scripts. They do not become runtime require() files, which avoids the game’s limited module-path lookup.

killscript install or killscript dev synchronizes the folder build to:

<game Modules>/<ModuleName>/

The installed folder keeps the project’s module UUID and an ownership marker. The CLI only updates a missing folder, its own managed folder, or a folder with the same UUID. It will not silently overwrite another module.

Development uses the folder form so a save can update only changed files. No .KillScript import is required after every change.

Terminal window
npm run build

creates:

dist/ModuleName.KillScript

The file is an archive of the same internal folder structure, not a standalone text script. Distribute this file to users; keep the TypeScript project and .killscript/ build directory out of the package.

Use killscript build --no-pack when another tool needs only the generated folder.