Skip to content

Commit 3198e3c

Browse files
authored
make very clear netlify serve is not encouraged anymore
make very clear netlify serve is not encouraged anymore
1 parent d9f70de commit 3198e3c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Diff for: README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
## Netlify Lambda
22

3-
[![Node](https://img.shields.io/node/v/netlify-lambda.svg?logo=node.js)](https://www.npmjs.com/package/netlify-lambda)
4-
53
This is an optional tool that helps with building or locally developing [Netlify Functions](https://www.netlify.com/docs/functions/) with a simple webpack/babel build step. For function folders, there is also a small utility to install function folder dependencies.
64

75
The goal is to make it easy to write Lambda's with transpiled JS/TypeScript features and imported modules.
@@ -21,14 +19,18 @@ If this sounds confusing, support is available through [our regular channels](ht
2119

2220
</details>
2321

22+
23+
### When to use Netlify Dev or `netlify-lambda` or both?
24+
2425
<details>
2526
<summary>
2627

27-
**When to use Netlify Dev or `netlify-lambda` or both?**
28+
29+
[`Netlify Dev`](https://github.com/netlify/netlify-dev-plugin#what-is-netlify-dev) is incrementally adoptable. **Use `netlify-lambda` only if you need a build step for your functions**
2830

2931
</summary>
3032

31-
[`Netlify Dev`](https://github.com/netlify/netlify-dev-plugin#what-is-netlify-dev) is incrementally adoptable. **Use `netlify-lambda` only if you need a build step for your functions**, as explained here:
33+
3234

3335
- **When to use Netlify Dev**: Part of Netlify Dev serves unbundled function folders through [zip-it-and-ship-it](https://github.com/netlify/zip-it-and-ship-it) with no build step. This is likely to be attractive to many users who previously just needed `netlify-lambda` for bundling multi-file functions or functions with node_module dependencies.
3436
- **When to use Netlify Lambda**: However, if you need a build step for your functions (e.g. for webpack import/export syntax, running babel transforms or typescript), you can use `netlify-lambda`, `tsc` or your own build tool to do this, just point Netlify Dev at your build output with the `functions` field in `netlify.toml`.
@@ -98,7 +100,7 @@ netlify-lambda install <folderName>
98100

99101
We don't anticipate you will use this as often but it can be handy.
100102

101-
### `netlify-lambda serve` and `netlify-lambda build`
103+
### `netlify-lambda build`
102104

103105
At a high level, `netlify-lambda` takes a source folder (e.g. `src/lambda`, specified in your command) and outputs it to a built folder, (e.g. `built-lambda`, specified in your `netlify.toml` file).
104106

@@ -167,7 +169,11 @@ export async function handler(event, context) {
167169

168170
</details>
169171

170-
## Using with `create-react-app`, Gatsby, and other development servers
172+
### `netlify-lambda serve`
173+
174+
This command is pretty much superceded by Netlify Dev. We only keep it around for legacy/backward compatibility support reasons.
175+
176+
#### `netlify-lambda serve`: Using with `create-react-app`, Gatsby, and other development servers
171177

172178
<details>
173179
<summary><b>Why you need to proxy (for beginners)</b></summary>
@@ -180,7 +186,7 @@ If this desribes your situation, then you need to proxy for local development. R
180186

181187
</details>
182188

183-
### Proxying for local development
189+
#### `netlify-lambda serve`: Proxying for local development
184190

185191
> ⚠️IMPORTANT! PLEASE READ THIS ESPECIALLY IF YOU HAVE CORS ISSUES⚠️
186192

0 commit comments

Comments
 (0)