debugger for chrome

  1. {
  2. // Use IntelliSense to learn about possible attributes.
  3. // Hover to view descriptions of existing attributes.
  4. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  5. "version": "0.2.0",
  6. "configurations": [
  7. {
  8. "type": "chrome",
  9. "request": "launch",
  10. "name": "Open index.html",
  11. "file": "/Users/apron/Documents/html-test/index.html"
  12. }
  13. ]
  14. }

配置项

name: string 任务名
request: “launch” | “attatch” 启动方式

launch启动方式的配置

type: string 运行的环境

runtimeArgs: array 运行环境参数

program: string 运行的文件名

args:给运行文件传的参数

cwd:string 执行命令的目录,会先进入到该目录下,再执行命令

autoAttachChildProcesses: boolean 是否附加到子进程

env:object 设置环境变量

  1. "env": { "USER": "john doe" }

envFile: string 环境变量文件

  1. "envFile": "${workspaceFolder}/.env",

.env

  1. USER=doe
  2. PASSWORD=abc123
  3. # a comment
  4. # an empty value:
  5. empty=
  6. # new lines expanded in quoted strings:
  7. lines="foo\nbar"

attatch启动方式的配置

二者公有的配置

skipFiles: glob[ ] 设置不感兴趣的的文件

参考

https://code.visualstudio.com/docs/nodejs/nodejs-debugging