Skip to content

Commit

Permalink
Add bundlesize checks to CI
Browse files Browse the repository at this point in the history
This adds a bundlesize check to the CI with very liberal tolerances for most of the chunks. It should identify egregious bundle size expansion and provide an easier path for manual comparison of master vs PRs.

Currently bundlesize doesn't work with GitHub actions out-of-the-box, but this is planned for their roadmap (and they've just got $10k from Google so I'm confident it will happen). Redux-saga seems to have this working via https://github.com/redux-saga/redux-saga/pull/1952/files.

We can revisit the settings here after the chunk hashing #1037.
  • Loading branch information
jameshadfield committed Apr 16, 2020
1 parent 307eb8e commit 9a36ad3
Show file tree
Hide file tree
Showing 4 changed files with 527 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,12 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run lint
bundlesize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10
- run: npm install
- run: npx bundlesize
12 changes: 12 additions & 0 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files": [
{
"path": "./dist/auspice.bundle.js",
"maxSize": "180 kB"
},
{
"path": "./dist/auspice.chunk.*.bundle.js",
"maxSize": "110 kB"
}
]
}
Loading

0 comments on commit 9a36ad3

Please sign in to comment.