A Lua source code minifier that strips comments, whitespace, and semantically renames local variables for minimal output.
LuaMinify is a Lua source code minifier that reduces code size by stripping comments, whitespace, and semantically renaming local variables. It includes a Lua lexer, parser, and static analysis tools to ensure correctness while minimizing output. The project solves the problem of deploying compact, performance-optimized Lua scripts in production environments.
Lua developers, particularly those working on Roblox or other embedded Lua environments, who need to reduce script size for performance or deployment constraints.
Developers choose LuaMinify for its semantic variable renaming and AST-based accuracy, which ensures minified code remains functionally identical to the original. It provides reliable minification with support for complex Lua syntax like embedded strings.
Lua source code minifier.
Renames all local variables to shorter forms based on AST analysis, reducing code size while ensuring semantic correctness, as highlighted in the features.
Uses a full Lua scanner/parser to generate an AST, enabling precise handling of complex syntax like embedded strings and minimizing errors during minification.
Includes a dedicated Roblox plugin for seamless minification within Roblox Studio, making it convenient for game developers targeting that platform.
Provides easy-to-use shell and batch files for quick minification from the command line, with simple syntax for input and output files.
Full and exact reconstruction modes are listed as TODOs in the README, limiting options for developers who need to preserve comments or specific formatting.
As a standalone tool, it lacks integrations with package managers or build systems, requiring manual setup for automated workflows.
AST-based processing, while accurate, can be slower than simpler minifiers, especially for large codebases, due to the overhead of parsing and transformation.
The README is brief and lacks detailed examples or API documentation for using the lexer/parser in custom static analysis projects.
A tool for linting and static analysis of Lua code.
An Optional Type System for Lua
The metalua programming language
A Lua 5.3 parser written with LPegLabel
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.