Skip to content

yatyricky/lua-bundler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Bundle Lua files into one:

lua-bundler -i "./example/src/Main.lua" -o "./example/dist/bundle.lua"

If target file name is war3map.lua, inject bundled source to it:

lua-bundler -i "./example/src/Main.lua" -o "./example/dist/war3map.lua"

Add -p, --production to minify bundled lua

lua-bundler -i "./example/src/Main.lua" -o "./example/dist/bundle.lua" -p
lua-bundler -i "./example/src/Main.lua" -o "./example/dist/war3map.lua" -p

Add -e, --exclude to exclude certain files and directories

lua-bundler -i "./example/src/Main.lua" -o "./example/dist/bundle.lua" -e "example/src/Reporter.lua"
lua-bundler -i "./example/src/Main.lua" -o "./example/dist/bundle.lua" -e "example/src/Reporter.lua;example\src\Dir"

Add -d, --define to pass define flags for conditional compilation

lua-bundler -i "./example/src/Main.lua" -o "./example/dist/bundle.lua" -d "DEBUG"
lua-bundler -i "./example/src/Main.lua" -o "./example/dist/bundle.lua" -d "DEBUG;FEATURE_X"

Blocks wrapped in --#IF FLAG THEN / --#END are included only when the flag is defined. Expressions support AND, OR, NOT, and parentheses:

--#IF DEBUG THEN
print("debug mode")
--#END

--#IF FEATURE_X AND NOT DEBUG THEN
-- only included when FEATURE_X is defined and DEBUG is not
--#END

Require flavours

local Module = require("Modules.Module") -- recommended
require("Modules/Module")
require "Modules.Module"

Build with pkg

e.g. pkg . -t node16-win-x64

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors