Skip to content

Instantly share code, notes, and snippets.

@taminomara
Created January 26, 2025 20:51
Show Gist options
  • Save taminomara/a54d24221f5692c46d1fa06a09f341dd to your computer and use it in GitHub Desktop.
Save taminomara/a54d24221f5692c46d1fa06a09f341dd to your computer and use it in GitHub Desktop.
-- Example loader implementation
return function(config)
-- Do some stuff to initialize your code loader here.
-- Config contains the relevant table from `BOOTLOADER_CONFIG.loaders`.
print("Loader config:")
for k, v in pairs(config) do print(" ", k, "=", v) end
return function(path)
-- Actual part that loads the code.
-- Let's do a simple 'hello world' example:
if path == "hello.lua" then
return "print('it works!')" -- File found, return its code.
else
return nil -- File not found.
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment