diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2020-05-04 13:27:33 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2020-05-07 10:56:22 +0300 |
commit | 8b75f28999927c3c0f57193c235fb5b7ea57a0e1 (patch) | |
tree | 872b78307b862eddc8b6fe541a4ed73e4f1d30f0 /scripts/minify-assets.sh | |
parent | d2472131e95f6e52eb9bdf6a775e4eb977e68800 (diff) |
Minify the assets in the build base job
Diffstat (limited to 'scripts/minify-assets.sh')
-rwxr-xr-x | scripts/minify-assets.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/minify-assets.sh b/scripts/minify-assets.sh index 02562039..a0b5bfb7 100755 --- a/scripts/minify-assets.sh +++ b/scripts/minify-assets.sh @@ -2,6 +2,7 @@ TARGET="$1" VER="$2" +MINIFY_FLAGS="--html-keep-document-tags --html-keep-whitespace --recursive" if [ -z "$TARGET" -o -z "$VER" ]; then echo "Usage: $0 <target> <ver>" @@ -17,9 +18,9 @@ fi # Minify assets printf "Optimizing assets..." -printf "HTML..."; /scripts/minify -r --type=html --match=\.html -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true -printf "CSS..." ; /scripts/minify -r --type=css --match=\.css -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true -printf "JSON..."; /scripts/minify -r --type=json --match=\.json -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true -printf "SVG..." ; /scripts/minify -r --type=svg --match=\.svg -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true +printf "HTML..."; /scripts/minify $MINIFY_FLAGS --type=html --match=\.html -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true +printf "CSS..." ; /scripts/minify $MINIFY_FLAGS --type=css --match=\.css -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true +printf "JSON..."; /scripts/minify $MINIFY_FLAGS --type=json --match=\.json -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true +printf "SVG..." ; /scripts/minify $MINIFY_FLAGS --type=svg --match=\.svg -o ${TARGET}/${VER}/ ${TARGET}/${VER} || true echo "Done" |