Skip to content

Commit

Permalink
Add VS Code debugger config (github#16819)
Browse files Browse the repository at this point in the history
* add config for using vscode debugger

reference: https://github.com/Microsoft/vscode-recipes/tree/master/nodemon

* some docs

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
  • Loading branch information
vanessayuenn and heiskr committed Dec 10, 2020
1 parent c0663d4 commit f44d5aa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"processId": "${command:PickProcess}",
"restart": true,
"protocol": "inspector",
},
]
}
12 changes: 12 additions & 0 deletions contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ As an alternative, you can simply use [GitHub Codespaces](https://github.com/fea

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

### Debugging with VS Code

This repo has configuration for debugging with VS Code's built-in Node Debugger.

1. After running the build steps, start the app by running `npm run debug`.
2. In VS Code, click on the Debugging icon in the Activity Bar to bring up the Debug view.
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.
4. Select the node process that's started with the `--inspect` flag.
5. Debugger has now been attached. Enjoy!

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).

### Viewing a top-level table of contents

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.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"scripts": {
"start": "cross-env NODE_ENV=development ENABLED_LANGUAGES='en,ja' nodemon server.js",
"dev": "npm start",
"debug": "cross-env NODE_ENV=development ENABLED_LANGUAGES='en,ja' nodemon --inspect server.js",
"rest-dev": "script/rest/update-files.js && npm run dev",
"build": "cross-env NODE_ENV=production npx webpack --mode production",
"start-all-languages": "cross-env NODE_ENV=development nodemon server.js",
Expand Down

0 comments on commit f44d5aa

Please sign in to comment.