Optimize Next.js build speed
Unanswered
Cuban Crocodile posted this in #help-forum
Cuban CrocodileOP
Hi!
We're using Next.js 14 and I wonder what steps I can take to analyze the build times.
We're working on updating to 15, but in the meantime I'm looking for other methods to analyze and improve build times.
We're using Next.js 14 and I wonder what steps I can take to analyze the build times.
We're working on updating to 15, but in the meantime I'm looking for other methods to analyze and improve build times.
18 Replies
you can try bun
for me it is 1s faster than node
it can be more tho
i only have a few files
from 3.1s to 2.1, and it loads faster too
Cuban CrocodileOP
Thanks, but I'm specifically looking to analyze the build time
I don't want to replace tools without knowing the impact
I don't want to replace tools without knowing the impact
so you don't change tools
just how you run it
for build time you can try see which scripts take long to compile (normally a lot of nested deps or very long and complex scripts)
@Cuban Crocodile Thanks, but I'm specifically looking to analyze the build time
I don't want to replace tools without knowing the impact
Barbary Lion
doesnt it show build times for each page in when u build?
turbopack will fix this in next 15
@Darkoplax turbopack will fix this in next 15
there is turbopack already in next 14 btw
@Diamond Master there is turbopack already in next 14 btw
oh i didnt know that
you just enable it a bit differently
Cuban CrocodileOP
I think turbopack is only for dev, no?
I tried running it in production but couldn't get it to work
I tried running it in production but couldn't get it to work
it does not rebuild every time like dev