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
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.
6
4
7
5
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
21
19
22
20
</details>
23
21
22
+
23
+
### When to use Netlify Dev or `netlify-lambda` or both?
24
+
24
25
<details>
25
26
<summary>
26
27
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**
28
30
29
31
</summary>
30
32
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
+
32
34
33
35
-**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.
34
36
-**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`.
We don't anticipate you will use this as often but it can be handy.
100
102
101
-
### `netlify-lambda serve` and `netlify-lambda build`
103
+
### `netlify-lambda build`
102
104
103
105
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).
104
106
@@ -167,7 +169,11 @@ export async function handler(event, context) {
167
169
168
170
</details>
169
171
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
171
177
172
178
<details>
173
179
<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
180
186
181
187
</details>
182
188
183
-
### Proxying for local development
189
+
#### `netlify-lambda serve`: Proxying for local development
184
190
185
191
> ⚠️IMPORTANT! PLEASE READ THIS ESPECIALLY IF YOU HAVE CORS ISSUES⚠️
0 commit comments