Luaubundler is a command-line interface (CLI) tool designed for bundling Luau code, specifically tailored for the Roblox ecosystem. It processes an input Luau file, recursively resolves `require` statements by inlining the content of required files (including support for absolute paths), and outputs a single, consolidated Luau file. Key features include code minification, automatic renaming of local and global variables to reduce file size and obfuscate code, and support for special build macros like `LBN_METADATA` for injecting metadata into the bundle. The current stable version is 1.1.6. While the project shows a consistent update cadence through bug fixes and feature additions, its development is largely driven by community feedback. A key differentiator is its specific optimization capabilities for Luau, making it well-suited for Roblox game development. The project internally leverages `luamin.js` for minification and `luaparse` for parsing Luau code.
npm install luaubundlerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up a basic Luau project, including an entry file with a module `require` and a `LBN_METADATA` macro. It then shows how to bundle, minify, and rename local/global variables using the `luaubundler` CLI, displaying the combined and optimized output.
Ensure your project's licensing and intended use cases fully comply with the non-commercial and no-derivatives restrictions of the CC BY-NC-ND 4.0 license. For commercial applications, you must seek explicit permission and potentially a separate licensing agreement from the author.
Ensure `luaubundler` is installed either locally (`npm install luaubundler`) or globally (`npm install -g luaubundler`), or always run it via `npx luaubundler ...` to ensure the correct version is found and executed.
Verify that the path provided to the `-i` argument is correct, either relative to your current working directory or as an absolute path, and that the file actually exists and is readable.
Before running the bundler, ensure the output directory exists by creating it manually (e.g., `mkdir -p dist` on Linux/macOS or `New-Item -ItemType Directory -Path dist` on PowerShell for Windows) or ensure the `-o` path points to an already existing directory.
No dependency data recorded yet.