ci(aio): Refactored payload size script, add script to track payload (#18517)
PR Close #18517
This commit is contained in:
19
integration/_payload-limits.sh
Normal file
19
integration/_payload-limits.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -u -e -o pipefail
|
||||
|
||||
declare -A payloadLimits
|
||||
payloadLimits["hello_world__closure", "uncompressed", "bundle"]=106000
|
||||
payloadLimits["hello_world__closure", "gzip7", "bundle"]=35000
|
||||
payloadLimits["hello_world__closure", "gzip9", "bundle"]=35000
|
||||
|
||||
payloadLimits["cli-hello-world", "uncompressed", "inline"]=1500
|
||||
payloadLimits["cli-hello-world", "uncompressed", "main"]=183000
|
||||
payloadLimits["cli-hello-world", "uncompressed", "polyfills"]=63000
|
||||
payloadLimits["cli-hello-world", "gzip7", "inline"]=900
|
||||
payloadLimits["cli-hello-world", "gzip7", "main"]=48000
|
||||
payloadLimits["cli-hello-world", "gzip7", "polyfills"]=21000
|
||||
payloadLimits["cli-hello-world", "gzip9", "inline"]=900
|
||||
payloadLimits["cli-hello-world", "gzip9", "main"]=48000
|
||||
payloadLimits["cli-hello-world", "gzip9", "polyfills"]=21000
|
||||
|
@ -4,6 +4,10 @@ set -e -o pipefail
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
# Track payload size functions
|
||||
source ../scripts/ci/payload-size.sh
|
||||
source ./_payload-limits.sh
|
||||
|
||||
# Workaround https://github.com/yarnpkg/yarn/issues/2165
|
||||
# Yarn will cache file://dist URIs and not update Angular code
|
||||
readonly cache=.yarn_local_cache
|
||||
@ -34,7 +38,17 @@ for testDir in $(ls | grep -v node_modules) ; do
|
||||
cd $testDir
|
||||
# Workaround for https://github.com/yarnpkg/yarn/issues/2256
|
||||
rm -f yarn.lock
|
||||
rm -rf dist
|
||||
yarn install --cache-folder ../$cache
|
||||
yarn test || exit 1
|
||||
# Track payload size for cli-hello-world and hello_world__closure
|
||||
if [[ $testDir == cli-hello-world ]] || [[ $testDir == hello_world__closure ]]; then
|
||||
if [[ $testDir == cli-hello-world ]]; then
|
||||
yarn build
|
||||
fi
|
||||
trackPayloadSize "$testDir" "dist/*.js" true false
|
||||
fi
|
||||
)
|
||||
done
|
||||
|
||||
trackPayloadSize "umd" "../dist/packages-dist/*/bundles/*.umd.min.js" false false
|
||||
|
Reference in New Issue
Block a user