Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update template to not rely on filesystem location of package.json #120

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

swain
Copy link
Contributor

@swain swain commented Sep 18, 2023

Motivation

I originally raised a concern about use of process.cwd() in #53.

TL;DR:

  • It is a relatively common practice to bundle lambda code before deploying it (e.g. using esbuild or webpack). This optimization reduce the size of the artifact needing upload, and can also speed up the start time of the lambda.

    • This approach is actually built-in to AWS's CDK logic for deploying lambda code -- see this search.
  • Trying to grab the package.json using process.cwd() will always cause an import-time error when running code that was bundled.

Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple is always better 👍🏼 Thank you!

@gr2m gr2m enabled auto-merge (squash) September 18, 2023 19:17
@gr2m gr2m merged commit 1eb30a0 into probot:master Sep 18, 2023
5 checks passed
@github-actions
Copy link

🎉 This PR is included in version 3.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@swain swain deleted the swain/lambda-bundling-fix branch September 18, 2023 19:41
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.

2 participants