Skip to content

Commit

Permalink
add crude build size script
Browse files Browse the repository at this point in the history
  • Loading branch information
makeusabrew committed Oct 11, 2013
1 parent bdc1670 commit 466c13b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ bootbox.min.js
.idea
tests/reports
tests/coverage
build/size.csv
14 changes: 14 additions & 0 deletions build/calculate-size
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env zsh

SRC="bootbox.js"
MIN="/tmp/bootbox.min.js"

uglifyjs $SRC -c -m > $MIN

RAW="$(wc -c $SRC | awk '{print $1}')"
MRAW="$(wc -c $MIN | awk '{print $1}')"
GZIP="$(cat $SRC | gzip | wc -c | awk '{print $1}')"
MGZIP="$(cat $MIN | gzip | wc -c | awk '{print $1}')"

echo "raw,min,raw+gzip,min+gzip\n$RAW,$MRAW,$GZIP,$MGZIP" > build/size.csv
rm $MIN

0 comments on commit 466c13b

Please sign in to comment.