Next.js Discord

Discord Forum

What is the true page size?

Unanswered
Raymond posted this in #help-forum
Open in Discord
I have a page that renders like this
return <>
   <SomeComponent />
   {is_logged_in && <VeryBigComponent />}
</>

let's say SomeComponent is 100 kb and VeryBigComponent is 5000 mb. After running npm run build, this page will have a first load JS size of ~5.1 mb.

In production, if is_logged_in is false, will the actual size of the file load still be around 5.1 mb or closer to 100 kb?

0 Replies