Configuration
Explore every configuration option for the @whitigol/fivem-compiler, including watch paths, output settings, minification, obfuscation, and more.
Overview
The wfm.config.ts file powers your FiveM build pipeline. This page explains every available option in detail, with examples and usage tips to help you configure your script with confidence.
You can generate a config file automatically when bootstrapping your project with create-fivem.
Default Configuration
Click below to view the full default config file:
Runtime Helpers
isDev
You can dynamically modify settings based on the current environment using the isDev helper:
Configuration Reference
Each field below is optional and overrideable. The compiler merges your config with sensible defaults.
watch
Defines which files should be watched during development.
watch: {
server: ["src/server/**/*.{lua,ts,js}"],
client: ["src/client/**/*.{lua,ts,js}"],
all: ["src/data/**/*", "src/stream/**/*"],
}server– Watch files that only affect the serverclient– Watch files that only affect the clientall– Watch shared assets or additional folders
Use flags like --skip-client or --skip-server to narrow down builds.
copy
Specifies files and folders to move from your source tree to the final build.
copy: [
{
from: "src/stream/**/*",
to: "stream",
},
{
from: "src/data/**/*",
to: "data",
},
];from– A relative glob path from the root of your projectto– Destination path within the final resource (no leading/!)
You can also rename single files:
copy: [
{
from: "src/special/index.html",
to: "ui/index.prod.html",
},
];skipCopyDuringWatch
Avoids re-copying files while running in --watch mode.
skipCopyDuringWatch: true;Useful for large folders (e.g. stream) that don’t need to be rebuilt frequently.
minify
Enables or disables code minification.
minify: false;obfuscate
Enables or disables code obfuscation.
obfuscate: false;resource.directory
Sets the output directory for the compiled resource.
resource: {
directory: "resource";
}If the OUTPUT_DIR environment variable is set, it overrides this value.
entry (Advanced)
Override the default entry points for the server and client.
entry: {
server: "src/server/index.*",
client: "src/client/index.*",
}Last updated: Unknown