Thank you for the demo. I had to make a few tweaks to get it to work on windows so thought I would post my changes to size_report.sh
I added printing the file sizes to a text file and moving the .gz and .brotli zone.js files to the dist directory
#!/usr/bin/env node
echo > build-report.txt
rootdir=dist
\# measure the sizes of scripts and move as needed
for script in dist/bundle.js node_modules/zone.js/dist/zone.min.js; do
\# copy to temp
cp $script $script.bak
gzip -f $script
mv $script.bak $script
\# requires brotli.exe and environment path
brotli --force --quality 10 --input $script --output $script.brotli
brotlifilename=${script}.brotli
gzfilename=${script}.gz
brotlifilesize=$(du -b "$brotlifilename" | awk '{print $1}')
gzfilesize=$(du -b "$gzfilename" | awk '{print $1}')
echo ${brotlifilename} = ${brotlifilesize} >> build-report.txt
echo ${gzfilename} = ${gzfilesize} >> build-report.txt
\# copy zone.min.js to dist
[[ $script == n* ]]
cp $script dist/zone.min.js
\# copy gzip and brotli versions of zone.js to dist
[[ $brotlifilename == n* ]]
mv $brotlifilename $rootdir
[[ $gzfilename == n* ]]
mv $gzfilename $rootdir
done
Thank you for the demo. I had to make a few tweaks to get it to work on windows so thought I would post my changes to size_report.sh I added printing the file sizes to a text file and moving the .gz and .brotli zone.js files to the dist directory