Configuration
A configuration file, zune.toml
, is used to configure the zune runtime for the workspace.
This is where you could disable features, set compiler flags, and configure the runtime, change output, change formatting, and more.
Behavior changes here would also apply to a bundled zune application once it is built. It would not change the bundled application after it is already built.
Example
[workspace]
cwd = "."
run_path = "cmds"
[workspace.scripts]
main = "cmds/main.luau"
[runtime.debug]
detailed_error = true
[runtime.luau.options]
debug_level = 2
optimization_level = 1
native_code_gen = true
[resolvers.formatter]
max_depth = 4
use_color = true
table_address = true
recursive_table = false
buffer_max_display = 48
[runtime.luau.fflags]
DebugCodegenOptSize = false
[features.builtin]
ffi = false
Settings
workspace.cwd
Defines the current working directory of the workspace.
- Example:
cwd = "src"
workspace.run_path
Defines where the zune run
command should look for scripts.
- Example:
run_path = "cmds"
workspace.test_path
Defines where the zune test
command should look for scripts.
- Example:
test_path = "tests"
workspace.scripts
Defines shortname for scripts in the cwd workspace.
- Any script defined here can be run with
zune run <script_name>
orzune test <script_name>
. <script_name> = <path>
<script_name>
must be a valid identifier.<path>
must be a string and only works relative to the workspace defined cwd, absolute paths also works.
- Example:
main = "cmds/main.luau"
- Example:
test = "tests/test.luau"
runtime.debug
Modify the debug settings of the runtime.
detailed_error: boolean
- Show detailed error messages.
Preview
[string "example_file.luau"]:2: Oops
[C] function error
[string "example_file.luau"]:2
[string "example_file.luau"]:4
Enabled
error: Oops
example_file.luau:2
|
2 | error("Oops")
| ^^^^^^^^^^^^^
example_file.luau:4
|
4 | main()
| ^^^^^^
runtime.luau.options
Modify the compiler settings, applies to every loaded luau code in zune.
debug_level: number
- Debug level for the compiler.optimization_level: number
- Optimization level for the compiler.native_code_gen: boolean
- Enable native code generation.
resolvers.formatter
Modify the output of the print
/stdio.format
function.
max_depth: number
- Maximum depth to display tables.use_color: boolean
- Use color in output.table_address: boolean
- Show table address in output.recursive_table: boolean
- Show recursive tables in output.buffer_max_display: number
- Maximum amount of data to display previewing buffers.
runtime.luau.fflags
Modify the flags of the Luau compiler or runtime.
Use the zune luau list-fflags
command to list fflags with default values, flags without a default value would not be shown but hidden flags could still be modified.
features.builtin
Enable/disable built-in features.
- All of zune’s api can be disabled or enabled.
Environment Variables
Environment variables can also be used to configure the zune runtime.
NO_COLOR
- Disable color in output, overridesresolvers.formatters.use_color
inzune.toml
.