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
Copy file name to clipboardExpand all lines: README.md
+16-1
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,13 @@ http://localhost:9000/hello -> folder/hello.js (must export a handler(event, con
29
29
30
30
The `build` function will run a single build of the functions in the folder.
31
31
32
+
There are additional options, introduced later:
33
+
```bash
34
+
-h --help
35
+
-c --config
36
+
-p --port
37
+
```
38
+
32
39
### Proxying for local development
33
40
34
41
When your function is deployed on Netlify, it will be available at `/.netlify/functions/function-name` for any given deploy context. It is advantageous to proxy the `netlify-lambda serve` development server to the same path on your primary development server.
@@ -53,14 +60,22 @@ module.exports = {
53
60
};
54
61
```
55
62
63
+
The serving port can be changed with the `-p`/`--port` option.
64
+
56
65
## Webpack Configuration
57
66
58
67
By default the webpack configuration uses `babel-loader` to load all js files. Any `.babelrc` in the directory `netlify-lambda` is run from will be respected. If no `.babelrc` is found, a [few basic settings are used](https://github.com/netlify/netlify-lambda/blob/master/lib/build.js#L11-L15a).
59
68
60
-
If you need to use additional webpack modules or loaders, you can specify an additional webpack config with the `-c` option when running either `serve` or `build`.
69
+
If you need to use additional webpack modules or loaders, you can specify an additional webpack config with the `-c`/`--config` option when running either `serve` or `build`.
61
70
62
71
The additional webpack config will be merged into the default config via [webpack-merge's](https://www.npmjs.com/package/webpack-merge)`merge.smart` method.
63
72
73
+
### babel configuration
74
+
75
+
The default webpack configuration uses `babel-loader` with a [few basic settings](https://github.com/netlify/netlify-lambda/blob/master/lib/build.js#L19-L33).
76
+
77
+
However, if any `.babelrc` is found in the directory `netlify-lambda` is run from, it will be used instead of the default one.
0 commit comments