Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

Visual Studio Code调试运行在Chrome, Firefox与Edge内的JS程序

$
0
0

没有费话,直上干货了。下面配置中的文件路径与URL能够直接替换成你本地的参数。但是,对于${}变量,我推荐请不要修改。

Debugger for Chrome的.vscode/launch.json文件配置例程

{
  "version": "0.2.0",
  "configurations": [{
      "type": "chrome",
      "request": "launch",
      "name": "Chrome localhost",
      "url": "http://192.168.1.100:8887/${relativeFile}",
      "runtimeExecutable": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
      "runtimeArgs": ["--remote-debugging-port=9222"],
      "userDataDir": "${workspaceRoot}/.vscode/chrome",
      "webRoot": "${workspaceRoot}"
    }]
}

Debugger for Firefox的.vscode/launch.json配置例程

{
  "version": "0.2.0",
  "configurations": [{
    "type": "firefox",
    "request": "launch",
    "name": "learning-three.js firefox",
    "url": "http://192.168.1.100:8887/${relativeFile}",
    "webRoot": "${fileDirname}",
    "pathMappings": [{
      "url": "http://192.168.1.100:8887",
      "path": "${workspaceRoot}"
    }],
	"profile": "default",
    "firefoxExecutable": "G:/Program Files/Mozilla Firefox/firefox.exe",
    "firefoxArgs": ["-start-debugger-server", "-no-remote"],
    "log": {
      "consoleLevel": {
        "PathConversion": "Warn",
        "default": "Warn"
      }
    }
    }]
}

Debugger for Edge的.vscode/launch.json文件配置例程

{
  "version": "0.2.0",
  "configurations": [{
    "type": "edge",
    "request": "launch",
    "name": "learning-three.js edge",
    "url": "http://192.168.1.100:8887/${relativeFile}",
    "webRoot": "${fileDirname}"
    }]
}

Viewing all articles
Browse latest Browse all 14821

Trending Articles