Minify lua

You can minify lua code by https://github.com/defold/extension-prometheus

I make a fork of prometheus where i forced PrettyPrint to keep new line.
I do this because I need to get an understandable traceback on error.

This is web build.
2023-09-03_16-38-59


prometheus.lua

return {
    -- The default LuaVersion is Lua51
    LuaVersion = "Lua51"; -- or "LuaU"
    -- All Variables will start with this prefix
    VarNamePrefix = "";
    -- Name Generator for Variables that look like this: b, a, c, D, t, G
    NameGenerator = "MangledShuffled";
    -- No pretty printing
    PrettyPrint = true;
    -- Seed is generated based on current time 
    -- When specifying a seed that is not 0, you will get the same output every time
    Seed = 1050;
    -- Obfuscation steps
    Steps = {
      
    }
}
7 Likes

I was thinking Lua bytecode was generated when exporting a project.

Isn’t it the case ? That mean Lua source code is distibuted ?
I’ve just looked at, and i don’t see luacjit command in luajit package as i was expecting…

I have to remove quickly all the curses off my sources :sweat_smile:

1 Like

If jit supported bytecode will be used.
If not (html, iOS) source file used.

It is a good point about bytecode. When use bytecode minification is not needed)

There was issue about Lua bytecode. Vanilla lua generate bytecode that bigger than source file)

So source files is used.

bigger than source file ? How is it possible ?

2 Likes