Ali Altun
Ali Altun

Reputation: 407

How to prevent to step into node_modules

How to prevent to step into node_modules/*.js files when debugging the typescript project files in vs code editor. When I start a debug process with a berakpoint on my typescipt file, I want to step over js files under node_modules directory automatically.

// my launch.json

{
  "version": "0.2.0",
  "configurations": [ {
      "name": "LaunchChrome",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:4200",
      "sourceMaps": true,
      "trace": true,
      "webRoot": "${workspaceRoot}",
      "userDataDir": "${workspaceRoot}/.vscode/chrome",
       "runtimeArgs": [ "--disable-web-security"]
    } ]
}

Upvotes: 9

Views: 3632

Answers (1)

t.j.
t.j.

Reputation: 1347

Add the following to your launch.json...

"skipFiles": [
    "${workspaceRoot}/node_modules/**/*.js"
]

From the sound of your question, you may also want to exclude the following...

"skipFiles": [
    "${workspaceRoot}/node_modules/**/*.js",
    "<node_internals>/**/*.js"
]

Which then also excludes node internal files (net.js, events.js, etc) if you wish.

Via documentation here

Upvotes: 15

Related Questions