{"library":"luaubundler","title":"Luaubundler","description":"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.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install luaubundler"],"cli":{"name":"luaubundler","version":null}},"imports":["npx luaubundler <arguments>","\"scripts\": { \"bundle-luau\": \"luaubundler -i src/main.luau -o dist -m -v\" }","This package does not expose specific TypeScript types for its CLI configuration, as interaction is purely via command-line arguments."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Create project directory and navigate into it\nmkdir my-luau-project\ncd my-luau-project\n\n# Create a main Luau file with a module import and a macro\necho 'local MyModule = require(\"path/to/my/module\")\\nprint(\"Hello from Luau!\")\\nfunction LBN_METADATA() return { version = \"1.0.0\", env = \"development\" } end' > main.luau\n\n# Create the nested directory for the module\nmkdir -p path/to/my\n\n# Create the required module file\necho 'return { message = \"This is a required module data.\" }' > path/to/my/module.luau\n\n# Create the output directory for the bundled file\nmkdir dist\n\n# Run the luaubundler CLI tool with minification, local and global variable renaming\nnpx luaubundler -i main.luau -o dist -n bundled.luau -m -v -g\n\n# Display the content of the generated bundled file\ncat dist/bundled.luau\n\n# Expected output in dist/bundled.luau (variable names 'a' and 'b' are examples and may vary):\n# --!native\n# --[[ Luaubundler v1.1.6 ]]\n# --[[ LBN_METADATA:{ \"version\": \"1.0.0\", \"env\": \"development\" } ]]\n# local a = {message=\"This is a required module data.\"}\n# print(\"Hello from Luau!\")\n# function b() return {version=\"1.0.0\",env=\"development\"} end","lang":"javascript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}