JS Bundle size increased significantly since upgrade to 2.9.4 (~25k page site)
See original GitHub issueSummary
We have recently upgraded Gatsby from v2.3.4 to v2.9.4. We have since noticed a dramatic increase in the app[content-hash].js file size, it has gone from ~650kb to 3.1mb. After close inspection it is due to a massive array containing objects of matchPath
data:
{
path: "/path/example",
matchPath: "/path/example/*"
}
Is there a reason why this data is now built to the bundle app.js file now? On the previous version we don’t get anything like this in the bundled js.
Relevant information
- Our site contains ~25k pages, each with a matchPath set for dynamic routing.
- We have static sub-router entry points for a large majority of these pages, as in our Router sits in the template passed to
createPage
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Significant bundle size increase after switching to v13.0.3
This gives 8-9% increase in the First Load JS, just for the starter app. For the apps I am working on, upgrade to...
Read more >5 Methods to Reduce JavaScript Bundle Size - Bits and Pieces
Compressing Bundles. If your application bundle size increases and affects performance, you can compress them to reduce the size. Gzip and ...
Read more >TS increase the bundle size of my site significantly - Reddit
I've just migrated my site to TS and immediately noticed the bundle size is increased by nearly 100KB. I took a look at...
Read more >How to Reduce Your Webpack Bundle Size for Web App ...
Written Tutorial:http://go.ipenywis.com/howto4dabcOur Udemy Courses:Let's Create A Nodejs Desktop Chat Application(React/Socket) ...
Read more >Small Bundles, Fast Pages: What To Do With Too Much ...
This post will explain why bundle size matters and recommend tools and processes you can follow to monitor, visualise, and most importantly, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ConorLindsay94 Previously it was in separate file (
pages-manifest
), but still was loaded eagerly.This is not easy thing to solve. Can you provide some details on why you want to create 25k pages with
matchPath
instead of single one?Closing this as initial approach was incorrect with
matchPath
assignment.