1.3.5 • Published 2 years ago

basic-lua-bundler v1.3.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago
Basic Lua Bundler
No Tree Shaking
No fancy shit
Just bundles your code
Blazingly Fast (Build times are just a handful of milliseconds)
MIT

Creating BLB Projects

The best way to get started quickly with basic lua bundler is using create-blb: pnpm create blb (or npm init blb) create-blb will guide you through the entire setup of blb automatically.

create-blb requires NodeJS >=18

Versions below Node 18 have not been tested.

Manual Setup

Prerequesites
  1. pnpm
  2. nodejs (preferably installed from pnpm env use --global latest) >= 18
  3. git
Installation
  1. Run pnpm i -D blb in your project
  2. Make sure your project has a package.json
  3. Add this to your package.json's scripts:
"build": "blb-dev",
"dev": "blb-prod"
  1. Create a src/index.lua file.
  2. Make sure you enter the bundler directory and run pnpm i

Note: Your entrypoint's parent dir is the only dir we look after. We do NOT bundle anything outside of it's parent dir. Note 2: Only .lua files are bundled. Note 3: you can require() directories if it has an index.lua inside.

Usage

commanddescription
buildbuilds into output/
devstarts a dev server, builds on request

Advanced Usage

Variables

You have some minimal variables available in your environment:

vardescriptionexample
__filenamethe file's namein /src/a/b.lua: print(__filename) => a/b.lua
__dirnamethe directory's namerequire(__dirname..'/test')
__just_filenameJust the filename by itselfin /src/a/b.lua: print(__just_filename) => b.lua
__hashHex hash of the file dataprint(__hash)
modulesinternal list of modles, avoid using unless hotfixing shitn / a

Package Managers

Putting files in src/packages/ makes them require()able without the packages/ portion.

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago