Skip to content

LuBu is a simle lua bundler which allows you to compress .lua and .dll modules into one.

Notifications You must be signed in to change notification settings

chaposcripts/lubu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuBu

LuBu is a simle lua bundler which allows you to compress .lua and .dll modules into one.

Examples

See example-project folder

Usage

  1. install lubu.exe from the latest release
  2. create lubu.json file in your project folder
  3. set up your config
  4. use lubu.exe lubu.json

LuBu Config

LuBu config must have fields "modules", "modules" and "output". Also you can add some constants in "const"

  1. main - string - path to main file
  2. modules - map[string]string - .lua / .dll modules list, where key is module name (used in require()), value is a path to module
  3. output - string - path to bundled file
  4. const - map[string]interface{} - constants list, where key is variable name and value is a constant value. Only string, number and bool are supported
{
    "modules": {
        "sum": "./src/sum.lua",
        "mul": "./src/mul.lua",
        "lfs": "./src/lfs.dll"
    },
    "const": {
        "VERSION": "1.1a"
    },
    "main": "./src/init.lua",
    "output": "./dist/release.lua"
}

Also you can find auto json generator in example folder. Run it using go run generate-lubu-config.go

Project folder example

my-project/
├── src/
│   ├── lfs.dll
│   ├── init.lua
│   ├── add.lua
│   └── mul.lua
├── lubu.exe
└── lubu.json

Building

  1. git clone https://github.com/chaposcripts/lubu/
  2. cd lubu
  3. go build or use go build && lubu.exe lubu.json to run it after building

TODO

  1. add .dll modules support (Done!)
  2. add resource bundler (ttf, png, etc.)

About

LuBu is a simle lua bundler which allows you to compress .lua and .dll modules into one.

Resources

Stars

Watchers

Forks