Skip to content

tutorial : using the appdir directory #83

@raphaelbadia

Description

@raphaelbadia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions