-
SummaryHow come after building an app in standalone mode the output is missing folders? After building I have to manually
Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There's an explanation for this behaviour in the docs, https://nextjs.org/docs/app/api-reference/config/next-config-js/output:
And this command is suggested: cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/ Which means, you could create a |
Beta Was this translation helpful? Give feedback.
-
Oh yeah I already do that and it seems like I read that part in the docs yesterday, what I'm getting at is why have this behavior in the first place and expect the user to use a CDN. |
Beta Was this translation helpful? Give feedback.
Yeah, it is quite a common pattern, that after build, the static assets are copied/uploaded to a CDN, which can replicate them and what not, across edge locations, yada yada, you know the drill.
Whereas, your server tends to be a bit more centralised per region. There might even be a few servers running together to share loads, spinning up and down, etc... That's why standalone mode exists, to just get exactly what's needed for a server to run, so that it is easy to start them, and that they don't occupy too much disk space with their assets, yada yada