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

aws-sdk should be in devDependencies? #110

Closed
mattilindell opened this issue Oct 4, 2021 · 3 comments
Closed

aws-sdk should be in devDependencies? #110

mattilindell opened this issue Oct 4, 2021 · 3 comments
Labels
question Further information is requested

Comments

@mattilindell
Copy link

https://docs.aws.amazon.com/lambda/latest/dg/nodejs-package.html says "If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your .zip file. These libraries are included with the supported Lambda runtime environments."

serverless-lift should not include aws-sdk as it bloats the resulting .zip. Should aws-sdk be as devDependency?

It's possible to exclude aws-sdk explicitly using package pattern, but it should be excluded by default.

@mnapoli
Copy link
Member

mnapoli commented Oct 4, 2021

Lift uses the AWS SDK to make calls to the AWS API. For example to upload static website files, etc. So it's not really a dev dependency of Lift (i.e. it's not used by Lift's tests).

However, Lift should be installed as a dev dependency in your project. Indeed, your Lambda functions do not use Lift. Only your deployment (sls deploy).

If you install Lift as a dev dependency it shouldn't increase the size of what you deploy, right?

@mnapoli mnapoli added the question Further information is requested label Oct 4, 2021
@t-richard
Copy link
Contributor

From the top of my head, I'd say we can't because Lift doesn't get executed in the Lambda environment but it's executed when running serverless deploy or serverless package so you need it locally.

If it was listed in devDependencies of Lift, I guess it would not get installed in your project and thus Lift would not work as expected.

But maybe you could install Lift as a dev dependency and serverless should exclude it when deploying IIRC

@mattilindell
Copy link
Author

I wonder what installed serverless-lift in dependencies in the first place, but now as I tried from scratch - it's correctly in devDependencies. I'll close this issue, thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants