Reputation: 1083
I’m working with an AWS Lambda function written in Node.js, and I have a package.json file with several dependencies installed.
For local debugging, I downloaded the SAM template from AWS Lambda via the console, and I’ve configured the Run Configuration in WebStorm following the instructions from these guides (samples are for Python & PyCharm but same config applies for Node & WebStorm):
https://www.jetbrains.com/guide/python/tutorials/intro-aws/invoke-local/
https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/invoke-lambda.html
However, each time I attempt to debug my Lambda function, the sam build command installs all Node.js dependencies, which significantly slows down the process (approximately 3 minutes each time).
Is there a way to bypass this dependency installation phase and use the node_modules directory locally instead?
I have checked the sam command reference: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-command-reference.html but I didn´t found an option to skip the build phase. Moreover, I´m not sure if this phase can be skipped with WebStorm.
Any tips or optimal configuration suggestions would be appreciated!
Upvotes: 0
Views: 30