Visual Studio Code 断点调试Nodejs程序跳过node内部模块,internal modules

Built-in core modules of Node.js can be referred to by the ‘magic name’ <node_internals> in a glob pattern. The following example skips all internal modules:

"skipFiles": [

"<node_internals>/**/*.js",

"${workspaceRoot}/node_modules/**/*.js"

]

The exact ‘skipping’ rules are as follows:

  • If you step into a skipped file, you won’t stop there - you will stop on the next executed line that is not in a skipped file.
  • If you have set the option to break on thrown exceptions, then you won’t break on exceptions thrown from skipped files.
  • If you set a breakpoint in a skipped file, you will stop at that breakpoint, and you will be able to step through it until you step out of it, at which point normal skipping behavior will resume.

资料1: internal modules: https://github.com/nodejs/node/tree/master/lib

资料2: https://vscode-doc-jp.github.io/docs/nodejs/nodejs-debugging.html#Skipping-uninteresting-code-node-chrome