https://github.com/awman3703/cct-bundler
CC: Tweaked tool to bundle a script with its dependencies, making it portable
https://github.com/awman3703/cct-bundler
Last synced: 6 days ago
JSON representation
CC: Tweaked tool to bundle a script with its dependencies, making it portable
- Host: GitHub
- URL: https://github.com/awman3703/cct-bundler
- Owner: AwMan3703
- Created: 2025-09-22T22:28:01.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-23T21:14:21.000Z (9 months ago)
- Last Synced: 2025-10-23T08:59:45.745Z (8 months ago)
- Language: Lua
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CC:Tweaked LUA bundler
Bundles a script and its dependencies (APIs and such, imported with `require()`)
#### Note that:
The bundling operation is not recursive, nested dependencies will be preserved: if script **A** `require`s script **B** and script **B** `require`s script **C**, when script **A** is bundled and script **B** is built into it, script **C** will still be required as an external file. To obtain a single file, script **C** would first need to be bundled in script **B**, before script **B** is built into script **A**.
Furthermore, only explicitly declared imports will be bundled.
```
local lib = require("mylibrary")
```
The above dependency will be included, whereas the following will not:
```
local libname = "mylibrary"
local lib = require(libname)
```
## How to use
1. Import or download the `bundler.lua` script to a computer.
2. Use the `bundler build .lua` command to bundle scripts (see "commands > build").
3. The bundled file will be saved at `_bundled.lua`.
4. You can now remove all dependencies from the computer — the bundled script will run fine on its own.
## Commands
### `bundler build `
Builds a bundle by looking for `require()` statements in the script at `` and replacing them with the code they import from other files. The resulting script is then saved at ``.
- `` The path of the script to bundle up.
- `` (OPTIONAL) The location to save the newly built bundle in. If this parameter is omitted, it defaults to the same directory as ``, naming the new file "`_bundled.lua`".
### `bundler test `
Temporarily builds and runs a bundle. This command is meant to test if your script would run when bundled, without creating new files.
- `` The path of the script to test.