Rogen

How Routing Works

Name a folder or file after a route, and Rogen puts it where the route points

Updated

Your config's routes name the places your code can go in the game:

default.rogen.json
{
	"routes": {
		"Server": "ServerScriptService",
		"Client": "StarterPlayer/StarterPlayerScripts",
		"Shared": "ReplicatedStorage/Shared",
		"*": "ReplicatedStorage/Shared"
	}
}

A route's name in a file's path sends the file there. A Server/ folder sends everything inside it, and @Client at the end of a name sends one file:

src/On disk
  • Shop/
  • Server/
  • ShopService.luau
  • Shared/
  • Prices.luau
  • ShopUi@Client.luau
ExplorerRoblox Studio
  • ReplicatedStorage
  • Shared
  • Shop
  • Prices
  • ServerScriptService
  • Shop
  • ShopService
  • StarterPlayer
  • StarterPlayerScripts
  • Shop
  • ShopUi

Everything else in the path stays, so Shop shows up under each service. Routing Folders and Routing by Name show each way to route in full, and Skipping Folders how to leave a folder out.

The Outermost Route Wins

A route inside another route is an ordinary folder. Server code under Shared/ ships to every client, and Rogen warns about it:

src/On disk
  • Shared/
  • Server/
  • Datastore.luau
ExplorerRoblox Studio
  • ReplicatedStorage
  • Shared
  • Server
  • Datastore

Files Without a Route

The * route takes every file that no other route matches, so src/Shop/Prices.luau lands in ReplicatedStorage/Shared/Shop. rogen init writes it. Without *, Rogen leaves such a file out and warns about it, so a server file that forgets its route never reaches clients. That suits a project where every file names its side.

Check Where a File Lands

$ rogen where src/Shop/Server/ShopService.luau
src/Shop/Server/ShopService.luau -> ServerScriptService/Shop/ShopService · route Server (folder)
  require(game:GetService("ServerScriptService").Shop.ShopService)

On this page