feature/imp-27-add-minifier #21

Merged
mr.zero merged 4 commits from feature/imp-27-add-minifier into master 2026-02-26 23:49:35 +00:00
3 changed files with 3284 additions and 2 deletions
Showing only changes of commit 41f75da8c3 - Show all commits

2
.gitignore vendored
View File

@@ -1,4 +1,6 @@
.local
impostor.lua
impostor.min.lua
impostor.unmin.lua
prompts
docs

View File

@@ -6,9 +6,13 @@ PROJECT = impostor
ORDER = $(PROJECT).inc
OUTPUT = $(PROJECT).lua
OUTPUT_MIN = $(PROJECT).min.lua
OUTPUT_UNMIN = $(PROJECT).unmin.lua
OUTPUT_ZIP = $(PROJECT).html.zip
OUTPUT_TIC = $(PROJECT).tic
MINIFY = minify.lua
SRC_DIR = inc
SRC = $(shell sed 's|^|$(SRC_DIR)/|' $(ORDER))
@@ -39,6 +43,18 @@ $(OUTPUT): $(SRC) $(ORDER)
echo "" >> $(OUTPUT); \
done
minify: $(OUTPUT_MIN)
$(OUTPUT_MIN): $(OUTPUT) $(MINIFY)
@echo "==> Minifying $(OUTPUT) -> $(OUTPUT_MIN)"
@lua $(MINIFY) minify $(OUTPUT) > $(OUTPUT_MIN)
unminify: $(OUTPUT_UNMIN)
$(OUTPUT_UNMIN): $(OUTPUT) $(MINIFY)
@echo "==> Unminifying $(OUTPUT) -> $(OUTPUT_UNMIN)"
@lua $(MINIFY) unminify $(OUTPUT) > $(OUTPUT_UNMIN)
export: build
@if [ -z "$(VERSION)" ]; then \
echo "ERROR: VERSION not set!"; \
@@ -156,7 +172,7 @@ export_assets:
@$(call f_export_asset_awk,WAVES,$(OUTPUT),$(ASSETS_LUA))
clean:
@rm -f $(PROJECT)-*.tic $(PROJECT)-*.html.zip $(OUTPUT)
@rm -f $(PROJECT)-*.tic $(PROJECT)-*.html.zip $(OUTPUT) $(OUTPUT_MIN) $(OUTPUT_UNMIN)
@echo "==> Cleaned build artifacts"
# CI/CD Targets
@@ -219,5 +235,5 @@ docs: build
@ldoc ${OUTPUT} -d docs
@echo "==> Documentation generated."
.PHONY: all build export watch import_assets export_assets clean lint ci-version ci-export ci-upload ci-update install_precommit_hook docs
.PHONY: all build minify unminify export watch import_assets export_assets clean lint ci-version ci-export ci-upload ci-update install_precommit_hook docs

3264
minify.lua Normal file

File diff suppressed because it is too large Load Diff