Vscode adding browser debugging and JS debugging methods
1, directly press F5 can be debugged method or click the Run button (you can directly run the HTML file or JS file)
The configuration in the Launch.json file is as follows:
{
"version": "0.2.0", "configurations": [{ "name": "Google Browse Browser ",//Run HTML file, open with Google Chrome " type ":" Chrome ", &NBSP ; "Request": "Launch", "url": "${file}", " Sourcemaps ": true, " webRoot ":" ${workspaceroot} " },&NB Sp { "name": "Nodelauch",//debug JS individually, i.e. you can run js   ; "type": "Node", "request": "Launch", &NB Sp "program": "${file}",//This is configured as the file you want to debug, ${file} currently open file "Stoponentry" : false, "args": [], "CWD": "${workspace Root} ", "runtimeexecutable": null, "Runtimeargs": [&NB Sp "--nolazy" ], &NBSP ; "env": { "node_env": "Development" &NBSP ; }, "console": "Internalconsole", "Prelaunchtask": ", " sourcemaps ": false, &NBSP ; "OutDir": null } ]}
2, the second method ctrl+shift+b shortcut keys run the HTML file, in the Tasks.json configured as follows:
{"Version": "0.1.0", "command": "", "Isshellcommand": false, "args": ["${file}"], "showoutput": "Always", "Windows": {"command": "C:/users/shannonliang/appdata/local/google/chrome/application/chrome.exe"}, "Tas KS ": [{" TaskName ":" Webserver "," Isbuildcommand ": True," showoutput ":" Always "}]}
3, if the second method, do not want to press this shortcut every time, please refer to NPM Configuration node service method:
Http://stackoverflow.com/questions/30039512/how-to-view-my-html-code-in-browser-with-visual-studio-code
Vscode add browser debugging and JS debugging method Summary