Merig
Merig

Reputation: 2011

Necessary files in Next.js build

I wrote a Next.js app and I'm close to deploying. I would like to know what are the strictly necessary files to copy on the server to deploy while keeping it SSR (not statically generated with next export):

Upvotes: 3

Views: 1923

Answers (1)

felixmosh
felixmosh

Reputation: 35503

Copy .next folder with package.json && npm install --production should install only the dependencies of your app.

Keep the folder structure.

Side note, it is bad practice to copy node_modules between environments cause there are some packages that are os specific.

Upvotes: 7

Related Questions