-
On VS Code's Extensions' Marketplace, download Debugger for Chrome
-
Once downloaded, create a launch configuration file.
2.1 On workspace root directory, create .vscode folder
2.2 Under the said folder, create a
launch.json
This file will contain all your debug configurations2.3 Paste the following config on
launch.json
{ "version": "0.2.0", "configurations": [ { "type": "chrome", "request": "launch", "name": "Launch Chrome against localhost", "url": "http://localhost:3000", "webRoot": "${workspaceFolder}/src", "timeout": 50000 } ] }
You can also let VS Code create it for you. Just launch the debug mode and if VS Code can't find any debug configurations on your workspace, it will create one for you.
-
Build the development files by executing below command:
npm start
-
Back on the IDE, start the debug session.
To do this, select Debug from the side bar, then click on the Start Debugging button. Make sure to select the debug configuration you just created. In this case, the debug definition is Launch Chrome against localhost -
Happy Debugging!
Keyboard shortcuts:
F5
- start debuggingF9
- add breakpointsF10
- step overF11
- step intoShift
+F10
- step outShift
+F5
- stop debugging
- Bracket Pair Colorizer 2
- Babel JavaScript
- Debugger for Chrome
- ES7 React/Redux/GraphQL/React-Native snippets
- ESLint
- JavaScript (ES6) code snippets
- Todo Tree