seaofvoices / darklua

A command line tool that transforms Lua code
https://darklua.com/
MIT License
78 stars 10 forks source link

Allow for injecting lua files as globals #154

Open Aloroid opened 9 months ago

Aloroid commented 9 months ago

This would be similar to the inject_global_value rule. You would provide a Lua/Luau file that returns a table, and all values of the table would be injected into your luau files. This comes with the benefit that we can now inject more complicated datatypes.

This would improve my workflow, as I can now inject very common parts of my code into other code which is changed often. It could look something like this:

{
    "rule": "inject_global_lua_file",
    "file": "src/shared/globals.luau"
}