Open
Description
inject_modules
rule would be great for injecting libraries and global functions too (exampe: injecting libraries of luau written in pure lua to emulate luau outside of luau)
Example
.darklua.json5
rules: {
inject_libraries: {
libraries: [
{
name: "buffer",
path: "buffer.lua"
},
{
name: "typeof",
path: "typeof.lua"
}
]
}
}
src/main.lua
print(typeof(buffer.create))
After processing:
local buffer = require("{top_path}/_DARKLUA_lib{buffer_blake3_hash}")
local typeof = require("{top_path}/_DARKLUA_lib{typeof_blake3_hash}")
print(typeof(buffer.create))
Metadata
Assignees
Labels
No labels