Skip to content

Conversation

@JoaquinFernandez
Copy link

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

    • It should limit the concurrent building of the service lambda's to that amount
  • Run serverless package command with the esbuild option concurrency as a string

    • It should throw an error with the message:
      • TypeError: Expected concurrency to be an integer from 1 and up or Infinity, got a (string)
  • Run serverless package command with no esbuild option concurrency

    • It should concurrently build all of the service lambda's

@floydspace floydspace changed the base branch from master to develop October 1, 2021 15:17
@floydspace floydspace merged commit c9597b3 into floydspace:develop Oct 1, 2021
@github-actions
Copy link

github-actions bot commented Oct 1, 2021

🎉 This PR is included in version 1.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit concurrency on esbuild packaging

2 participants