From 1c3efda2887ef66a586f7c831e63d7a3254912a8 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Thu, 19 Oct 2023 04:08:01 -0700 Subject: [PATCH] chore(examples): add basic example --- examples/basic.luau | 25 +++++++++++++++++++++++++ init.luau | 1 + src/init.luau | 20 +------------------- 3 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 examples/basic.luau create mode 100644 init.luau diff --git a/examples/basic.luau b/examples/basic.luau new file mode 100644 index 0000000..018ede8 --- /dev/null +++ b/examples/basic.luau @@ -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"]) diff --git a/init.luau b/init.luau new file mode 100644 index 0000000..3b2dc08 --- /dev/null +++ b/init.luau @@ -0,0 +1 @@ +return require("src/terracotta") diff --git a/src/init.luau b/src/init.luau index ca684af..f051cd9 100644 --- a/src/init.luau +++ b/src/init.luau @@ -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")