Code: Select all
local config = require 'config'
-- Some code
Code: Select all
local config = require 'config'
This works as it should from the perspective of require and package.loaded, but the programmer is likely to not expect this behavior, which could easily lead to some hard to find bugs.
I don't really know how this should be solved properly, but one (hopefully feasible) idea is to switch the package.loaded table depending on which mod the current file belongs to.