diff --git a/aio/scripts/payload-limit.sh b/aio/scripts/payload-limit.sh new file mode 100755 index 0000000000..a9e032c4ed --- /dev/null +++ b/aio/scripts/payload-limit.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +declare -A limitUncompressed +limitUncompressed=(["0"]=16000 ["inline"]=1600 ["main"]=360000 ["polyfills"]=40000 ["vendor"]=520000) +declare -A limitGzip7 +limitGzip7=(["0"]=7000 ["inline"]=1000 ["main"]=60000 ["polyfills"]=13000 ["vendor"]=120000) +declare -A limitGzip9 +limitGzip9=(["0"]=7000 ["inline"]=1000 ["main"]=60000 ["polyfills"]=13000 ["vendor"]=120000) diff --git a/aio/scripts/payload.sh b/aio/scripts/payload.sh index d384de826b..875a92cb47 100755 --- a/aio/scripts/payload.sh +++ b/aio/scripts/payload.sh @@ -14,12 +14,12 @@ for filename in dist/*.bundle.js; do payloadData="$payloadData\"uncompressed/$label\": $size, " - gzip -7 --keep -f $filename - size7=$(stat -c%s "$filename.gz") + gzip -7 $filename -c >> "${filename}7.gz" + size7=$(stat -c%s "${filename}7.gz") payloadData="$payloadData\"gzip7/$label\": $size7, " - gzip -9 --keep -f $filename - size9=$(stat -c%s "$filename.gz") + gzip -9 $filename -c >> "${filename}9.gz" + size9=$(stat -c%s "${filename}9.gz") payloadData="$payloadData\"gzip9/$label\": $size9, " if [[ $size -gt ${limitUncompressed[$label]} ]]; then