Caching NextJs builds #27260
Unanswered
Djontleman
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When building our NextJs applications in our Nx monorepo, we are currently storing the builds in the GH Actions cache. What we have is currently base on what NextJs recommends in their docs on CI build caching (source files prefixed with the app root).
The problem with this is that the code for apps doesn't just exist in the respective app's folder. Most of the code lives in various shared and app-specific libraries so constructing a truly accurate cache key would be quite difficult.
I have also been looking into using Nx caching for the build, but this command by default seems to cache everything and not just what is put in to the NextJs cache. This means that there may be problems when we try and change environment variables used at build time. (Potentially other problems but that's the main one I'm thinking of).
Is there a recommend for this, or has anyone managed to get a good setup working for this?
Beta Was this translation helpful? Give feedback.
All reactions