mirror of
https://github.com/0x5eal/terracotta.git
synced 2024-12-12 12:50:35 +00:00
chore(examples): add basic example
This commit is contained in:
parent
5b2384b02d
commit
1c3efda288
3 changed files with 27 additions and 19 deletions
25
examples/basic.luau
Normal file
25
examples/basic.luau
Normal 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
1
init.luau
Normal file
|
@ -0,0 +1 @@
|
|||
return require("src/terracotta")
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue