Reduce the size of your Lua files by removing unnecessary whitespace and compacting the source code.
Luatiny is a Bash script that uses the Luamin tool to minify Lua files in order to reduce their size through the removal of all comments and whitespace from the source code, as well as the renaming of local variable names to a more abbreviated form.
I created this script with the intention of optimizing Neovim's configuration, but it can be useful for any Lua project that seeks to reduce its size.
To use Luatiny, make sure you have Luamin installed:
npm install luamin
Follow these steps to install and configure Luatiny:
-
Clone this repository to your local machine:
git clone https://github.com/farias-hecdin/Luatiny.git
-
Add this code snippet to your
.zshrc
or.bashrc
file to be able to execute Lare from any directory.# Luatiny export LUATINY_HOME="$HOME/.local/share/luatiny" export PATH="$LUATINY_HOME:$PATH"
-
Run the
wizard.sh
file to install Luatiny:cd Luatiny/ bash wizard.sh
-
Once you have installed Luatiny, you can run the script by typing the following command and specifying a directory:
luatiny [directory]
To display the help text, you can use the luatiny --help
command.
Luatiny is under the MIT license. See the LICENSE
file for more information