Skip to content

Commit 7b0ae7e

Browse files
author
Robb Lovell
committed
Readme for the hot reloader for esbuild and typescript
1 parent 7901b8c commit 7b0ae7e

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _serverless.yml_
1414
```yaml
1515
service:
1616
name: edge-lambdas
17-
17+
1818
plugins:
1919
- serverless-offline-edge-lambda
2020

@@ -60,7 +60,7 @@ a configuration option `path` that it uses to resolve function handlers.
6060
```yaml
6161
plugins:
6262
- serverless-plugin-typescript
63-
63+
6464
custom:
6565
offlineEdgeLambda:
6666
path: '.build'
@@ -70,8 +70,40 @@ For usage with `serverless-webpack` and `serverless-bundle` the config is simila
7070
```yaml
7171
plugins:
7272
- serverless-webpack # or serverless-bundle
73-
73+
7474
custom:
7575
offlineEdgeLambda:
7676
path: './.webpack/service/'
7777
```
78+
79+
### Hot Reload Support
80+
81+
Hot reload for serverless-esbuild and serverless-plugin-typescript are available with extra configuration.
82+
83+
The watch/reload mechanism is available form serverless-webpack, but is disabled by default for esbuild and typescript.
84+
85+
The flag "watchReload: true" will turn on the watcher so that typescript and esbuild solutions use the watcher to hot reload the handlers.
86+
The path to the built handlers must be specified for the watcher to work correctly.
87+
88+
example:
89+
```yaml
90+
custom:
91+
offlineEdgeLambda:
92+
path: '.esbuild/service'
93+
watchReload: true
94+
```
95+
96+
Additional options can be used to modify the behavior of the file watcher and debounce logic (ignoreInitial, awaitWriteFinish, interval, debounce, and any other chokidar option).
97+
98+
example:
99+
100+
```yaml
101+
custom:
102+
offlineEdgeLambda:
103+
path: '.dist/service'
104+
watchReload: true
105+
ignoreInitial: true
106+
awaitWriteFinish: true
107+
interval: 500,
108+
debounce: 750
109+
```

0 commit comments

Comments
 (0)