Next.js Discord

Discord Forum

Can turborepo remotely cache build output of a route to speed up builds in CI?

Unanswered
Common paper wasp posted this in #help-forum
Open in Discord
Common paper waspOP
Can turborepo be used to remotely cache the build output of a route in a large nextjs app router-based web app? For example:

/admin
/reports
/search

Is it possible that all code related to the route and nested routes could produce an independent build output that could be remotely cached by turborepo? The idea being that if someone changes code related to one route, but didn’t change code in another route, they would not have to wait for the other route code to rebuild and could just retrieve the build output from the cache?

It seems possible if the app was a multizone app with separate apps running at each route and rewrites configured to stitch it all together. Then each app would have its own .next directory build output path that could be remotely cached. But is it possible to take one nextjs app and have separate packages for all the route component code that produces a build output to be remotely cached? It seems like next needs context on the nesting of a route to properly generate client chunks, react server components, etc. So I’m not sure and I don’t see any examples that seem to do this.

Thanks for reading and any help clearing up my confusion.

1 Reply