Crates.io | luabundle |
lib.rs | luabundle |
version | 1.1.3 |
source | src |
created_at | 2023-08-30 05:51:07.37201 |
updated_at | 2023-11-08 07:10:38.461663 |
description | Bundler for Luau scripts |
homepage | |
repository | https://github.com/Sw1ndlerScripts/LuaBundler |
max_upload_size | |
id | 958733 |
size | 58,864 |
A customizable Lua Bundler made in Rust
cargo install luabundle
, it should download to your cargo bin folder.luabundle
in the command prompt to create a new project and in the current directory.luabundle
again to bundle your code to the output file.loadmodule
)main.lua
)LuaBundler/bundled.lua
)false
)true
)Create a file called main.lua
(or what you set as the Entry File
) in the root folder.
Files that are being required should be treated like a module script.
Use the loadmodule
function and pass in a path to a file (paths are relative to the current file).
Use @
before the path to access the root, e.g., loadmodule("@fileAtRootFolder.lua")
.
Suppose you had a file layout like this
Project Directory/
├── main.lua
└── utils/
└── fancyprint.lua
Within main.lua
local fancyprint = loadmodule("utils/fancyprint.lua")
fancyprint("Hello world!")
Within fancyprint.lua
local function fancyprint(text)
print(text + " was printed with fancy text")
end
return fancyprint
Upon running luabundle, the output file would contain the runnable lua code