Skip to content

Github Action that analyses page bundle sizes from a Next.js build

Notifications You must be signed in to change notification settings

transferwise/actions-next-bundle-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

actions-next-bundle-analyzer

GitHub action that analyses the bundle sizes for each route in a Next.js build.

Usage

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:

image

Note: Difference to master will only be shown once this action has run on a master commit.

Contributing

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.

About

Github Action that analyses page bundle sizes from a Next.js build

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published