Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"]
    } ]
}
like image 829
Ali Altun Avatar asked Mar 12 '17 21:03

Ali Altun


1 Answers

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

like image 105
t.j. Avatar answered Oct 13 '22 00:10

t.j.