From 0ac757d1c02a1492c1c892ef5fffe2c9016abdd2 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Mon, 3 Feb 2020 23:25:50 -0800 Subject: [PATCH 01/17] Update deploy docs to surface ZEIT Now / DPS --- docs/advanced-features/static-html-export.md | 4 - docs/deployment.md | 117 ++++++++----------- 2 files changed, 46 insertions(+), 75 deletions(-) diff --git a/docs/advanced-features/static-html-export.md b/docs/advanced-features/static-html-export.md index 4b2f09da7c1cf22..4e00b3ebfbd201c 100644 --- a/docs/advanced-features/static-html-export.md +++ b/docs/advanced-features/static-html-export.md @@ -47,10 +47,6 @@ By default `next export` doesn't require any configuration. It will generate a d > To learn more about `exportPathMap` please visit the [documentation for the `exportPathMap` API](/docs/api-reference/next.config.js/exportPathMap.md). -## Deployment - -You can read about deploying your Next.js application in the [deployment section](/docs/deployment.md). - ## Caveats - With `next export`, we build an HTML version of your app. At export time we will run the [`getInitialProps`](/docs/api-reference/data-fetching/getInitialProps.md) in your pages. The `req` and `res` fields of the [`context`](/docs/api-reference/data-fetching/getInitialProps.md#context-object) object will be empty objects during export as there is no server running. diff --git a/docs/deployment.md b/docs/deployment.md index 17e82c01f762196..6188728bf200a30 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -4,102 +4,77 @@ description: Compile and deploy your Next.js app to production with ZEIT Now and # Deployment -To go to production Next.js has a `next build` command. When run, it will compile your project and automatically apply numerous optimizations. +## ZEIT Now (Recommended) -## Prepare your package.json +The easiest way to deploy Next.js to production is using the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with global CDN that supports as static & JAMstack deployment and serverless functions. -Ensure your `package.json` has the `"build"` and `"start"` scripts: - -```json -{ - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start" - } -} -``` - -In the case that you'd want to do a [full static export](/docs/advanced-features/static-html-export.md) of the Next.js application add `next export` to the `"build"` script: - -```json -{ - "scripts": { - "dev": "next", - "build": "next build && next export", - "start": "next start" - } -} -``` +### Getting started -## ZEIT Now +If you haven’t already done so, push your Next.js app to a Git provider of your choice: [GitHub](http://github.com/), [GitLab](https://gitlab.com/), or [BitBucket](https://bitbucket.org/). Your repository can be private or public. -The easiest way to deploy Next.js to production is using the [ZEIT Now platform](https://zeit.co) from the creators of Next.js. +Then, follow these steps: -### Preview deployments +1. [Sign up to ZEIT Now](https://zeit.co/signup) (no credit card is required). +2. After signing up, you’ll be on the [“Create a new project”](https://zeit.co/new) page. Under “From your existing code”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://zeit.co/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://zeit.co/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://zeit.co/docs/v2/git-integrations/zeit-now-for-bitbucket)). +3. Once that’s set up, click “New Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything—everything just works! +4. After importing, it’ll deploy your Next.js app and give you a deployment URL. Click “Visit” to see your app in production. -ZEIT Now integrates directly with GitHub, GitLab, and Bitbucket to give you a unique shareable url for every commit and every pull request. This url can be shared with customers and can be used to run integration tests against. +Congratulations! You’ve just deployed your Next.js app! If you have questions, take a look at the [ZEIT Now documentation](https://zeit.co/docs). -### Hybrid Next.js +> If you’re using a [custom server](/docs/advanced-features/custom-server.md) (which we don’t recommend), consider [other hosting options](#other-hosting-options). -The [hybrid pages](/docs/basic-features/pages.md) approach is fully supported out of the box. Meaning that every page can either use [Static Generation](/docs/basic-features/pages.md#static-generation) or [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering). +### DPS: Develop, Preview, Ship -In case of [Static Generation](/docs/basic-features/pages.md#static-generation) the page will automatically be served from the ZEIT Now Smart CDN. +Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip: -When the page is using [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) it will become an isolated serverless function automatically. This allows the page rendering to scale automatically and be independent—errors on one page won't affect another. +- **Develop:** When you work on something new, create a new Git branch and push to GitHub / GitLab / BitBucket. +- **Preview:** Every time you push changes to a branch, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). +- **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment. -API routes will also become separate serverless functions that execute and scale separately from each other. +By using the DPS workflow, instead of doing _code reviews_, your can do _deployment previews_. Each deployment creates a unique URL which can be shared or used for integration tests. -### CDN + HTTPS by default +### Optimized for Next.js -Assets (JavaScript, CSS, images, fonts etc) and Statically Generated pages are automatically served through the ZEIT Now Smart CDN, ensuring these are always served close to your users. +[ZEIT Now](https://zeit.co) is made by the creators of Next.js. That means it has various optimizations specifically for Next.js. -HTTPS is enabled by default and doesn't require extra configuration. +For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully supported out of the box. -### Getting started +- Every page can either use [Static Generation](/docs/basic-features/pages.md#static-generation) or [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering). +- Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts etc) will automatically be served from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn), which is blazingly fast. +- Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated serverless functions. This allows page rendering and API requests to scale infinitely. -#### From a git repository +### Custom Domains, Environment Variables, and more -You can link your project in [GitHub](https://zeit.co/new), [GitLab](https://zeit.co/new), or [Bitbucket](https://zeit.co/new) through the [web interface](https://zeit.co/new). This will automatically set up deployment previews for pull requests and commits. To learn more about ZEIT Now’s Git integration, take a look at [our documentation here](https://zeit.co/docs/v2/git-integration/). +- **Custom Domains:** Once deployed on [ZEIT Now](https://zeit.co), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://zeit.co/docs/v2/custom-domains). Note that HTTPS is enabled by default (including custom domains) and doesn't require extra configuration. +- **Environment Variables:** You can also set environment variables on ZEIT Now. Take a look at [our documentation here](https://zeit.co/docs/v2/build-step#using-environment-variables-and-secrets). You can then [use those environment variables](/docs/api-reference/next.config.js/environment-variables.md) in your Next.js app. +- **More:** [Read our documentation](https://zeit.co/docs) to learn more about the ZEIT Now platform. You can deploy non-Next.js apps to ZEIT Now as well—[check out our how-to guides](https://zeit.co/guides). -#### Through the ZEIT Now CLI +## Other hosting options -You can install [Now CLI](https://zeit.co/download) from either npm or Yarn. Using npm, run the following command from your terminal: +### Node.js Server -```bash -npm install -g now -``` +Next.js can be deployed to any hosting provider that supports Node.js. This is the approach you should take if you’re using a [custom server](/docs/advanced-features/custom-server.md). -You can deploy your application by running the following command in the root of the project directory: +Make sure your `package.json` has `build` and `start` scripts: -```bash -now +```json +{ + "scripts": { + "dev": "next", + "build": "next build", + "start": "next start" + } +} ``` -You will receive a unique link similar to the following: https://your-project.username.now.sh. - -#### Custom domains - -Once deployed on ZEIT Now, your projects can be assigned to a custom domain of your choice. To learn more, take a look at [our documentation here](https://zeit.co/docs/v2/custom-domains/). - -## Self hosting - -Next.js can be deployed to any hosting provider that supports Node.js. In order to self-host there are two commands: `next build` and `next start`. - -`next build` builds the production application in the `.next` folder. - -`next start` starts a Node.js server that supports [hybrid pages](/docs/basic-features/pages.md), serving both statically generated and server-side rendered pages. +`build` builds the production application in the `.next` folder. After building, `start` starts a Node.js server that supports [hybrid pages](/docs/basic-features/pages.md), serving both statically generated and server-side rendered pages. -Generally you'll have to follow these steps to deploy to production: +> -- Run `npm install` -- Run `npm run build` (runs `next build`) -- Potentially copy the `.next`, `node_modules`, and `package.json` to your server. -- Run `npm run start` (runs `next start`) on the server +### Static HTML Export -In case you're doing a full static export using `next export` the steps are slightly different and don't involve using `next start`: +If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). By default, `next export` will generate an `out` directory, which can be served by any static site server. -- Run `npm install` -- Run `npm run build` (runs `next build && next export`) -- A `out` directory is generated by `next export` -- Copy the `out` directory to the server and make sure it's served by your server +> We strongly recommend using [ZEIT Now](https://zeit.co/) even if your Next.js app is fully static. [ZEIT Now](https://zeit.co/) is optimized to make static Next.js apps blazingly fast. +> +> **Note:** If you use [ZEIT Now](https://zeit.co/), you don’t need to use `next export`. It’ll automatically serve all pages from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn). From e83c9c9594bd0ee86e278b4ac512600a25b79538 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 4 Feb 2020 09:04:21 -0800 Subject: [PATCH 02/17] Undo removal of deployment section from static export --- docs/advanced-features/static-html-export.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/advanced-features/static-html-export.md b/docs/advanced-features/static-html-export.md index 4e00b3ebfbd201c..4b2f09da7c1cf22 100644 --- a/docs/advanced-features/static-html-export.md +++ b/docs/advanced-features/static-html-export.md @@ -47,6 +47,10 @@ By default `next export` doesn't require any configuration. It will generate a d > To learn more about `exportPathMap` please visit the [documentation for the `exportPathMap` API](/docs/api-reference/next.config.js/exportPathMap.md). +## Deployment + +You can read about deploying your Next.js application in the [deployment section](/docs/deployment.md). + ## Caveats - With `next export`, we build an HTML version of your app. At export time we will run the [`getInitialProps`](/docs/api-reference/data-fetching/getInitialProps.md) in your pages. The `req` and `res` fields of the [`context`](/docs/api-reference/data-fetching/getInitialProps.md#context-object) object will be empty objects during export as there is no server running. From 1dfcb432ae8d34cd7c159d21172bd798c7881523 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 4 Feb 2020 09:18:26 -0800 Subject: [PATCH 03/17] Update description slightly --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index 6188728bf200a30..cdc071854cf3d74 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -1,5 +1,5 @@ --- -description: Compile and deploy your Next.js app to production with ZEIT Now and other hosting alternatives. +description: Deploy your Next.js app to production with ZEIT Now and other hosting options. --- # Deployment From 9cc204ba809fa711b3116e5f92b55e0c208d2ff0 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 4 Feb 2020 10:01:44 -0800 Subject: [PATCH 04/17] Wordsmith --- docs/deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index cdc071854cf3d74..8c343e87b98bf75 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -27,8 +27,8 @@ Congratulations! You’ve just deployed your Next.js app! If you have questions, Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip: -- **Develop:** When you work on something new, create a new Git branch and push to GitHub / GitLab / BitBucket. -- **Preview:** Every time you push changes to a branch, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). +- **Develop:** When you work on something new, create a new Git branch. +- **Preview:** Every time you push changes to GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). - **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment. By using the DPS workflow, instead of doing _code reviews_, your can do _deployment previews_. Each deployment creates a unique URL which can be shared or used for integration tests. From 328a722d5d8aee53e9196f35c3c9b3230d1a9406 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Wed, 5 Feb 2020 08:53:27 -0800 Subject: [PATCH 05/17] Wordsmith --- docs/deployment.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 8c343e87b98bf75..09b8b3ab829c0c6 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -6,7 +6,7 @@ description: Deploy your Next.js app to production with ZEIT Now and other hosti ## ZEIT Now (Recommended) -The easiest way to deploy Next.js to production is using the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with global CDN that supports as static & JAMstack deployment and serverless functions. +The easiest way to deploy Next.js to production is using the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and serverless functions. ### Getting started @@ -35,7 +35,7 @@ By using the DPS workflow, instead of doing _code reviews_, your can do _deploym ### Optimized for Next.js -[ZEIT Now](https://zeit.co) is made by the creators of Next.js. That means it has various optimizations specifically for Next.js. +[ZEIT Now](https://zeit.co) is made by the creators of Next.js and has first-class support for Next.js. For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully supported out of the box. @@ -43,10 +43,11 @@ For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully - Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts etc) will automatically be served from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn), which is blazingly fast. - Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated serverless functions. This allows page rendering and API requests to scale infinitely. -### Custom Domains, Environment Variables, and more +### Custom Domains, Environment Variables, Automatic HTTPS, and more -- **Custom Domains:** Once deployed on [ZEIT Now](https://zeit.co), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://zeit.co/docs/v2/custom-domains). Note that HTTPS is enabled by default (including custom domains) and doesn't require extra configuration. +- **Custom Domains:** Once deployed on [ZEIT Now](https://zeit.co), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://zeit.co/docs/v2/custom-domains). - **Environment Variables:** You can also set environment variables on ZEIT Now. Take a look at [our documentation here](https://zeit.co/docs/v2/build-step#using-environment-variables-and-secrets). You can then [use those environment variables](/docs/api-reference/next.config.js/environment-variables.md) in your Next.js app. +- **Automatic HTTPS:** HTTPS is enabled by default (including custom domains) and doesn't require extra configuration. We auto-renew SSL certificates. - **More:** [Read our documentation](https://zeit.co/docs) to learn more about the ZEIT Now platform. You can deploy non-Next.js apps to ZEIT Now as well—[check out our how-to guides](https://zeit.co/guides). ## Other hosting options From b68a6c83a25a5800fa0ec3a40f8d11f03c50a5b4 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 09:37:15 -0800 Subject: [PATCH 06/17] Capitalize Serverless Functions --- docs/deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 09b8b3ab829c0c6..de70e830007d319 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -6,7 +6,7 @@ description: Deploy your Next.js app to production with ZEIT Now and other hosti ## ZEIT Now (Recommended) -The easiest way to deploy Next.js to production is using the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and serverless functions. +The easiest way to deploy Next.js to production is using the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions. ### Getting started @@ -41,7 +41,7 @@ For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully - Every page can either use [Static Generation](/docs/basic-features/pages.md#static-generation) or [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering). - Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts etc) will automatically be served from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn), which is blazingly fast. -- Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated serverless functions. This allows page rendering and API requests to scale infinitely. +- Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated Serverless Functions. This allows page rendering and API requests to scale infinitely. ### Custom Domains, Environment Variables, Automatic HTTPS, and more From 380690b5f890ad5512a6819d1457ad66d1328c5a Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 09:42:04 -0800 Subject: [PATCH 07/17] Wordsmith --- docs/deployment.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index de70e830007d319..fb921003569c665 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -6,7 +6,7 @@ description: Deploy your Next.js app to production with ZEIT Now and other hosti ## ZEIT Now (Recommended) -The easiest way to deploy Next.js to production is using the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions. +The easiest way to deploy Next.js to production is to use the **[ZEIT Now platform](https://zeit.co)** from the creators of Next.js. [ZEIT Now](https://zeit.co) is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions. ### Getting started @@ -31,7 +31,7 @@ Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) - **Preview:** Every time you push changes to GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). - **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment. -By using the DPS workflow, instead of doing _code reviews_, your can do _deployment previews_. Each deployment creates a unique URL which can be shared or used for integration tests. +By using the DPS workflow, instead of doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests. ### Optimized for Next.js @@ -40,7 +40,7 @@ By using the DPS workflow, instead of doing _code reviews_, your can do _deploym For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully supported out of the box. - Every page can either use [Static Generation](/docs/basic-features/pages.md#static-generation) or [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering). -- Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts etc) will automatically be served from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn), which is blazingly fast. +- Pages that use [Static Generation](/docs/basic-features/pages.md#static-generation) and assets (JS, CSS, images, fonts, etc) will automatically be served from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn), which is blazingly fast. - Pages that use [Server-Side Rendering](/docs/basic-features/pages.md#server-side-rendering) and [API routes](/docs/api-routes/introduction.md) will automatically become isolated Serverless Functions. This allows page rendering and API requests to scale infinitely. ### Custom Domains, Environment Variables, Automatic HTTPS, and more From 0c065e1799e440b15206af7f2eee4cd4ffa19eb8 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 10:17:57 -0800 Subject: [PATCH 08/17] Update docs/deployment.md Co-Authored-By: Luis Alvarez D. --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index fb921003569c665..8d02024a5003c6e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -56,7 +56,7 @@ For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully Next.js can be deployed to any hosting provider that supports Node.js. This is the approach you should take if you’re using a [custom server](/docs/advanced-features/custom-server.md). -Make sure your `package.json` has `build` and `start` scripts: +Make sure your `package.json` has the `"build"` and `"start"` scripts: ```json { From d6550a5d39f66005adfa5ecfac191efeb8114014 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 10:18:21 -0800 Subject: [PATCH 09/17] Update docs/deployment.md Co-Authored-By: Luis Alvarez D. --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index 8d02024a5003c6e..e220da1c6ac3c7e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -68,7 +68,7 @@ Make sure your `package.json` has the `"build"` and `"start"` scripts: } ``` -`build` builds the production application in the `.next` folder. After building, `start` starts a Node.js server that supports [hybrid pages](/docs/basic-features/pages.md), serving both statically generated and server-side rendered pages. +`next build` builds the production application in the `.next` folder. After building, `next start` starts a Node.js server that supports [hybrid pages](/docs/basic-features/pages.md), serving both statically generated and server-side rendered pages. > From 227dc499ac1b2bcad1750f872d5acf0e28457c41 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 10:23:14 -0800 Subject: [PATCH 10/17] Update deployment.md --- docs/deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index e220da1c6ac3c7e..ff31e942a38516f 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -48,7 +48,7 @@ For example, the [hybrid pages](/docs/basic-features/pages.md) approach is fully - **Custom Domains:** Once deployed on [ZEIT Now](https://zeit.co), you can assign a custom domain to your Next.js app. Take a look at [our documentation here](https://zeit.co/docs/v2/custom-domains). - **Environment Variables:** You can also set environment variables on ZEIT Now. Take a look at [our documentation here](https://zeit.co/docs/v2/build-step#using-environment-variables-and-secrets). You can then [use those environment variables](/docs/api-reference/next.config.js/environment-variables.md) in your Next.js app. - **Automatic HTTPS:** HTTPS is enabled by default (including custom domains) and doesn't require extra configuration. We auto-renew SSL certificates. -- **More:** [Read our documentation](https://zeit.co/docs) to learn more about the ZEIT Now platform. You can deploy non-Next.js apps to ZEIT Now as well—[check out our how-to guides](https://zeit.co/guides). +- **More:** [Read our documentation](https://zeit.co/docs) to learn more about the ZEIT Now platform. ## Other hosting options @@ -74,7 +74,7 @@ Make sure your `package.json` has the `"build"` and `"start"` scripts: ### Static HTML Export -If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). By default, `next export` will generate an `out` directory, which can be served by any static site server. +If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). By default, `next export` will generate an `out` directory, which can be served by any static hosting service or CDN. > We strongly recommend using [ZEIT Now](https://zeit.co/) even if your Next.js app is fully static. [ZEIT Now](https://zeit.co/) is optimized to make static Next.js apps blazingly fast. > From bac485eb584c9db542f1fc8d6deabdc3ecce28ef Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 10:24:23 -0800 Subject: [PATCH 11/17] Update deployment.md --- docs/deployment.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index ff31e942a38516f..fe013039867b750 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -70,8 +70,6 @@ Make sure your `package.json` has the `"build"` and `"start"` scripts: `next build` builds the production application in the `.next` folder. After building, `next start` starts a Node.js server that supports [hybrid pages](/docs/basic-features/pages.md), serving both statically generated and server-side rendered pages. -> - ### Static HTML Export If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). By default, `next export` will generate an `out` directory, which can be served by any static hosting service or CDN. From baaa205ce3c32cd4e707fcbcd5a3e10c671e463a Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 14:46:07 -0800 Subject: [PATCH 12/17] Update docs/deployment.md Co-Authored-By: Leo Lamprecht --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index fe013039867b750..0174605483708ce 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -15,7 +15,7 @@ If you haven’t already done so, push your Next.js app to a Git provider of you Then, follow these steps: 1. [Sign up to ZEIT Now](https://zeit.co/signup) (no credit card is required). -2. After signing up, you’ll be on the [“Create a new project”](https://zeit.co/new) page. Under “From your existing code”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://zeit.co/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://zeit.co/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://zeit.co/docs/v2/git-integrations/zeit-now-for-bitbucket)). +2. After signing up, you’ll arrive on the [“Create a new project”](https://zeit.co/new) page. Under “From your existing code”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://zeit.co/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://zeit.co/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://zeit.co/docs/v2/git-integrations/zeit-now-for-bitbucket)). 3. Once that’s set up, click “New Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything—everything just works! 4. After importing, it’ll deploy your Next.js app and give you a deployment URL. Click “Visit” to see your app in production. From 3b14cd8dc6ff50ea9505d17b04ccca6bdbb1325f Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 14:46:23 -0800 Subject: [PATCH 13/17] Update docs/deployment.md Co-Authored-By: Leo Lamprecht --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index 0174605483708ce..6db1894f0e4899a 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -16,7 +16,7 @@ Then, follow these steps: 1. [Sign up to ZEIT Now](https://zeit.co/signup) (no credit card is required). 2. After signing up, you’ll arrive on the [“Create a new project”](https://zeit.co/new) page. Under “From your existing code”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://zeit.co/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://zeit.co/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://zeit.co/docs/v2/git-integrations/zeit-now-for-bitbucket)). -3. Once that’s set up, click “New Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything—everything just works! +3. Once that’s set up, click “New Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything — everything just works! 4. After importing, it’ll deploy your Next.js app and give you a deployment URL. Click “Visit” to see your app in production. Congratulations! You’ve just deployed your Next.js app! If you have questions, take a look at the [ZEIT Now documentation](https://zeit.co/docs). From 67b92db66a2d7ec5f441962cff8f1cc11d075de2 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 14:46:39 -0800 Subject: [PATCH 14/17] Update docs/deployment.md Co-Authored-By: Leo Lamprecht --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index 6db1894f0e4899a..3b852e3f682e574 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -17,7 +17,7 @@ Then, follow these steps: 1. [Sign up to ZEIT Now](https://zeit.co/signup) (no credit card is required). 2. After signing up, you’ll arrive on the [“Create a new project”](https://zeit.co/new) page. Under “From your existing code”, choose the Git provider you use and set up an integration. (Instructions: [GitHub](https://zeit.co/docs/v2/git-integrations/zeit-now-for-github) / [GitLab](https://zeit.co/docs/v2/git-integrations/zeit-now-for-gitlab) / [BitBucket](https://zeit.co/docs/v2/git-integrations/zeit-now-for-bitbucket)). 3. Once that’s set up, click “New Project From …” and import your Next.js app. It auto-detects that your app is using Next.js and sets up the build configuration for you. No need to change anything — everything just works! -4. After importing, it’ll deploy your Next.js app and give you a deployment URL. Click “Visit” to see your app in production. +4. After importing, it’ll deploy your Next.js app and provide you with a deployment URL. Click “Visit” to see your app in production. Congratulations! You’ve just deployed your Next.js app! If you have questions, take a look at the [ZEIT Now documentation](https://zeit.co/docs). From cab15e4dc1d7d34d52d3a00766398dd4979c53b6 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 14:46:55 -0800 Subject: [PATCH 15/17] Update docs/deployment.md Co-Authored-By: Leo Lamprecht --- docs/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index 3b852e3f682e574..92e18a773f09c7f 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -28,7 +28,7 @@ Congratulations! You’ve just deployed your Next.js app! If you have questions, Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip: - **Develop:** When you work on something new, create a new Git branch. -- **Preview:** Every time you push changes to GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). +- **Preview:** Every time you push changes to GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). - **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment. By using the DPS workflow, instead of doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests. From f49c544fd11256ea8b89b68ba6db26d449cf634f Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 15:17:41 -0800 Subject: [PATCH 16/17] Update "develop" section --- docs/deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 92e18a773f09c7f..704fb3f42c28e8c 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -27,8 +27,8 @@ Congratulations! You’ve just deployed your Next.js app! If you have questions, Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) supports what we call the **DPS** workflow: **D**evelop, **P**review, and **S**hip: -- **Develop:** When you work on something new, create a new Git branch. -- **Preview:** Every time you push changes to GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). +- **Develop:** Write code in Next.js. Keep the development server running and take advantage of its hot code reloading feature. +- **Preview:** Every time you push changes to a branch on GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). - **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment. By using the DPS workflow, instead of doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests. From 7ccf00d1f8d230bcd9557aab1a7fe1ce23f6fdf1 Mon Sep 17 00:00:00 2001 From: Shu Uesugi Date: Tue, 11 Feb 2020 16:14:46 -0800 Subject: [PATCH 17/17] Wordsmith --- docs/deployment.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 704fb3f42c28e8c..bb08c431ff78ae2 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -31,7 +31,7 @@ Let’s talk about the workflow we recommend using. [ZEIT Now](https://zeit.co) - **Preview:** Every time you push changes to a branch on GitHub / GitLab / BitBucket, ZEIT Now automatically creates a new deployment with a unique URL. You can view them on GitHub when you open a pull request, or under “Preview Deployments” on your project page on ZEIT Now. [Learn more about it here](https://zeit.co/features/deployment-previews). - **Ship:** When you’re ready to ship, merge the pull request to your default branch (e.g. `master`). ZEIT Now will automatically create a production deployment. -By using the DPS workflow, instead of doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests. +By using the DPS workflow, in addition to doing _code reviews_, you can do _deployment previews_. Each deployment creates a unique URL that can be shared or used for integration tests. ### Optimized for Next.js @@ -74,6 +74,4 @@ Make sure your `package.json` has the `"build"` and `"start"` scripts: If you’d like to do a static HTML export of your Next.js app, follow the directions on [our documentation](/docs/advanced-features/static-html-export.md). By default, `next export` will generate an `out` directory, which can be served by any static hosting service or CDN. -> We strongly recommend using [ZEIT Now](https://zeit.co/) even if your Next.js app is fully static. [ZEIT Now](https://zeit.co/) is optimized to make static Next.js apps blazingly fast. -> -> **Note:** If you use [ZEIT Now](https://zeit.co/), you don’t need to use `next export`. It’ll automatically serve all pages from the [ZEIT Now Smart CDN](https://zeit.co/smart-cdn). +> We strongly recommend using [ZEIT Now](https://zeit.co/) even if your Next.js app is fully static. [ZEIT Now](https://zeit.co/) is optimized to make static Next.js apps blazingly fast. `next export` works with Zero Config deployments on ZEIT Now.