Skip to content

ari-party/scribunto-bundler

Repository files navigation

scribunto-bundler

npm version License

A Lua bundler written in TypeScript for Scribunto. Automatically detects require statements.

scribunto-bundler has support for .lua and .luau file extensions.

Installation

$ npm install scribunto-bundler --global
# or
$ pnpm add scribunto-bundler --global

Usage

create

Creates a basic project and installs scribunto-bundler locally using npm.

$ npx scribunto-bundler --create
# or
$ pnpx scribunto-bundler --create

bundle

Bundles the main lua file with its defined modules. Modules are only loaded once on require().

$ npm run bundle
# or
$ pnpm bundle

Configuration

// 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
};