| Crates.io | luapack |
| lib.rs | luapack |
| version | 0.1.1 |
| created_at | 2025-11-03 20:13:28.653376+00 |
| updated_at | 2025-12-30 15:00:48.102452+00 |
| description | A basic rust application for efficiently bundling Lua scripts into monolithic releases. |
| homepage | |
| repository | https://github.com/repetitive-contrarian/luapack/tree/master |
| max_upload_size | |
| id | 1915201 |
| size | 59,890 |
A Rust-based tool for bundling and minifying Lua scripts into monolithic releases.
dynamic feature)Either cargo install luapack or cargo binstall luapack depending on which is available. Read the Cargo.toml for compilation options.
luapack [OPTIONS] --output <OUTPUT> --file <FILE>
-p, --prefix <PREFIX> An optional prefix file that will be added to the output
-s, --suffix <SUFFIX> An optional suffix file that will be added to the output
-o, --output <OUTPUT> Output file path
-f, --file <FILE> Input file path
-B, --bundle Bundle modules (entry point resolution)
-P, --pack Minify the output
-l, --lz4 Compress output with LZ4
-h, --help Print help
-V, --version Print version
Default (bundle + pack):
luapack -f main.lua -o output.lua
Bundle only:
luapack -B -f main.lua -o bundled.lua
Pack only (minify existing file):
luapack -P -f script.lua -o minified.lua
Bundle, pack, and compress:
luapack -l -f main.lua -o output.lua
With a prefix and suffix:
luapack -p prefix.lua -s suffix.lua -l -f main.lua -o output.lua
The bundler resolves require() statements and combines all dependencies into a single file with a custom module loader. Modules are stored in a table and loaded on-demand.
Input:
-- main.lua
local utils = require('./utils')
utils.hello()
-- utils.lua
return {
hello = function() print("Hello!") end
}
Output:
require = function(c)
return __M[c]()
end
__M={
["utils.lua"]=function()
return {
hello = function() print("Hello!") end
}
end
}
local utils = require("utils.lua")
utils.hello()
With the dynamic feature enabled, all .lua files in your project directory are automatically included in the bundle, allowing runtime defined dependencies. If you want to exclude a certain Lua file then add -- ignore as its first line. Keep in mind that paths are relative to the parent of the first .git directory it can find.
Just removes whitespaces (wherever possible) and shortens variable names.
Compresses output using the lz4 algorithm.
-p and -s to add your ownThis project is minimally maintained - updates will be made if it breaks with new Lua versions or dependencies.
MPLv2