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
Next.js is supported natively on Netlify, and in most cases you will not need to install or configure anything. This
6
11
repo includes the packages used to support Next.js on Netlify.
7
12
@@ -16,10 +21,10 @@ commands separately will not work, because the Next.js Runtime will not generate
16
21
If you use [`next/image`](https://nextjs.org/docs/basic-features/image-optimization), your images will be automatically
17
22
optimized at runtime, ensuring that they are served at the best size and format. The image will be processed on the
18
23
first request which means it may take longer to load, but the generated image is then cached and served as a static file
19
-
to future visitors. By default, Next.js will deliver WebP images if the browser supports it. WebP is a modern image format
20
-
with wide browser support that will usually generate smaller files than PNG or JPG. Additionally, you can enable AVIF
21
-
format, which is often even smaller in filesize than WebP. The drawback is that with particularly large images, AVIF images may
22
-
take too long to generate, and the function times-out. You can configure
24
+
to future visitors. By default, Next.js will deliver WebP images if the browser supports it. WebP is a modern image
25
+
format with wide browser support that will usually generate smaller files than PNG or JPG. Additionally, you can enable
26
+
AVIF format, which is often even smaller in filesize than WebP. The drawback is that with particularly large images,
27
+
AVIF images may take too long to generate, and the function times-out. You can configure
23
28
[the supported image formats](https://nextjs.org/docs/api-reference/next/image#acceptable-formats) in your
24
29
`next.config.js` file.
25
30
@@ -91,7 +96,10 @@ Note that Netlify has a minimum TTL of 60 seconds for revalidation.
91
96
92
97
## Disable Static 404 on Dynamic Routes with fallback:false
93
98
94
-
Currently when hitting a non-prerendered path with `fallback=false` it will default to a 404 page. You can now change this default setting by using the environemnt variable `LEGACY_FALLBACK_FALSE=true`. With the environment variable set, those non-prerendered paths will now be routed through using the ISR Handler and will allow you to add redirects for those non-prerendered paths.
99
+
Currently when hitting a non-prerendered path with `fallback=false` it will default to a 404 page. You can now change
100
+
this default setting by using the environemnt variable `LEGACY_FALLBACK_FALSE=true`. With the environment variable set,
101
+
those non-prerendered paths will now be routed through using the ISR Handler and will allow you to add redirects for
102
+
those non-prerendered paths.
95
103
96
104
## Use with `next export`
97
105
@@ -190,13 +198,15 @@ npm test
190
198
191
199
### End-to-end tests
192
200
193
-
In order to run the end-to-end (E2E) tests, you'll need to be logged in to Netlify. You can do this using the [Netlify CLI](https://github.com/netlify/cli) with the command:
201
+
In order to run the end-to-end (E2E) tests, you'll need to be logged in to Netlify. You can do this using the
202
+
[Netlify CLI](https://github.com/netlify/cli) with the command:
194
203
195
204
```shell
196
205
netlify login
197
206
```
198
207
199
-
Alternatively, you can set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui).
208
+
Alternatively, you can set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This
209
+
can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui).
200
210
201
211
Then run the E2E tests if logged in:
202
212
@@ -210,7 +220,8 @@ Or if using an access token:
210
220
NETLIFY_AUTH_TOKEN=your-token-here npm run test:next
211
221
```
212
222
213
-
_Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment variable `NETLIFY_SITE_ID` to your site ID._
223
+
_Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment
0 commit comments