gamesys / moonshine

A lightweight Lua VM for the browser
http://moonshinejs.org
MIT License
502 stars 35 forks source link

init.lua not loaded #34

Closed premek closed 8 years ago

premek commented 8 years ago

I found this issue with https://github.com/TannerRogalsky/punchdrunk which is using moonshine. Looks like moonshine is not trying to load init.lua from a folder that is required.

require "foldername"

I think it should try to load foldername.lua etc but also foldername/init.lua'

In lua it is configurable but default can be found here: http://www.lua.org/source/5.1/luaconf.h.html

paulcuth commented 8 years ago

You'll need to update the value of package.path in Moonshine. It's uses different paths to C Lua by default. I should document this somewhere.

Try:

package.path = '?/init.lua.js;'..package.path
premek commented 8 years ago

Thanks