Skip to content

[SEO] Enable webpack bundle analyzer for FCP optimization#7483

Open
megha1807 wants to merge 5 commits intolayer5io:masterfrom
megha1807:fcp-webpack-analyzer
Open

[SEO] Enable webpack bundle analyzer for FCP optimization#7483
megha1807 wants to merge 5 commits intolayer5io:masterfrom
megha1807:fcp-webpack-analyzer

Conversation

@megha1807
Copy link
Contributor

Description
This PR conditionally enables the webpack bundle analyzer to help analyze bundle size and improve performance metrics such as First Contentful Paint (FCP).

Changes Made
Added conditional configuration for gatsby-plugin-webpack-bundle-analyser-v2 in gatsby-config.js.
The plugin now runs only when the ANALYZE_BUNDLE environment variable is set, ensuring that regular builds remain unaffected.
This allows developers to inspect the webpack bundle composition and identify optimization opportunities.

Files changed
gatsby-config.js

How to test
Run the project locally using npm run develop or npm start.
Set the environment variable ANALYZE_BUNDLE=true and run the build command.
The webpack bundle analyzer server should open automatically and display the bundle size visualization.

Related issue
Fixes #7157

Signed commits

  • Yes, I signed my commits.

Signed-off-by: megha1807 <meghakumarig5@gmail.com>
Signed-off-by: megha1807 <meghakumarig5@gmail.com>
@l5io
Copy link
Member

l5io commented Mar 11, 2026

🚀 Preview for commit 166b997 at: https://69b188b2ba333400992d0d23--layer5.netlify.app

Copy link
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, @megha1807. You know what would accompany this enhancement well?

A new make target: make site-analyze, in which this new env var is enabled.

@megha1807
Copy link
Contributor Author

Thanks for the suggestion @leecalcote ! I’ll add a new make site-analyze target with the env var enabled and push an update shortly.

Signed-off-by: megha1807 <meghakumarig5@gmail.com>
@megha1807 megha1807 force-pushed the fcp-webpack-analyzer branch from a04d2b7 to 1c75ee7 Compare March 12, 2026 03:03
@l5io
Copy link
Member

l5io commented Mar 12, 2026

🚀 Preview for commit 447c1fb at: https://69b2316c420b024e953b5278--layer5.netlify.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEO Enhancement for Kanvas Designer Page

3 participants