Skip to content

Commit e9a05b1

Browse files
committed
config debug
Config debug on .vscode to run in attach mode on port 9229, modify .gitignore to not ignore this file. On the package.json add explicity what port the debug need to run and add --nolazy flag reason: https://stackoverflow.com/questions/21534565/what-does-the-node-js-nolazy-flag-mean Expose the debug port only if docker-compose-debug.yaml file is runned. Add inlineSourceMap flag to tsconfig.json reference: https://www.typescriptlang.org/tsconfig#inlineSourceMap
1 parent 249b502 commit e9a05b1

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ dist/
33
.index/
44
*.log
55
.idea/
6-
.vscode/
7-
coverage/
6+
coverage/
7+
.vscode/*
8+
!.vscode/launch.json

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "attach",
10+
"name": "Docker: Attach to Node",
11+
"remoteRoot": "/api",
12+
"port": 9229,
13+
"skipFiles": [
14+
"<node_internals>/**"
15+
],
16+
"restart": true
17+
}
18+
]
19+
}

docker-compose.debug.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
services:
22
api:
3-
command: bash -c "yarn install && yarn debug"
3+
command: bash -c "yarn install && yarn debug"
4+
ports:
5+
- 9229:9229
6+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"start": "node . --transpile-only --files .| pino-pretty -c -l",
6262
"build": "tsc -p tsconfig.prod.json",
6363
"dev": "tsnd --transpile-only --files src/index.ts | pino-pretty -c -l",
64-
"debug": "tsnd --transpile-only --inspect --files src/index.ts | pino-pretty -c -l",
64+
"debug": "tsnd --transpile-only --inspect=0.0.0.0:9229 --nolazy --files src/index.ts | pino-pretty -c -l",
6565
"cli": "tsnd --transpile-only --files src/index.ts --cli",
6666
"remote": "ts-node bin/replClient.ts",
6767
"test": "jest"

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"outDir": "./dist",
99
"rootDir": "./src",
1010
"removeComments": false,
11+
"inlineSourceMap": true,
1112
"strict": true,
1213
"noImplicitAny": false,
1314
"noUnusedLocals": true,

0 commit comments

Comments
 (0)