Skip to content

Commit 9abef3a

Browse files
committed
(pouchdb#5962) - fix broken verify-bundle-size.sh script
1 parent ac49dd3 commit 9abef3a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/verify-bundle-size.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
# We might have to change this later.
55
MAX=50000
66

7-
SIZE=`gzip -c packages/node_modules/pouchdb/dist/pouchdb.min.js | wc -c`
7+
# testing pouchdb.js instead of pouchdb.min.js because minification isn't run in Travis
8+
# in order to make our builds faster
9+
SIZE=`./node_modules/.bin/uglifyjs -mc < packages/node_modules/pouchdb/dist/pouchdb.js 2>/dev/null | gzip -c | wc -c`
810

9-
echo "Checking that pouchdb.min.js size $SIZE is less than $MAX"
11+
echo "Checking that pouchdb.min.js size $SIZE is less than $MAX and greater than 20"
1012

11-
if [ "$SIZE" -lt "$MAX" ]; then
13+
if [ "$SIZE" -lt 21 ]; then
14+
echo Failure
15+
exit 1
16+
elif [ "$SIZE" -lt "$MAX" ]; then
1217
echo Success
1318
exit 0
1419
else

0 commit comments

Comments
 (0)