The role of roblox-ts is to turn TypeScript (
.ts) files into Luau files (
.lua). That alone isn't very useful! You need to move the files into Roblox Studio to be able to use them for a game, plugin, model, etc.
To do this, you can use Rojo!
Rojo takes files from your local filesystem and will either:
- turn them into a single Roblox file (
- sync them into an open Roblox Studio session via
Rojo uses a
default.project.json file to describe how files should be organized within a Roblox file.
default.project.json file should have all
"$path" fields relative to your
outDir (which is the
"out" folder by default).
The workflow should look like this:
.ts files in
.lua files in
rojo build or
Roblox Studio 🎉
roblox-ts will use your
project.json file to understand how TypeScript (
.ts) files eventually end up inside of Roblox Studio. This is primarily used for compiling import statements.
To use a different
project.json file instead of
default.project.json for compiling, you can use the
Like any other Rojo project, you can organize a roblox-ts project however you'd like with a few restrictions:
node_modulesfolder must be in a place that is visible to both the client and server
"$path"fields should be relative to your
outDir(which is the
"out"folder by default)
By default, the
default.project.json file should look something like this (truncated):
Suppose you wanted to add scripts to
To do this, we'll need to add a folder to
src (so that when we compile it will have a matching folder in
out). We'll call this
Then, we need to update our