Routing by Name
Route a file or folder without moving it into a routing folder
Updated
When a feature is too small for routing folders, route by name instead.
The @ Suffix
@ and a route key at the end of a file or folder name route it, and come off the name. A file keeps its class, so TradeService@Server.luau stays a ModuleScript:
- src
- Trade
- Admin@Server
- Ban.luau
- TradeService@Server.luau
- TradeTypes@Shared.luau
- TradeUi@Client.luau
- ReplicatedStorage
- Shared
- Trade
- TradeTypes
- ServerScriptService
- Trade
- Admin
- Ban
- TradeService
- StarterPlayer
- StarterPlayerScripts
- Trade
- TradeUi
Marker Files
An empty file named @Server routes the folder it's in, and the folder keeps its name:
- src
- Anticheat
- @Server
- Check.luau
- Report.luau
- ServerScriptService
- Anticheat
- Check
- Report
Rojo's Script Suffixes
When your config has a Server or Client key, Rojo's .server and .client suffixes route a script as well as set its class, so Main.server.luau goes to the server. A sync rule's suffix routes another language's scripts the same way, such as .server.lang.
Init Scripts
A route in an init script's name places only the script, not the folder around it; to move the whole folder, route the folder itself. That lets each side have its own init script:
- src
- Shop
- init@Server.luau
- init@Client.luau
- ShopService@Server.luau
- ShopUi@Client.luau
- ServerScriptService
- Shop
- ShopService
- StarterPlayer
- StarterPlayerScripts
- Shop
- ShopUi
A plain init.luau routes the same way: it is its folder only where its own route puts it, which is * unless something routes it. On every other side the folder's files sit in a plain folder of the same name, so the init script reaches a server-only child by its full path, as ServerScriptService.Shop.ShopService, rather than through script.