GlyEngine 0.0.19
Create games and apps with lua
Loading...
Searching...
No Matches
Bundler

unify lua files More...

Functions

local function build (src, dest)
 bundler library
 

Detailed Description

The bundler is for general use and can be used in any lua code in addition to games made for the gly engine.

Downloads
Usage
  • gly engine cli
    lua cli.lua bundler src/main.lua --dist ./dist
  • bundler cli
    lua bundler_cli.lua src/main.lua dist/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))
      os.exit(0)
      local function exit()
      local function print(pos_x, pos_y, text)
      std.text.print
  • 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))
      os.exit(0)
      end
      lib_common_math = function()
      local function sum(a, b)
      return a + b
      end
      local P = {
      sum = sum
      }
      return P
      end
      main()

Function Documentation

◆ build()

local function build ( src ,
dest  )
Example
local bundler = require('bundler')
local ok, msg = bundler.build('src/main.lua', 'dist/main.lua')
if not ok then
error(msg)
end
local function build(src, dest)
bundler library
local function error(handler_func)