feat: set up concurrency on building the lambdas #201
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What has been implemented?
For some use cases, where there is limited system memory available (i.e. GitHub Actions 7GB), esbuild can run out of memory and crash when building a big serverless project (i.e. 50+ lambdas).
In order to overcome that I've added the esbuild option concurrency to only allow as much as concurrency promises running at the same time when building the lambdas.
I could help with the tests, and indeed I tried to work on them, but there is a lot to reestructure in the index.ts before unit tests start to make sense.
Closes #200
Steps to verify
Run serverless package command with the esbuild option concurrency as an integer
Run serverless package command with the esbuild option concurrency as a string
concurrencyto be an integer from 1 and up orInfinity, gota(string)Run serverless package command with no esbuild option concurrency