Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Update README with clearer setup/deploy instructions #160

Merged
merged 3 commits into from
Jan 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ npm install --save next-on-netlify

We must build our Next.js app as a serverless app. You can read more about serverless Next.js [here](https://nextjs.org/docs/api-reference/next.config.js/build-target#serverless-target).

It's super simple. Just create a `next.config.js` file and write the following:
It's super simple. Just create a `next.config.js` file in the root of your project and write the following:

```js
// next.config.js
Expand All @@ -95,7 +95,8 @@ module.exports = {

The next-on-netlify package adds the `next-on-netlify` command. When we run this command, some magic happens to prepare our Next.js app for hosting on Netlify\*.

We want the next-on-netlify command to run after we build our Next.js application. So let's add a postbuild hook to our package.json file:
We want the next-on-netlify command to run after we build our Next.js application. So let's add a postbuild hook to our package.json file. You should add `"postbuild": "next-on-netlify"` to the existing scripts, like so:


```
{
Expand All @@ -113,7 +114,7 @@ We want the next-on-netlify command to run after we build our Next.js applicatio

### 3. Configure for Netlify

We're almost done! We just have to tell Netlify how to build our Next.js app, where the functions folder is located, and which folder to upload to its CDN. We do that with a `netlify.toml` file and the following instructions:
We're almost done! We just have to tell Netlify how to build our Next.js app, where the functions folder is located, and which folder to upload to its CDN. We do that with a `netlify.toml` file in the root of your project and the following instructions:

```toml
[build]
Expand Down Expand Up @@ -146,6 +147,8 @@ need to:

We're done. Let's deploy 🚀🚀🚀

If you're not familiar with Netlify, follow the deployment instructions here: https://www.netlify.com/blog/2020/11/30/how-to-deploy-next.js-sites-to-netlify/

## Demo

- Site: https://next-on.netlify.com/
Expand Down