chore(examples): add basic example

This commit is contained in:
Erica Marigold 2023-10-19 04:08:01 -07:00
parent 5b2384b02d
commit 1c3efda288
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
3 changed files with 27 additions and 19 deletions

25
examples/basic.luau Normal file
View file

@ -0,0 +1,25 @@
local Fs = require("@lune/fs")
local Terracotta = require("..")
Terracotta.Build({
entryPoints = { "utils/fs.luau", "darklua/cmd.luau" },
bundle = true,
})
-- OR --
local terracotta = Terracotta.new()
local outputs = terracotta:Build({
entryPoints = { "utils/fs.luau", "darklua/cmd.luau" },
bundle = true,
rules = {
"remove_spaces",
"remove_comments",
"rename_variables",
"rename_variables",
},
})
Fs.writeFile("darklua.luau", outputs["darklua/cmd.luau"])

1
init.luau Normal file
View file

@ -0,0 +1 @@
return require("src/terracotta")

View file

@ -1,19 +1 @@
local Fs = require("@lune/fs")
local Terracotta = require("terracotta")
Terracotta.Build({
entryPoints = { "utils/fs.luau", "darklua/cmd.luau" },
bundle = true,
})
-- OR --
local terracotta = Terracotta.new()
local outputs = terracotta:Build({
entryPoints = { "utils/fs.luau", "darklua/cmd.luau" },
bundle = true,
})
Fs.writeFile("darklua.luau", outputs["darklua/cmd.luau"])
return require("terracotta")