Skip to content

Commit 668c26f

Browse files
committed
ci: Tweak travis steps for danger/bundle size
1 parent 1bb4c2d commit 668c26f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ before_script:
77
- npx lerna run build --scope @bugsnag/browser
88
- cat packages/browser/dist/bugsnag.min.js | wc -c > .size/after-minified
99
- cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .size/after-gzipped
10+
- git reset --hard HEAD
11+
- git remote set-branches origin $TRAVIS_BRANCH
12+
- git fetch
1013
- git checkout $TRAVIS_BRANCH
1114
- npm ci
1215
- npx lerna bootstrap --ignore @bugsnag/expo

dangerfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ const after = {
1414

1515
const formatKbs = (n) => `${(n / 1000).toFixed(2)} kB`
1616

17-
const diffMinSize = before.minified - after.minified
18-
const diffZipSize = before.gzipped - after.gzipped
17+
const diffMinSize = after.minified - before.minified
18+
const diffZipSize = after.gzipped - before.gzipped
1919
const showDiff = n => {
20-
if (n > 0) return `⚠️ +${n} bytes ⬆️`
21-
if (n < 0) return `-${n} bytes ⬇️`
20+
if (n > 0) return `⚠️ \`+${n.toLocaleString()} bytes\``
21+
if (n < 0) return `\`${n.toLocaleString()} bytes\``
2222
return '_No change_'
2323
}
2424

0 commit comments

Comments
 (0)