Skip to content

Instantly share code, notes, and snippets.

@wes-goulet
Created April 18, 2020 21:47
Show Gist options
  • Save wes-goulet/ca95cedef1aa6458cf0623828028b4cf to your computer and use it in GitHub Desktop.
Save wes-goulet/ca95cedef1aa6458cf0623828028b4cf to your computer and use it in GitHub Desktop.
Example VSCode Debug Config for debugging rollup and jest tests
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Rollup",
"program": "${workspaceFolder}/node_modules/.bin/rollup",
"args": ["-c"],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "Debug Jest",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["-i", "--config=${workspaceFolder}/jest.config.js"],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"skipFiles": ["<node_internals>/**"]
}
]
}
@wes-goulet
Copy link
Author

Place under <repo-root>/.vscode/launch.json

@floer32
Copy link

floer32 commented Mar 26, 2021

Thanks for this!

I had to update the path to rollup to "${workspaceFolder}/node_modules/rollup/dist/bin/rollup":

    {
      "type": "pwa-node",
      "request": "launch",
      "name": "dev (rollup/svelte)",
      "program": "${workspaceFolder}/node_modules/rollup/dist/bin/rollup",
      "args": [
        "-c",
        "--watch"
      ],
      "internalConsoleOptions": "openOnSessionStart"
    },

Why: for my version at least, node_modules/.bin/rollup is actually a shell script wrapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment