From 8dfe77e2d79ab974fa39ff7908669a71726ba186 Mon Sep 17 00:00:00 2001 From: samcx Date: Wed, 6 Nov 2024 14:41:39 -0800 Subject: [PATCH 1/2] docs(output): update standalone docs with cp and start commands --- .../03-api-reference/05-next-config-js/output.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/01-app/03-api-reference/05-next-config-js/output.mdx b/docs/01-app/03-api-reference/05-next-config-js/output.mdx index 26d5b8d3afb73..a9fa75987f906 100644 --- a/docs/01-app/03-api-reference/05-next-config-js/output.mdx +++ b/docs/01-app/03-api-reference/05-next-config-js/output.mdx @@ -35,6 +35,18 @@ This will create a folder at `.next/standalone` which can then be deployed on it Additionally, a minimal `server.js` file is also output which can be used instead of `next start`. This minimal server does not copy the `public` or `.next/static` folders by default as these should ideally be handled by a CDN instead, although these folders can be copied to the `standalone/public` and `standalone/.next/static` folders manually, after which `server.js` file will serve these automatically. +To copy these manually, you can use the `cp` command-line tool after you `next build`: + +```bash filename="Terminal" +cp -r .next/static .next/standalone/.next/ && cp -r public .next/standalone/ +``` + +To start your minimal `server.js` file locally, run the following command: + +```bash filename="Terminal" +node .next/standalone/server.js +``` + > **Good to know**: From bc44c7cff9f8574b985725e218fc4c865243ff1c Mon Sep 17 00:00:00 2001 From: samcx Date: Wed, 6 Nov 2024 14:45:43 -0800 Subject: [PATCH 2/2] docs(output): reverse of cp commands --- docs/01-app/03-api-reference/05-next-config-js/output.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/01-app/03-api-reference/05-next-config-js/output.mdx b/docs/01-app/03-api-reference/05-next-config-js/output.mdx index a9fa75987f906..344c6ea3d6ce3 100644 --- a/docs/01-app/03-api-reference/05-next-config-js/output.mdx +++ b/docs/01-app/03-api-reference/05-next-config-js/output.mdx @@ -38,7 +38,7 @@ Additionally, a minimal `server.js` file is also output which can be used instea To copy these manually, you can use the `cp` command-line tool after you `next build`: ```bash filename="Terminal" -cp -r .next/static .next/standalone/.next/ && cp -r public .next/standalone/ +cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/ ``` To start your minimal `server.js` file locally, run the following command: