From fd4eae142c0d8b3cdada4061ae6e9d0ba1b5fb20 Mon Sep 17 00:00:00 2001 From: yonatanLehman <32838532+yonatanLehman@users.noreply.github.com> Date: Mon, 18 Jan 2021 15:00:08 +0200 Subject: [PATCH 1/2] Update debugging-the-build-process.md --- docs/docs/debugging-the-build-process.md | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/docs/debugging-the-build-process.md b/docs/docs/debugging-the-build-process.md index 766c21cec5cea..8b278a9c711d0 100644 --- a/docs/docs/debugging-the-build-process.md +++ b/docs/docs/debugging-the-build-process.md @@ -83,6 +83,8 @@ Using built-in debuggers in code editors is very convenient. You will be able to We won't go in depth here about how to debug in VS Code - for that you can check the [excellent VS Code documentation](https://code.visualstudio.com/docs/editor/debugging). We will however share a launch configuration needed to run and debug Gatsby: +On Linux: + ```json:title=launch.json { "version": "0.2.0", @@ -109,6 +111,38 @@ We won't go in depth here about how to debug in VS Code - for that you can check } ``` +On Windows use the following: +```json:title=launch.json +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Gatsby develop", + "type": "pwa-node", + "request": "launch", + "program": "${workspaceRoot}/node_modules/.bin/gatsby", + "windows": { + "program": "${workspaceRoot}/node_modules/gatsby/dist/bin/gatsby" + }, + "args": ["develop"], + "runtimeArgs": ["--nolazy"], + "console": "integratedTerminal" + }, + { + "name": "Gatsby build", + "type": "pwa-node", + "request": "launch", + "program": "${workspaceRoot}/node_modules/.bin/gatsby", + "windows": { + "program": "${workspaceRoot}/node_modules/gatsby/dist/bin/gatsby" + }, + "args": ["build"], + "runtimeArgs": ["--nolazy"], + "console": "integratedTerminal" + } + ] +} +``` After putting a breakpoint in `gatsby-node.js` and using the `Start debugging` command from VS Code you can see the final result: ![VSCode breakpoint hit](./images/vscode-debug.png) From ce7c4f932b850a90832ff0c1d77a006b2b2b66b0 Mon Sep 17 00:00:00 2001 From: Lennart Date: Mon, 25 Jan 2021 11:10:19 +0100 Subject: [PATCH 2/2] format --- docs/docs/debugging-the-build-process.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/docs/debugging-the-build-process.md b/docs/docs/debugging-the-build-process.md index 8b278a9c711d0..453f6bd1791cf 100644 --- a/docs/docs/debugging-the-build-process.md +++ b/docs/docs/debugging-the-build-process.md @@ -83,7 +83,7 @@ Using built-in debuggers in code editors is very convenient. You will be able to We won't go in depth here about how to debug in VS Code - for that you can check the [excellent VS Code documentation](https://code.visualstudio.com/docs/editor/debugging). We will however share a launch configuration needed to run and debug Gatsby: -On Linux: +### Linux ```json:title=launch.json { @@ -111,7 +111,8 @@ On Linux: } ``` -On Windows use the following: +### Windows + ```json:title=launch.json { "version": "0.2.0", @@ -143,6 +144,7 @@ On Windows use the following: ] } ``` + After putting a breakpoint in `gatsby-node.js` and using the `Start debugging` command from VS Code you can see the final result: ![VSCode breakpoint hit](./images/vscode-debug.png)