Skip to content

Commit e005d05

Browse files
authored
Merge pull request #5 from netlify/sd/readme-tweaks
Readme updates: removal of some `next-on-netlify` specific sections
2 parents e907e2c + 32b9b43 commit e005d05

File tree

1 file changed

+6
-62
lines changed

1 file changed

+6
-62
lines changed

README.md

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@
1313

1414
This build plugin is a utility for enabling server-side rendering in Next.js on Netlify. It wraps your application in a tiny compatibility layer, so that pages can use Netlify Functions to be server-side rendered.
1515

16-
**TL;DR: You can enable SSR in your Next.js applications with 3 simple steps, listed [here](#setup)!**
17-
1816
## Table of Contents
1917

2018
- [Installation and Configuration](#installation-and-configuration)
21-
- [Setup](#setup)
22-
- [1. Set Next.js target to serverless](#1-set-nextjs-target-to-serverless)
23-
- [2. Add postbuild hook](#2-add-postbuild-hook)
24-
- [Optional Extras](#optional-extras)
25-
- [Preview Locally](#preview-locally)
26-
- [Custom Netlify Redirects](#custom-netlify-redirects)
27-
- [Custom Netlify Functions](#custom-netlify-functions)
19+
- [Custom Netlify Redirects](#custom-netlify-redirects)
20+
- [Custom Netlify Functions](#custom-netlify-functions)
2821
- [Caveats](#caveats)
29-
- [Preview Mode](#preview-mode)
3022
- [Fallbacks for Pages with `getStaticPaths`](#fallbacks-for-pages-with-getstaticpaths)
3123
- [Credits](#credits)
3224
- [Showcase](#showcase)
@@ -47,55 +39,7 @@ This build plugin is a utility for enabling server-side rendering in Next.js on
4739
package = "netlify-plugin-nextjs"
4840
```
4941

50-
## Optional Extras
51-
52-
#### Preview Locally
53-
54-
I recommend you still use `next dev` to build and preview your application locally.
55-
56-
But if you want to emulate the Netlify deployment on your computer, you can also run `next-on-netlify` locally and then use `netlify-cli` to preview the result.
57-
58-
First, install the latest version of `netlify-cli` (you can also [look at package.json](https://github.com/netlify/next-on-netlify/blob/master/package.json) to see the version that next-on-netlify has been tested against):
59-
60-
```bash
61-
npm install -g netlify-cli
62-
```
63-
64-
Then, add the following `[dev]` block to your `netlify.toml`:
65-
66-
```toml
67-
# netlify.toml
68-
69-
# [build]
70-
# ...
71-
72-
[dev]
73-
functions = "out_functions"
74-
publish = "out_publish"
75-
# We manually set the framework to static, otherwise Netlify automatically
76-
# detects Next.js and redirects do not work.
77-
# Read more: https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#project-detection
78-
framework = "#static"
79-
```
80-
81-
Lastly, add the following lines to your `.gitignore`:
82-
83-
```shell
84-
# .gitignore
85-
86-
# Files generated by next-on-netlify command
87-
/out_publish/
88-
/out_functions/
89-
```
90-
91-
Now you're all set.
92-
93-
From now on, whenever you want to preview your application locally, just run:
94-
95-
1. `npm run build`: This will run `next build` to build your Next.js app and `next-on-netlify` to prepare your Next.js app for compatibility with Netlify
96-
1. `netlify dev`: This will emulate Netlify on your computer and let you preview your app on `http://localhost:8888`.
97-
98-
#### Custom Netlify Redirects
42+
## Custom Netlify Redirects
9943

10044
You can define custom redirects in a `_redirects` and/or in your `netlify.toml` file.
10145
The precedence of these rules are:
@@ -106,7 +50,7 @@ The precedence of these rules are:
10650

10751
[Read more about Netlify redirects here](https://docs.netlify.com/routing/redirects/).
10852

109-
#### Custom Netlify Functions
53+
## Custom Netlify Functions
11054

11155
`next-on-netlify` creates one Netlify Function for each of your
11256
SSR pages and API endpoints. It is currently not possible to create custom Netlify Functions. Let me know if you have a need for this feature and we can add it.
@@ -115,9 +59,9 @@ SSR pages and API endpoints. It is currently not possible to create custom Netli
11559

11660
### Fallbacks for Pages with `getStaticPaths`
11761

118-
[Fallback pages](https://nextjs.org/docs/basic-features/data-fetching#fallback-true) behave differently with `next-on-netlify` than they do with Next.js. On Next.js, when navigating to a path that is not defined in `getStaticPaths`, it first displays the fallback page. Next.js then generates the HTML in the background and caches it for future requests.
62+
[Fallback pages](https://nextjs.org/docs/basic-features/data-fetching#fallback-true) behave differently with this plugin than they do with Next.js. On Next.js, when navigating to a path that is not defined in `getStaticPaths`, it first displays the fallback page. Next.js then generates the HTML in the background and caches it for future requests.
11963

120-
With `next-on-netlify`, when navigating to a path that is not defined in `getStaticPaths`, it server-side renders the page and sends it directly to the user. The user never sees the fallback page. The page is not cached for future requests.
64+
With this plugin, when navigating to a path that is not defined in `getStaticPaths`, it server-side renders the page and sends it directly to the user. The user never sees the fallback page. The page is not cached for future requests.
12165

12266
For more on this, see: [Issue #7](https://github.com/netlify/next-on-netlify/issues/7#issuecomment-636883539)
12367

0 commit comments

Comments
 (0)