You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2021. It is now read-only.
Update README with clearer setup/deploy instructions (#160)
* Update README.md
Hi Netlify team! 👋 I was following this great step by step guide to deploy my Next.js website and spotted a few things that could be clearer for first timers or early career devs, like me.
* Update README.md
Co-authored-by: lindsaylevine <[email protected]>
* Update README.md
Co-authored-by: lindsaylevine <[email protected]>
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).
70
70
71
-
It's super simple. Just create a `next.config.js` file and write the following:
71
+
It's super simple. Just create a `next.config.js` file in the root of your project and write the following:
72
72
73
73
```js
74
74
// next.config.js
@@ -95,7 +95,8 @@ module.exports = {
95
95
96
96
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\*.
97
97
98
-
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:
98
+
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:
99
+
99
100
100
101
```
101
102
{
@@ -113,7 +114,7 @@ We want the next-on-netlify command to run after we build our Next.js applicatio
113
114
114
115
### 3. Configure for Netlify
115
116
116
-
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:
117
+
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:
117
118
118
119
```toml
119
120
[build]
@@ -146,6 +147,8 @@ need to:
146
147
147
148
We're done. Let's deploy 🚀🚀🚀
148
149
150
+
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/
0 commit comments