GitHub action that analyses the bundle sizes for each route in a Next.js build.
Add the following step to a workflow which runs on a pull_request event, after the Next.js project has been built (i.e. after running yarn build
).
- name: Analyze bundle sizes
uses: transferwise/actions-next-bundle-analyzer@master
with:
# Filename of the workflow this step is defined in
workflow-id: my-workflow.yml
# Optional, defaults to master
base-branch: master
env:
# This secret is automatically injected by GitHub
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
When the job runs on a pull request a comment will be added showing the bundle sizes of the branch and the difference against master:
Note: Difference to master will only be shown once this action has run on a master commit.
Compiled files must also be commited. After making changes to TypeScript files run
yarn build
Add both the source files and the new compiled files to your pull request.