loadfile
Compiles and loads Luau source from a file.
function loadfile(pathpathstringPath to the .lua / .luau file.: string, chunknamechunknamestring?Optional chunk name for error messages.: string?): (function?, string?)function?The compiled chunk, or nil on error.string?The error message if compilation failed.Usage
Load and execute a module
local fn, err = loadfile("modules/util.lua")
assert(fn, err)()