SkillAgentSearch skills...

LuaCompact

LuaCompact is a Lua bundler written in Typescript that combines multiple Lua files into one.

Install / Use

/learn @Parritz/LuaCompact
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center"> <img src="images/luacompact_banner.png" width="512"></img> <br> <a href="https://github.com/Parritz/LuaCompact/releases/latest"><img src="https://img.shields.io/github/v/release/Parritz/LuaCompact?include_prereleases" alt="Latest Release" /></a> <br> A Lua bundler written in Typescript that combines multiple Lua files into one, making managing large-scale projects a breeze. <h1></h1> </div>

Installation

Before installing LuaCompact, ensure that you have Node.js installed.<br> After that, you can install LuaCompact using one of the commands below depending on which package manager you prefer.

# Using NPM
npm i luacompact -g

# Using Yarn
yarn global add luacompact

# Using PNPM
pnpm add luacompact -g

After installation, you should be able to use LuaCompact either by using the luacompact or lcp commands in terminal.

Usage

Creating a project

Once LuaCompact is installed, you will first have to create a LuaCompact project.<br> To create a LuaCompact project, open the directory you want the project in and run the command below.

luacompact init

Building a project

To build a project, all you need to do is run the command below.<br> Optionally, you can also include a -watch or -w parameter to the command to automatically have LuaCompact build the project once a file is changed.

# Building without -watch
luacompact build

# Building with -watch
luacompact build -watch

Loading modules/scripts

Loading a module/script is made pretty simple.<br> All you need to do is use the load function and pass through a relative path to the script you want to load.<br> The load function supports both .lua and .luau files.

index.lua Example:

local core = load("core.lua")
core.helloWorld()

core.lua Example:

local core = {}

function core.helloWorld()
    print("Hello world!")
end

return core

Importing other files

Not only can you load modules, but you can also import other files using the import function.<br> Unlike the load function, the import function requires the file extension in the function call.<br>

JSON files are automatically converted to Lua dictionaries, while every other file will be converted to text.<br>

index.lua Example:

local defaultConfig = import("assets/config.json")
print(defaultConfig.Enabled)

config.json Example:

{
    "Enabled": true
}

Config

Every LuaCompact project has a config file called luacompact.json.<br> Below, you can see the options and what each option is used for.

| Key | Description | Input | Type | Required | | --- | --- | --- | --- | --- | | main | The program entry point. | A directory to a lua file. | string | true | | prelude | Code that runs after imports are defined but before modules are defined. | A directory to a lua file. | string or string[] | false | | exclude | Files that aren't included in the final output. | A list of directories. | string[] | false | | exportDirectory | The place to export the final output. | A directory. | string | "build" |

Contributing

Information about contributing to the project can be found here.

Related Skills

View on GitHub
GitHub Stars11
CategoryDevelopment
Updated16d ago
Forks3

Languages

TypeScript

Security Score

95/100

Audited on Mar 21, 2026

No findings