Skip to content

Factorio.toml

Factorio.toml sits next to Cargo.toml in the project root.

Key Default Description
source "src" Root of Rust sources to transpile
output_dir "dist" Mod output directory (wiped each build)

Written into info.json (and related packaging):

Key Description
title Display title
description Optional description
factorio_version Factorio version string (default "2.0"); also used for a base dependency
thumbnail Optional path to an image copied to thumbnail.png in the mod output

Mod name / zip id still come from Cargo [package].name and version.

Factorio’s mod portal expects thumbnail.png in the mod root (commonly 144×144). By default, if thumbnail.png exists in the project root it is copied into dist/ on build. Override the source path with:

[mod]
thumbnail = "assets/thumbnail.png"

If thumbnail is set and the file is missing, the build fails.

Key Description
lua_module_prefix Prefix applied to the last segment of Lua module paths (e.g. "msr" -> msr_control.lua)
Key Description
debug_level Lua debug comment level
prune_dead_code Whether to prune unreachable IR

See Profiles.

source = "src"
output_dir = "dist"
[mod]
title = "My Mod"
description = "Does things"
factorio_version = "2.0"
thumbnail = "thumbnail.png"
[emit]
lua_module_prefix = "mm"
[profiles.debug]
debug_level = 2
prune_dead_code = false
[profiles.release]
debug_level = 0
prune_dead_code = true