Skip to content

Instantly share code, notes, and snippets.

@julianpitt
Last active March 3, 2023 23:18
Show Gist options
  • Select an option

  • Save julianpitt/b117827313985483511c8efed1c69ed5 to your computer and use it in GitHub Desktop.

Select an option

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
{
"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