Skip to content

Commit f44d5aa

Browse files
vanessayuennheiskr
andauthored
Add VS Code debugger config (github#16819)
* add config for using vscode debugger reference: https://github.com/Microsoft/vscode-recipes/tree/master/nodemon * some docs Co-authored-by: Kevin Heis <[email protected]>
1 parent c0663d4 commit f44d5aa

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.vscode/launch.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "attach",
7+
"name": "Node: Nodemon",
8+
"processId": "${command:PickProcess}",
9+
"restart": true,
10+
"protocol": "inspector",
11+
},
12+
]
13+
}

contributing/development.md

+12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ As an alternative, you can simply use [GitHub Codespaces](https://github.com/fea
3232

3333
In a matter of minutes, you will be ready to edit, preview and test your changes directly from the comfort of your browser.
3434

35+
### Debugging with VS Code
36+
37+
This repo has configuration for debugging with VS Code's built-in Node Debugger.
38+
39+
1. After running the build steps, start the app by running `npm run debug`.
40+
2. In VS Code, click on the Debugging icon in the Activity Bar to bring up the Debug view.
41+
3. In the Debug View, select the **'Node: Nodemon'** configuration, then press F5 or click the green play button. You should see all of your running node processes.
42+
4. Select the node process that's started with the `--inspect` flag.
43+
5. Debugger has now been attached. Enjoy!
44+
45+
For more detailed instructions, please see this [VS Code recipe](https://github.com/Microsoft/vscode-recipes/tree/master/nodemon). You can also learn more about debugging using VS Code [here](https://code.visualstudio.com/docs/editor/debugging).
46+
3547
### Viewing a top-level table of contents
3648

3749
While running the local server, you can visit [localhost:4000/dev-toc](http://localhost:4000/dev-toc) to view a top-level TOC of all the content in the site. This page is not available on https://docs.github.com. It was created for internal GitHub writers' use.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"scripts": {
151151
"start": "cross-env NODE_ENV=development ENABLED_LANGUAGES='en,ja' nodemon server.js",
152152
"dev": "npm start",
153+
"debug": "cross-env NODE_ENV=development ENABLED_LANGUAGES='en,ja' nodemon --inspect server.js",
153154
"rest-dev": "script/rest/update-files.js && npm run dev",
154155
"build": "cross-env NODE_ENV=production npx webpack --mode production",
155156
"start-all-languages": "cross-env NODE_ENV=development nodemon server.js",

0 commit comments

Comments
 (0)