Skip to content

Commit 4d604fc

Browse files
committed
chore: enable debug with vscode
1 parent 03f98d9 commit 4d604fc

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ services:
2525
# When build exists, to name the container use the image tag
2626
image: clean-node-api
2727
restart: always
28-
command: npm run start
28+
command: npm run debug
2929
# WORKDIR path of project build
3030
volumes:
3131
- ./dist:/usr/src/clean-node-api/dist
32+
- ./package.json:/usr/src/clean-node-api/package.json
3233
ports:
3334
- "3333:3333"
35+
- "9222:9222"
3436
# Link access api with mongo
3537
links:
3638
- mongo

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"start": "node dist/main/server.js",
88
"build": "rimraf dist && tsc",
9+
"debug": "node --inspect=0.0.0.0:9222 --nolazy dist/main/server.js",
910
"up": "npm run build && docker-compose up -d",
1011
"down": "docker-compose down",
1112
"test": "jest --passWithNoTests --silent --noStackTrace --runInBand",

tsconfig.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
2-
"compilerOptions": {
3-
"outDir": "dist", // Where the .js files to be interpreted by the node
4-
"module": "CommonJS", // Type imports, no require
5-
"target": "ES2019",
6-
"esModuleInterop": true, // Converts modules that do not use commonjs
7-
"skipLibCheck": true,
8-
},
9-
"include": ["src"],
10-
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
2+
"compilerOptions": {
3+
"outDir": "dist", // Where the .js files to be interpreted by the node
4+
"module": "CommonJS", // Type imports, no require
5+
"target": "ES2019",
6+
"esModuleInterop": true, // Converts modules that do not use commonjs
7+
"skipLibCheck": true,
8+
/*
9+
shows which ts file it generated the js,
10+
this helps to find the location of the file to debug
11+
*/
12+
"sourceMap": true,
13+
},
14+
"include": ["src"],
15+
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
1116
}

0 commit comments

Comments
 (0)