lua-users home
lua-l archive

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


On Wed, Apr 10, 2013 at 10:22 PM, Petite Abeille
<petite.abeille@gmail.com> wrote:
>> You can always wrap your files in a function wrapper, and add an
>> appropriate loader/searcher.
>
> Or… you can always set package.loaded and call it a day.

Unless you dont want the modules to be run until required for the
first time, but then package.preload will do the trick.

Anyway, my point was that the lack of module() does not preclude
concatenation. It makes it a bit less convenient.

Here's a script that packages a source tree into a single file. Written
for Lua 5.1, I did not test it with v5.2.

require(), loadfile() and dofile() work as expected.

http://getmoai.com/wiki/index.php?title=Concatenate_your_Lua_source_tree

-- Pierre-Yves