Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit f9eae65

Browse files
author
Bowden Kelly
authored
Merge pull request #34 from thanhtdt/master
add attach debug configuration
2 parents 0026e88 + 49bb4c1 commit f9eae65

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.vscode/launch.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "attach",
10+
"name": "Attach",
11+
"port": 9229
12+
},
713
{
814
"type": "node",
915
"request": "launch",

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ Now just set your breakpoints and go!
299299
VS Code will try to launch on the same port and error out.
300300
Likewise be sure to stop the debugger before returning to your normal `npm start` process.
301301

302+
#### Using attach debug configuration
303+
VS Code debuggers also support attaching to an already running program. The `Attach` configuration has already configured, everything you need to do is change `Debug Configuration` to `Attach` and hit `F5`.
304+
305+
> Tips! Instead of running `npm start`, using `npm run debug` and `Attach Configuration` that make you don't need to stop running project to debug.
306+
302307
## Testing
303308
For this project, I chose [Jest](https://facebook.github.io/jest/) as our test framework.
304309
While Mocha is probably more common, Mocha seems to be looking for a new maintainer and setting up TypeScript testing in Jest is wicked simple.

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"build-sass": "node-sass src/public/css/main.scss dist/public/css/main.css",
2020
"watch-sass": "node-sass -w src/public/css/main.scss dist/public/css/main.css",
2121
"tslint": "tslint -c tslint.json -p tsconfig.json",
22-
"copy-static-assets": "node copyStaticAssets.js"
22+
"copy-static-assets": "node copyStaticAssets.js",
23+
"debug": "npm run build && npm run watch-debug",
24+
"serve-debug": "nodemon --inspect dist/server.js",
25+
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run serve-debug\""
2326
},
2427
"jest": {
2528
"globals": {
@@ -93,4 +96,4 @@
9396
"tslint": "^5.0.0",
9497
"typescript": "^2.4.0"
9598
}
96-
}
99+
}

0 commit comments

Comments
 (0)