Next.js Discord

Discord Forum

Make Javascript bundle smaller

Unanswered
Wuchang bream posted this in #help-forum
Open in Discord
Wuchang breamOP
Hey, is there a good way to make the JS bundle size smaller? I know that you can make the client components smaller, but I'm pretty sure that there's some unused code, for example I think react is imported as a whole etc.

10 Replies

Wuchang breamOP
now i found that just 1 client call can make js bundle 100kb larger
Wuchang breamOP
Dutch
haha welcome to node 😄
@Dutch haha welcome to node 😄
Wuchang breamOP
noo what happened :cpvpegzorcystawstrachu:
i see that theres preact, smaller replacement of react for example
@Wuchang bream i see that theres preact, smaller replacement of react for example
Dutch
yea, if it ends with it 😄
@Dutch yea, if it ends with it 😄
Wuchang breamOP
what you mean?
@Wuchang bream what you mean?
Dutch
basically you cant get rid of that bundle size easily
@Dutch basically you cant get rid of that bundle size easily
Wuchang breamOP
apparently you can with preact, but i dont know it yet
Wuchang breamOP
anyone have a good way to minimize these files? they are huuge