Skip to content

Latest commit

 

History

History
83 lines (59 loc) · 1.65 KB

File metadata and controls

83 lines (59 loc) · 1.65 KB

luapack

Note

For now this is a quick prototype that works for me.

Lua bundler with replace/vendor modes.

Install

Download the latest binaries from the GitHub Releases page.

Quickstart

Bundle the simple example:

luapack bundle examples/simple/lua/main.lua \
  --lua "5.4" \
  --path "examples/simple/lua/?.lua" \
  --path "examples/simple/lua/?/init.lua" \
  --vendor "examples/simple/vendor/lua/?.lua" \
  --vendor "examples/simple/vendor/lua/?/init.lua" \
  --output examples/simple/dist/simple_bundle.lua

Run it with your Lua:

lua examples/simple/dist/simple_bundle.lua

Configuration (optional)

Auto-discovery in current directory, supports: luapack.yaml, luapack.yml and luapack.json as well.

Add a minimal luapack.toml:

[bundle]
lua = "5.4"
paths = [
  "lua/?.lua",
  "lua/?/init.lua",
]
vendors = [
  "vendor/lua/?.lua",
  "vendor/lua/?/init.lua",
]
# redact_base = "lua/"
output = "dist/simple_bundle.lua"
diagnostics = true

Usage:

# from the directory containing luapack.toml
luapack bundle lua/main.lua

# or pass it explicitly from anywhere
luapack bundle examples/simple/lua/main.lua --config examples/simple/luapack.toml

Docs

See doc/bundler.md for a deeper overview.

Credits

  • full_moon used for lua AST parsing
  • luabundler inspired the scoping approach
  • StyLua project structure, best-practices and full_moon integration

Authors

License

MPL-2.0