A Lua bundler written in TypeScript for Scribunto. Automatically detects require statements.
scribunto-bundler has support for .lua
and .luau
file extensions.
$ npm install scribunto-bundler --global
# or
$ pnpm add scribunto-bundler --global
Creates a basic project and installs scribunto-bundler locally using npm.
$ npx scribunto-bundler --create
# or
$ pnpx scribunto-bundler --create
Bundles the main lua file with its defined modules. Modules are only loaded once on require()
.
$ npm run bundle
# or
$ pnpm bundle
// bundler.config.js
/** @type {import("scribunto-bundler").Config} */
export default {
prefix: 'Text that goes infront of the bundled code, e.g. license',
suffix: 'Text that goes after the bundled code',
main: 'src/main.lua', // Your main lua file
out: 'dist/bundled.lua', // The destination file for the bundle command
};