Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to blackbox vendor code when using VSCode's node debugger? [duplicate]

Chrome Dev Tools has offered the ability to blackbox selected code for a while now, but I can't seem to find a comparable feature for VSStudio when debugging Node.

I've been through the debugger docs and lots of issues on VSCode's Github, but I can't seem to find an answer.

Is it possible to exclude (for example node_modules/) from debugging?

like image 987
Undistraction Avatar asked Feb 05 '18 10:02

Undistraction


People also ask

Does Node have a debugger?

You will first debug code using the built-in Node. js debugger tool, setting up watchers and breakpoints so you can find the root cause of a bug. You will then use Google Chrome DevTools as a Graphical User Interface (GUI) alternative to the command line Node.

What is Node js debugger?

Node. js includes a command-line debugging utility. The Node. js debugger client is not a full-featured debugger, but simple stepping and inspection are possible. To use it, start Node.


1 Answers

I haven't tried this I must admit, barely got round to use debugging in vscode just yet, but it does appear that blackbox-ing was supported in v1.8:

https://code.visualstudio.com/updates/v1_8#_node-debugging

We have added a feature to avoid code that you don't want to step through. This feature can be enabled with the skipFiles setting in your launch configuration. skipFiles is an array of glob patterns for script paths to skip.

Files can be exluded using skipFiles in your launch configuration:

 "skipFiles": [
    "node_modules/**/*.js",
    "lib/**/*.js",
    "async_hooks.js",
    "inspector_async_hook.js"
  ]
like image 194
Jarede Avatar answered Oct 01 '22 04:10

Jarede