lualove2dmoonscript

bundling moon.lua dependency


I'm making a game in lua with Love2D and have successfuly bundled it into an .exe for distributon. However, I recently switched to moonscript, and now after compiling and bundling the executable can't start on another computer because it doesn't have moon.lua (I guess it wants that for the standard library).

How can I include the moonscript standard library into my .exe fused bundle?


Solution

  • You can copy that file directly into your codebase the same way you've included any other libraries that you're using for your game when packaging for distribution.

    Note: within MoonScript's code base the moon library is actually the file moon/init.lua. Lua's package loader can find a module NAME by loading the file NAME/init.lua. This will not work for the current directly lookup though. The easiest fix is to rename init.lua to moon.lua.

    https://github.com/leafo/moonscript/blob/master/moon/init.lua