In my project, I have some separate libraries that are put into "project/lib" directory, e.g. :
project/lib/map
project/lib/map/init.lua
project/lib/map/functions.lua
project/lib/map/config.lua
...
In the "main.lua", I call it with :
Code: Select all
local map = require "lib.map"
Code: Select all
local config = require "map.config"
It works again if I modify the previous line :
Code: Select all
local config = require "lib.map.config"
I can also include "lib/map" into the package.path in the "main.lua" but I am sure there is a
better (more portable, more sustainable) way to organize separate library.
How would you do ?
Regards