Skip to content

tsconfig rbxts

Build options can live under the top-level "rbxts" key of tsconfig.json instead of the command line. The merge order is defaults, then rbxts, then command-line flags.

The rbxts values merge through the extends chain from parent to child. Path values resolve relative to the file that declares them. Command-line values override tsconfig values. Sloptor warns about command-line-only values such as watch, verbose, and usePolling under rbxts and ignores them.

nativeTypes and the experimental luauTypes also read the top-level key of the same name in rotor.toml. A declared tsconfig value takes precedence, even an explicit false. Otherwise the rotor.toml value applies, and both unset means off. luauTypes also has a command-line flag, --luauTypes, which overrides both files.

Enable compilerOptions.sourceMap to write a .luau.map beside each Luau output:

{
"compilerOptions": {
"sourceMap": true
}
}

Source maps provide an anchor at generated column 0 on each mapped Luau line. They also mark where expressions and object fields begin, and where source operators start. Arithmetic, comparison, concatenation, logical, compound assignment, and optional chain operators point to their TypeScript tokens, including tokens on continuation lines. Generated and original columns use UTF-16 code units.

Binding names in declarations and parameters, punctuation, and synthesized literals don't get segments of their own. Compiler headers stay unmapped, and the maps have no names field. The compiler collects expression origins only with source maps on.

The rotor.toml schema and the tsconfig rbxts schema are separate documents. Publish the rbxts one where your editors can read it:

Terminal window
sloptor schema --rbxts > rbxts-tsconfig.schema.json

Then point tsconfig.json at it:

{
"$schema": "./rbxts-tsconfig.schema.json",
"rbxts": {
"type": "game",
"optimizedLoops": true
}
}

The site build generates this page from rbxts-tsconfig.schema.json.

rbxts

roblox-ts compiler options. CLI flags override these at runtime.

KeyTypeDescription
allowCommentDirectivesbooleanAllow TypeScript comment directives such as @ts-ignore.
includePathstringPath to where the runtime library files should be stored. Resolved relative to this tsconfig.json.
logTruthyChangesbooleanLog changes to truthiness evaluation from Lua truthiness rules.
luaubooleanEmit files with .luau extension.
luauTypesbooleanExperimental. Emit full Luau type annotations (parameters, returns, locals, class fields, exported type aliases) in compiled output so Luau code can consume it with real types. Off by default; rotor.toml's luauTypes is the fallback when this is not set. Output may change between releases.
nativeTypesbooleanEmit Luau parameter and return annotations for files whose leading comments include //!native. Off by default; rotor.toml's nativeTypes is the fallback when this is not set.
noIncludebooleanDo not copy include files.
optimizedArrayAppendsbooleanReplace eligible Array.push calls in loops with indexed writes.
optimizedLoopsbooleanEnable numeric-for loop optimization.
rojostringPath to the Rojo configuration file. Resolved relative to this tsconfig.json. If omitted, roblox-ts auto-detects a *.project.json in the project root.
type"game" | "model" | "package"Override project type.