I am developing an AWS SAM application in nodejs and have two lambda functions (each are distinct node modules) which both share a third node module which is shared utility functions.
I am using the install-local npm module to install the shared local utilities node module into the lambda function node modules post-npm-install because SAM local-start doesn't appear to work with symlinked local modules.
This works fine when I start the SAM API locally and hit the end point and I can successfully debug the Lambda functions, however, when I step from the Lambda function code into a function within the shared utilities node module, it opens the file from the lambda function's node_modules directory (local-install doesn't symlink from node_modules to the shared code on my local file system).
I would very much like to somehow map the file in the lambda function's node_modules to the shared utility code on my local file system.
Here is my directory structure:
root
|
|- LambdaFunction1
|- app.js
|- node_modules
|- SharedUtilityFunctions
|- app.js
|- node_modules
|- LambdaFunction2
|- app.js
|- node_modules
|- SharedUtilityFunctions
|- app.js
|- node_modules
|- SharedUtilityFunctions
|- app.js
|- node_modules
In this example, I want to (only when debugging in VSCode) map root/LambdaFunction1/node_modules/SharedUtilityFunctions
to root/SharedUtilityFunctions
Does anyone know how this can be achieved?