diff --git a/packages/lest/package.json b/packages/lest/package.json index 03739b0..7526b81 100644 --- a/packages/lest/package.json +++ b/packages/lest/package.json @@ -18,9 +18,7 @@ "lest": "dist/index.js" }, "scripts": { - "bundle": "luabundler bundle src/lua/lest.lua -p \"./?.lua\" -o dist/lua/lest.lua", - "minify": "lua scripts/minify.lua", - "build:lua": "npm run bundle && npm run minify", + "build:lua": "luabundler bundle src/lua/lest.lua -p \"./?.lua\" -o dist/lua/lest.lua", "build:ts": "tsc -p tsconfig.build.json", "build": "npm run build:lua && npm run build:ts", "test:lua": "lua src/lua/lest.lua", diff --git a/packages/lest/scripts/minify.lua b/packages/lest/scripts/minify.lua deleted file mode 100644 index c588b93..0000000 --- a/packages/lest/scripts/minify.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Note, this cannot be replaced by an NPM script as luamin doesn't like redirecting output to a file - -local BUNDLE_PATH = "dist/lua/lest.lua" - ---- Throws the message if it is not nil ----@param message any -local function throwIfNotNil(message) - if message ~= nil then - error(message) - end -end - -local handle, popenError = io.popen("luamin -f " .. BUNDLE_PATH) -throwIfNotNil(popenError) - -if not handle then - error("Popen handle is nil") -end - -local minified = handle:read("a") -handle:close() - -if string.match(minified, "Error:") then - error(minified) -end - -local file, fileError = io.open(BUNDLE_PATH, "w+") -throwIfNotNil(fileError) - -if not file then - error("File handle is nil") -end - -local _, writeError = file:write(minified) -throwIfNotNil(writeError) - -file:close()