or go for more of a requirejs approach where everything is in a wrapper you can port grunt-require task over easy to traverse and auto find dependancies might take about a week to port over... The trick that require has is it uses esprima to evaluate the javascript, but for lua you can substitue esprima with lpeg http://www.inf.puc-rio.br/~roberto/lpeg/
For dependency injection you might want to try this instead. https://github.com/pioneerspacesim/pioneer/pull/1499
or go for more of a requirejs approach where everything is in a wrapper you can port grunt-require task over easy to traverse and auto find dependancies might take about a week to port over... The trick that require has is it uses esprima to evaluate the javascript, but for lua you can substitue esprima with lpeg http://www.inf.puc-rio.br/~roberto/lpeg/