feat(cache): update package.loaded on require

This commit is contained in:
Folke Lemaitre 2022-12-28 09:00:39 +01:00
parent b813fae61c
commit 021e54655f
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,9 @@ function M.load(modkey, modpath)
end
function M.require(modname)
return M.loader(modname)()
local mod = M.loader(modname)()
package.loaded[modname] = mod
return mod
end
---@param modname string