Vscode add browser debugging and JS debugging method Summary

Source: Internet
Author: User

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    &nbsp ;       "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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.