Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN git clone --depth 1 https://github.com/AOMediaCodec/libavif.git && \
cd /usr/local/bin && \
ln -s /libavif/build/avifenc

RUN npm install -g svgo uglify-js
RUN npm install -g svgo uglify-js clean-css-cli

COPY cmd/alt_path /cmd/alt_path
RUN (cd /cmd/alt_path && go get && go build -o /usr/local/bin/alt_path)
Expand Down
16 changes: 16 additions & 0 deletions compress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ JS_FILES=$(
-printf '%P\n' \
)

CSS_FILES=$(
find . -type f \
-iname '*.css' \
-size +1 \
-printf '%P\n' \
)

COMPRESSIBLE_FILES=$(
find . -type f \
-not -iname '*.gif' \
Expand Down Expand Up @@ -308,6 +315,15 @@ minify_js() { FILE=$1

foreach "$JS_FILES" minify_js

## minify css files

minify_css() { FILE=$1
cleancss -o "$FILE.cleancss" -- "$FILE" || rm -f "$FILE.cleancss"
mv -f "$FILE.cleancss" "$FILE"
}

foreach "$CSS_FILES" minify_css

## precompress uncompressed files

wait # some files that we need to compress may still be being worked on
Expand Down