Rogen
Guides

Multi-Place

Share code across several places in one repo

Updated

Give each place its own config that combines the shared code with that place's own folder.

Structure the Repository

Keep shared code and each place's code in separate folders:

File System
src
core
lobby
match

Configure the Lobby Place

Create a config for the lobby, and list both folders in source:

lobby.rogen.json
{
	"source": ["core", "lobby"],
	"luau": {
		"output": "lobby.project.json",
		"build": "src"
	},
	"project": {
		"name": "lobby",
		"tree": {
			"$className": "DataModel"
		}
	}
}

Rogen reads every folder you list and merges them into one tree.

Configure the Match Place

Then do the same for the match:

match.rogen.json
{
	"source": ["core", "match"],
	"luau": {
		"output": "match.project.json",
		"build": "src"
	},
	"project": {
		"name": "match",
		"tree": {
			"$className": "DataModel"
		}
	}
}

Start Watching

Choose which config to build with -c or --config:

rogen watch --config lobby.rogen.json

If two folders have a file at the same path, the one listed last in source wins.

On this page