jeremydaly / lambda-api

Lightweight web framework for your serverless applications
https://serverless-api.com
MIT License
1.41k stars 125 forks source link

as of v1.0.1, node_modules size increased significantly #258

Closed joelrwilliams12 closed 2 months ago

joelrwilliams12 commented 5 months ago

By adding AWS packages as peerdependencies, the node_modules folder has increased from 164K to 8.5MB.

To keep Lambda load-times quick and to be able to edit code in Lambda, I typically install lambda-api@1.0.0.

However, this means that I don't get future bug fixes.

Is there a way to install the latest version of lambda-api and then clean out some of the unneeded packages?

naorpeled commented 2 months ago

Hey @joelrwilliams12, if you're using any bundler, you should be able to mark AWS packages as external dependencies which means that they would not be a part of your bundle.

joelrwilliams12 commented 2 months ago

Thanks for the suggestion.