fix(makefile): update minify-js target to conditionally skip based on agent and socket-proxy flags

This commit is contained in:
yusing
2026-02-16 08:24:14 +08:00
parent b272f3ffb7
commit ae45854977

View File

@@ -118,13 +118,18 @@ mod-tidy:
done done
minify-js: minify-js:
for file in $$(find internal/ -name '*.js' | grep -v -- '-min\.js$$'); do \ @if [ ${agent} = 1 ]; then \
ext="$${file##*.}"; \ echo "minify-js: skipped for agent"; \
base="$${file%.*}"; \ elif [ ${socket-proxy} = 1 ]; then \
min_file="$${base}-min.$$ext"; \ echo "minify-js: skipped for socket-proxy"; \
echo "minifying $$file -> $$min_file"; \ else \
bunx --bun uglify-js $$file --compress --mangle --output $$min_file; \ for file in $(find internal/ -name '*.js' | grep -v -- '-min\.js$'); do \
done ext="${file##*.}"; \
base="${file%.*}"; \
min_file="${base}-min.$ext"; \
bunx --bun uglify-js $file --compress --mangle --output $min_file; \
done \
fi
build: minify-js build: minify-js
mkdir -p $(shell dirname ${BIN_PATH}) mkdir -p $(shell dirname ${BIN_PATH})