Add VS Code debugger config (#16819)
* 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>
This commit is contained in:
13
.vscode/launch.json
vendored
Normal file
13
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "attach",
|
||||||
|
"name": "Node: Nodemon",
|
||||||
|
"processId": "${command:PickProcess}",
|
||||||
|
"restart": true,
|
||||||
|
"protocol": "inspector",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -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.
|
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
|
### 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.
|
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.
|
||||||
|
|||||||
@@ -150,6 +150,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cross-env NODE_ENV=development ENABLED_LANGUAGES='en,ja' nodemon server.js",
|
"start": "cross-env NODE_ENV=development ENABLED_LANGUAGES='en,ja' nodemon server.js",
|
||||||
"dev": "npm start",
|
"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",
|
"rest-dev": "script/rest/update-files.js && npm run dev",
|
||||||
"build": "cross-env NODE_ENV=production npx webpack --mode production",
|
"build": "cross-env NODE_ENV=production npx webpack --mode production",
|
||||||
"start-all-languages": "cross-env NODE_ENV=development nodemon server.js",
|
"start-all-languages": "cross-env NODE_ENV=development nodemon server.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user