-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Default value for 'exclude' should include '@aws-sdk/*' as AWS SDK v3 becomes widely used #455
Comments
Hi @fredrik @theburningmonk some day wrote these arguments against using the built-in AWS SDK:
See the article
SDK v3, the modular packages reduce the bundle size of your application by ~75%, so the bundle size would not be as big issue as it was for SDK v2 anymore See the blog post
So I would vote for against excluding the SDK from bundle, but always bundle the version you expect to use in your lambda. |
Those arguments are fair enough. We are currently happy to pin our AWS SDK dependencies to I'm good to close this but will wait for a moment to give time for anyone else chime in with their opinions. |
I had a conversation with The Monk and his take was that the points quoted above are still valid although rarely a problem in reality. For a library it makes sense to bundle an exact version, so the default should not be to exclude. Let's close this. Another thing though: where does this leave us in regards to the current default of excluding |
I'm a bit late to the party here, but this change in behavior caught me by surprise when recently updating our project to AWS-SDK V3. I'd much rather the default behavior of serverless-esbuild remained as-is (i.e exclude So in summary, my vote would be for:
|
The current default value for
exclude
is['aws-sdk']
. This makes sense since theaws-sdk
package is included in the AWS Lambda runtime since at leastnodejs16.x
(and perhaps it makes sense for other reasons too). Sincenodejs18.x
, however, v3 of the AWS SDK is included by default.Since moving to the Node 18 runtime on Lambda, our team has added the following to all our serverless projects:
I think it would make sense to add
'@aws-sdk/*'
to the default exclude pattern.The text was updated successfully, but these errors were encountered: