dherault / dherault/serverless-offline
Lazy/late bundling possible?
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 811
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
## Feature Request
I have multiple projects in production with 100 - 300 lambda functions, they are bundled via `serverless-webpack` and `serverless-esbuild`.
The initial bundling for `serverless-offline` in these projects takes 1-2 hours, which is not really practical from the development perspective.
Is it possible to trigger bundling only when an endpoint is visited, or when a lambda is invoked?
I am a maintainer of `serverless-webpack`, if this requires adaptation from the bundler side I'll see what I can do there.
**Sample Code**
- file: serverless.yml
```yaml
service: my-service
plugins:
- serverless-offline
custom:
serverless-offline:
lazy: true
```
**Expected behavior/code**
A local HTTP server is immediately spun up without the bundling process, individual functions are bundled upon invocation from the local endpoint.
**Additional context/Screenshots**
N/A
Contributor guide
Research direction
Start by tracing how serverless-offline starts its local HTTP server and how endpoint or Lambda invocation currently triggers bundling; the issue does not name implementation files or tests. Done means the server starts without bundling, and each function is bundled when first invoked, including compatibility considerations for serverless-webpack and serverless-esbuild.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- api, backend, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100