ci(aio): Add payload size limit file
This commit is contained in:
parent
0440251919
commit
204a2cf942
|
@ -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)
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue