NebLua is a tiny zero-dependency bundler for Lua. Lua 5.4 supported but it may work for Lua 5.3.
- Bundle
require
,loadfile
anddofile
functions - Text import with
requireText
Download single source file from Releases
This is a part of configuration of NebLua's self-build. See /example
and /test/bundle/bundle.test.lua
local bundle = require("src.neblua").bundle
bundle {
entry = "src.main",
output = "./dist/main.bundle.lua",
include = {
"./src/main.lua",
-- manually add files (for sub-effects)
"./src/foo.lua",
exclude = {}, --Optional
rootDir = nil, --Optional
-- specifying types
{ path: "./src/bar.lua", type: "lua" },
{ path: "./src/some.txt", type: "text" },
},
verbose = true, --Optional
}
$ lua neblua-cli [options] [files]
options | value | function |
---|---|---|
-e , --entry |
module name | set entry point |
-o , --output |
file name | set output file name |
--verbose |
none | enable verbose mode |
-v , --version |
none | print version |
--exclude |
none | excluded file patterns from bundle |
neblua.bundle(options: BuildOptions)
Bundles input files into one file.
key | type | value |
---|---|---|
rootDir |
string | nil |
root directory of source files |
entry |
string |
entry module name |
include |
File[] |
source files (where File is string | { path: string, type: string } ) |
output |
string |
output file name |
verbose |
boolean | nil |
enable verbose output |
exclude |
string[] | nil |
excludes files from bundle with patterns |
neblua.requireText(path: string): string
Requires module as text file. Returns text content of the given file.
local requireText = require("neblua").requireText
-- Text content is bundled
local version = requireText("./version.txt")
print(version)
neblua.appInfo
key | type | value |
---|---|---|
name |
string |
the value "neblua" |
version |
string |
the version of neblua |
- support
require
- support
loadfile
- support
dofile
- error output override
- string require
- (partially) automatically add required files
- minify
- tree shaking