question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JS Bundle size increased significantly since upgrade to 2.9.4 (~25k page site)

See original GitHub issue

Summary

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
piehcommented, Jun 21, 2019

@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?

0reactions
ConorLindsay94commented, Jul 30, 2019

Closing this as initial approach was incorrect with matchPath assignment.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found