BloxPack is a tool for Roblox which packs a collection of lua files into a simple script.
- Create a ModuleScript in ReplicatedStorage named "BloxPack"
- Paste the code inside
bloxpack.lua
into the script.
Here is the directory tree of a BloxPack Folder:
.
└── example_folder/
├── init.lua
└── <insert other scripts here>
BloxPack folders must contain an init.lua
file.
To import a module, you would type the following into your script:
local module = require("module");
To export a variable, you would type the following into your script:
--@Export variable
To export a variable as the default, you would type the following into your script:
--@ExportDefault variable
Type the following into your command line:
bloxpack <DIRECTORY> -o <OUTPUT FILE>
An example:
bloxpack ./examples/helloworld -o ./helloworld.lua