unify lua files
The bundler is for general use and can be used in any lua code in addition to games made for the gly engine.
- optimized recursive search for dependencies in your files.
- minification by removing comments, extrabreaklines and tabulations.
- compatibility with lua distributions that do not expose standard libs in require.
- Instalation
- Todo
- coming soon, just bundler as a utility
.lua
script to use in your CI system.
(without the engine)
- Usage
lua cli.lua bundler src/main.lua
- Result
- Input
lib_common_math.lua
local function sum(a, b)
return a + b
end
local P = {
sum = sum
}
return P
main.lua
local os = require('os')
local zeebo_math = require('lib_common_math')
print(zeebo_math.sum(1, 2))
- Output
main.lua
local os = ((function() local x, y = pcall(require, 'os'); return x and y end)()) or _G.os
local lib_common_math = nil
local function main()
local zeebo_math = lib_common_math()
print(zeebo_math.sum(1, 2))
end
lib_common_math = function()
local function sum(a, b)
return a + b
end
local P = {
sum = sum
}
return P
end
main()