Rogen
Core Concepts

Routing Rules

How Rogen routes files by folder name, file name and marker file

Updated

Rogen looks at names to decide which Roblox service each file goes to, such as ServerScriptService or StarterPlayerScripts. You can route code in three ways: with folder names, file names or marker files.

Folder Names

Name a folder after a routing keyword (server, client, shared) or a Roblox service, and everything inside it goes there.

  • A folder named client sends its files to StarterPlayerScripts.
  • A folder named ReplicatedFirst sends its files to that service.

The folder itself disappears from the path, but its contents stay.

File Names (Affixes)

To send a single file somewhere other than its folder, add a keyword to the start or end of its name:

  • CombatClient.luau goes to StarterPlayerScripts.
  • Combat_Server.luau goes to ServerScriptService.
  • Combat-ReplicatedFirst.ts goes to ReplicatedFirst.

Separate the keyword with ., -, _ or +, or attach it in camelCase or PascalCase. Rogen strips it from the script's name.

Marker Files

Put an empty file named after a keyword, like .server or .client, in a folder to route the whole folder there. Unlike with a routing folder, the folder keeps its name in the final tree.

The Deepest Rule Wins

When several rules apply to one path, the deepest one wins. Since a file name is always the deepest part of a path, routing by file name always beats routing by folder.

Default Fallback

If no rule applies anywhere in a file's path, it goes to ReplicatedStorage.

On this page