Skip to content

Commit 9b986be

Browse files
committed
Add VSCode debug run how to
1 parent d8fb9da commit 9b986be

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docs/getting-started/development.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,53 @@ to specify a different flow file:
9999
```
100100
grunt dev --flowFile=my-flow-file.json
101101
```
102+
103+
104+
### Debug run Node-RED in VS Code
105+
106+
It is possible to set-up VS Code to both build and start debugging by simply pressing F5. Once you have cloned the project and open it in VS code, you will need to add an entry in `launch.json` and `tasks.json`...
107+
108+
#### Modify launch.json ...
109+
```
110+
{
111+
"version": "0.2.0",
112+
"configurations": [
113+
{
114+
"type": "node",
115+
"request": "launch",
116+
"name": "Debug node-red",
117+
"skipFiles": [
118+
"<node_internals>/**"
119+
],
120+
"env": { "NODE_ENV": "development" },
121+
"preLaunchTask": "npm: build-dev",
122+
"program": "${workspaceFolder}/packages/node_modules/node-red/red.js"
123+
}
124+
]
125+
}
126+
```
127+
*NOTE: to open launch.json, ctrl+shift+p, type `debug open launch`*
128+
129+
130+
#### Add an entry in tasks.json
131+
```
132+
{
133+
"version": "2.0.0",
134+
"tasks": [
135+
{
136+
"type": "npm",
137+
"script": "build-dev",
138+
"group": "build",
139+
"problemMatcher": [],
140+
"label": "npm: build-dev",
141+
"detail": "build-dev"
142+
}
143+
]
144+
}
145+
```
146+
*NOTE: if you don't have a tasks file, create one with ctrl+shift+p, type `configure task`*
147+
*NOTE: if you already have a tasks file, open it with ctrl+p, type `tasks.json`*
148+
149+
#### Debug Run
150+
Now you can run the project by pressing F5.
151+
*NOTE: If you have more than one config, select `Debug node-red`.*

0 commit comments

Comments
 (0)