Rojo uses a set of rules to decide which Roblox instance type to create from each file on disk. When you runDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rojo-rbx/rojo/llms.txt
Use this file to discover all available pages before exploring further.
rojo serve or rojo build, every file in your project’s tree is matched against these rules in order, and the first match determines how the file is converted.
Default sync rules
The table below lists all built-in rules. Rules are matched top-to-bottom; more specific patterns (like*.server.lua) appear before broader ones (like *.lua) to ensure they take priority.
| File pattern | Roblox instance | Notes |
|---|---|---|
*.server.lua / *.server.luau | Script (ServerScript) | Server-side scripts |
*.client.lua / *.client.luau | LocalScript (ClientScript) | Client-side scripts |
*.plugin.lua / *.plugin.luau | PluginScript | Studio plugin scripts |
*.lua / *.luau | ModuleScript | Shared modules |
*.project.json / *.project.jsonc | Nested project | Embeds another Rojo project |
*.model.json / *.model.jsonc | JSON model | Roblox instance tree encoded as JSON |
*.json (not *.meta.json) | ModuleScript | JSON parsed to a Lua table returned by require() |
*.jsonc (not *.meta.jsonc) | ModuleScript | Same as above with comment support |
*.toml | ModuleScript | TOML parsed to a Lua table returned by require() |
*.csv | LocalizationTable | Localization data |
*.txt | StringValue | Plain text string value |
*.rbxmx | Roblox XML model | Roblox XML model file |
*.rbxm | Roblox binary model | Roblox binary model file |
*.yml / *.yaml | ModuleScript | YAML parsed to a Lua table returned by require() |
*.meta.json and *.meta.jsonc files are reserved for Rojo metadata. They are not turned into instances. See the meta files reference for details.How instance names are derived
For most files, Rojo strips the full suffix defined by the rule to produce the instance name. For example,PlayerController.server.luau becomes a Script named PlayerController. For plain *.lua / *.luau files, only the extension is stripped: Utils.luau becomes a ModuleScript named Utils.
Init files and directory promotion
When a directory contains a file namedinit.lua, init.luau, init.server.lua, init.server.luau, init.client.lua, init.client.luau, or init.csv, the directory itself becomes that instance type instead of becoming a Folder. All other files inside the directory become children of that instance.
This is the standard pattern for scripts that also need child instances.
default.project.json/default.project.jsonc— makes the directory a nested projectinit.luau/init.lua—ModuleScriptinit.server.luau/init.server.lua—Scriptinit.client.luau/init.client.lua—LocalScriptinit.csv—LocalizationTable
Folder.
Custom sync rules
You can add entries to thesyncRules field in your project file to handle file patterns that Rojo does not recognize by default, or to override the default behavior for a specific extension.
Each rule has three fields:
A glob pattern relative to the project file’s directory. Matched against file paths.
The middleware to use when the pattern matches. Must be one of the camelCase middleware names from the table below.
The suffix to strip from the file name to produce the instance name. If omitted, only the file extension is stripped.
Available middleware names
use value | Produces |
|---|---|
serverScript | Script (ServerScript) |
clientScript | LocalScript (ClientScript) |
moduleScript | ModuleScript |
pluginScript | PluginScript |
project | Nested project |
jsonModel | JSON model |
json | StringValue |
toml | StringValue |
csv | LocalizationTable |
text | StringValue |
rbxmx | Roblox XML model |
rbxm | Roblox binary model |
yaml | StringValue |
ignore | (ignored, no instance created) |
Example: custom rule for data files
default.project.json
PlayerData.data.json becomes a StringValue named PlayerData, and any *.spec.luau file is silently skipped.
Custom rules defined in
syncRules take priority over the default rules. If a file matches a custom rule, the default rules are not checked.Middleware and the emitLegacyScripts flag
By default (emitLegacyScripts: true), *.server.lua / *.server.luau files produce a Script and *.client.lua / *.client.luau produce a LocalScript — the classic Roblox class types. Setting emitLegacyScripts: false switches to the newer behavior where both produce a Script instance with the RunContext property set to Server or Client respectively. See Configuring your project file for details.