Yes, maybe. I tried the following using Lua 5.1.5:
local test2 = require("path1.test")
local test1 = require("/path1/test")
print("main")
test1.hello()
test2.hello()
for k,v in pairs(package.loaded) do
print(k,v)
end
And the output:
[√] ~/Downloads/TMP > lua main.lua
main
Hello
Hello
string table: 0x7fe7a2c098b0
debug table: 0x7fe7a2c0aaa0
package table: 0x7fe7a2c075d0
_G table: 0x7fe7a2c05f60
io table: 0x7fe7a2c08a20
os table: 0x7fe7a2c09230
table table: 0x7fe7a2c07d60
math table: 0x7fe7a2c0a0e0
/path1/test table: 0x7fe7a2c0c170
coroutine table: 0x7fe7a2c071d0
path1.test table: 0x7fe7a2c0bf80
As you can see in this case it treats them as two different loaded packages despite them referring to the same file.
When testing the same in Defold (on macOS) I get an error that module '/path1/test' not found
. Let me try the same on Windows.