hashicorp / hashicorp/nextjs-bundle-analysis

tutorial : using the appdir directory

Open
#83 7 comments 26 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
674
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Hello everyone, just like issue #42 I wanted to run the bundle analysis in the app directory.

I modified the script to make it work with it instead of pages dir. I didn't bother make it work for both scenarios because I only use appdir.

Here's how you can have it too :

First, install the required dependencies:
```
yarn add -D gzip-size@6 mkdirp
```

Then, you need to copy this gist : https://gist.github.com/raphaelbadia/1fbc948928378a4ce0e1ce90923263ae to a file in your repository. I called it `report-bundle-size.js`

Finally, open your nextjs_bundle_analysis.yml, find the action with name "- name: Analyze bundle" and replace `npx -p nextjs-bundle-analysis report` by `node report-bundle-size.js`

Result :
CleanShot 2023-09-04 at 12 08 21@2x

Cheers

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.