lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hello readers of lua-l,

I'm happy to announce a little utility of mine, called 'mergelua':

This tool allows merging of (pure, noncompiled) Lua modules into a
single collective file.
It can be used to create packages of your Lua modules, similar to what
golang does, except that mergelua creates a single file.
Mergelua also features a local override of the 'require' function to
search the local moduletable first, and then execute the global
require() if the module does not exist in mergelua.


    merge.lua <outputfilename>  <modulename>=<modulepath>


    merge.lua collection.lua oop=../oop.lua/oop.lua

There are probably a few things that might be tweaked:
   + minifying of Lua code (removing comments, newlines, etc)
   + support of bytecode-compiled chunks (unfortunately, I have yet to
find out how to store the data)
   + storing of .so / .dll files (same problem as above)

Please tell me what you think!