Last active
March 3, 2023 23:18
-
-
Save julianpitt/b117827313985483511c8efed1c69ed5 to your computer and use it in GitHub Desktop.
[vscode debugging for serverless framework with webpack and serverless invoke] Use VSCode to debug your serverless framework functions when using the serverless-webpack plugin and want to use the `sls invoke local` command #Serverless #AWS #Webpack #Javascript #Typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.2.0", | |
| "inputs": [ | |
| { | |
| "id": "echoPrompt", | |
| "description": "Please enter a function name to test", | |
| "default": "myFunction", | |
| "type": "promptString" | |
| } | |
| ], | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "attach", | |
| "name": "Attach to 9229", | |
| "port": 9229 | |
| }, | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Launch Invoke Local - checker function", | |
| "program": "${workspaceRoot}/node_modules/serverless/bin/serverless", | |
| "args": [ | |
| "invoke", | |
| "local", | |
| "-f", | |
| "${input:echoPrompt}", | |
| "--data", | |
| "{}" | |
| ], | |
| "sourceMaps": true, | |
| "smartStep": true, | |
| "runtimeArgs": [ | |
| "--lazy" | |
| ], | |
| "outFiles": [ | |
| "${workspaceFolder}/.webpack/**/*.js" | |
| ], | |
| "protocol": "inspector", | |
| "runtimeExecutable": "node", | |
| "env": { | |
| // Here we set some environment vars that should be set locally. | |
| // They can and will overwrite the ones coming from your serverless.yml | |
| }, | |
| "windows": { | |
| "program": "${workspaceRoot}\\node_modules\\serverless\\bin\\serverless", | |
| }, | |
| "autoAttachChildProcesses": true | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment