[SEO] Enable webpack bundle analyzer for FCP optimization#7483
Open
megha1807 wants to merge 5 commits intolayer5io:masterfrom
Open
[SEO] Enable webpack bundle analyzer for FCP optimization#7483megha1807 wants to merge 5 commits intolayer5io:masterfrom
megha1807 wants to merge 5 commits intolayer5io:masterfrom
Conversation
Signed-off-by: megha1807 <meghakumarig5@gmail.com>
Signed-off-by: megha1807 <meghakumarig5@gmail.com>
Member
|
🚀 Preview for commit 166b997 at: https://69b188b2ba333400992d0d23--layer5.netlify.app |
leecalcote
reviewed
Mar 11, 2026
Member
leecalcote
left a comment
There was a problem hiding this comment.
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.
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>
a04d2b7 to
1c75ee7
Compare
Member
|
🚀 Preview for commit 447c1fb at: https://69b2316c420b024e953b5278--layer5.netlify.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-v2ingatsby-config.js.The plugin now runs only when the
ANALYZE_BUNDLEenvironment 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 developornpm start.Set the environment variable
ANALYZE_BUNDLE=trueand run the build command.The webpack bundle analyzer server should open automatically and display the bundle size visualization.
Related issue
Fixes #7157
Signed commits