FiveM Bundler

1.1.2 · active · verified Tue Apr 21

fivem-bundler is a build-time compiler designed for FiveM Lua resources, currently at version 1.1.2. It analyzes `client/` and `server/` directories, resolving standard Lua `require()` and `ox_lib.require()` calls through Abstract Syntax Tree (AST) analysis. The primary function is to consolidate multiple Lua files into single-file bundles for both client and server runtimes, injecting all modules into Lua's `package.preload`. This approach optimizes resource loading and simplifies deployment for FiveM servers. Key differentiators include its automatic detection of resource structure (directory or fxmanifest.lua driven), explicit support for `ox_lib` semantics, and a 'lazy' bundling feature for modules that should be available on-demand but not auto-executed. While a specific release cadence isn't published, the `1.x.x` versioning suggests ongoing, active development. It requires Node.js >=18.0.0 to run.

Common errors

Warnings

Install

Imports

Quickstart

This demonstrates global installation and basic bundling of the current directory, or using npx for a specific resource with an explicit output directory and specifying lazy modules.

npm i -g fivem-bundler
fivem-bundler .
# OR using npx without global installation:
npx fivem-bundler ./my-resource ./my-resource/dist
# Example with lazy modules:
npx fivem-bundler ./my-resource --lazy "server/frameworks/**" --lazy "client/legacy.lua"

view raw JSON →