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.
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).
69
70
@@ -90,7 +91,7 @@ module.exports = {
90
91
};
91
92
```
92
93
93
-
####2. Add postbuild hook
94
+
### 2. Add postbuild hook
94
95
95
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\*.
96
97
@@ -110,7 +111,7 @@ We want the next-on-netlify command to run after we build our Next.js applicatio
110
111
111
112
\*If you're curious about the "magic", check out the well-documented [`next-on-netlify.js` file](https://github.com/netlify/next-on-netlify/blob/master/next-on-netlify.js).
112
113
113
-
####3. Configure Netlify
114
+
### 3. Configure for Netlify
114
115
115
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:
116
117
@@ -121,7 +122,27 @@ We're almost done! We just have to tell Netlify how to build our Next.js app, wh
121
122
publish = "out_publish"
122
123
```
123
124
124
-
Note: `out_functions` and `out_publish` are hard-coded into next-on-netlify. These are not configurable at the moment.
125
+
Note: `out_functions` and `out_publish` are hard-coded into next-on-netlify.
126
+
These are not configurable at the moment.
127
+
128
+
#### (Optional) Configure private git submodules
129
+
If your project contains private submodules, in order to deploy it, you will
I recommend you still use `next dev` to build and preview your application locally.
138
159
@@ -184,7 +205,7 @@ Preview Mode is not yet available locally, running `netlify dev`, for static pag
184
205
185
206
For now, Preview Mode *is* supported in production for all Next.js page types.
186
207
187
-
####Custom Netlify Redirects
208
+
### Custom Netlify Redirects
188
209
189
210
You can define custom redirects in a `_redirects` and/or in your `netlify.toml` file.
190
211
The precedence of these rules are:
@@ -196,12 +217,12 @@ Currently, there is no support for redirects set in your `netlify.toml` file.
196
217
197
218
[Read more about Netlify redirects here](https://docs.netlify.com/routing/redirects/).
198
219
199
-
####Custom Netlify Functions
220
+
### Custom Netlify Functions
200
221
201
222
`next-on-netlify` creates one Netlify Function for each of your
202
223
SSR pages and API endpoints. It is currently not possible to create custom Netlify Functions. This feature is on our list to do.
203
224
204
-
####Using Netlify Identity
225
+
### Using Netlify Identity
205
226
206
227
You can use [Netlify Identity](https://docs.netlify.com/visitor-access/identity/) with `next-on-netlify`. For all pages with server-side rendering (getInitialProps*, getServerSideProps, and API routes), you can access the [clientContext object](https://docs.netlify.com/functions/functions-and-identity/#access-identity-info-via-clientcontext) via the `req` parameter.
0 commit comments