chore(build): update darklua rules & write config file to dist dir

This commit is contained in:
Erica Marigold 2023-10-19 04:05:42 -07:00
parent 8f45fc05f8
commit 5b2384b02d
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1

View file

@ -56,16 +56,21 @@ if not fs.isDir("dist/") then
end end
print(`{WAX_PREFIX_FORMAT("info", "[codegen]")} Generating darklua config file at darklua.config.json`) print(`{WAX_PREFIX_FORMAT("info", "[codegen]")} Generating darklua config file at darklua.config.json`)
fs.writeFile(
".darklua.json5", if not fs.isFile("dist/.darklua.json5") then
codegen({ fs.writeFile(
generator = "dense", "dist/.darklua.json5",
rules = { codegen({
"remove_spaces", generator = "dense",
"rename_variables", rules = {
}, "remove_spaces",
}) "remove_comments",
) "rename_variables",
"rename_variables",
},
})
)
end
local loader = task.spawn(function() local loader = task.spawn(function()
local chars = { "-", "\\", "|", "/" } local chars = { "-", "\\", "|", "/" }
@ -96,6 +101,7 @@ task.spawn(function()
"verbose=true", "verbose=true",
"minify=true", "minify=true",
"ci-mode=true", "ci-mode=true",
"darklua-config-path=dist/.darklua.json5",
"output=dist/terracotta.luau", "output=dist/terracotta.luau",
}) })
@ -111,6 +117,4 @@ task.spawn(function()
print() print()
print(`{WAX_PREFIX_FORMAT("info")} Successfully built terracotta.luau!`) print(`{WAX_PREFIX_FORMAT("info")} Successfully built terracotta.luau!`)
end end
fs.removeFile(".darklua.json5")
end) end)