Add debugging run script

With this script one can easily launch a debuggable instance of the
current source code and then use vscode's debugger to attach to it.
This commit is contained in:
Wolvan 2022-01-01 04:06:02 +01:00
parent 5f9f2efee7
commit 08cb0df5e5
3 changed files with 19 additions and 0 deletions

17
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"port": 9229,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
}
]
}

View file

@ -29,4 +29,5 @@ Execute the scripts with `npm run <script>`
- `lint` - Runs `eslint` and checks for code styling problems - `lint` - Runs `eslint` and checks for code styling problems
- `build` - Compile the TypeScript Source to `dist/` - `build` - Compile the TypeScript Source to `dist/`
- `test` - Runs `lint`, `find-todo` and `mocha` in order - `test` - Runs `lint`, `find-todo` and `mocha` in order
- `debug` - Start the `./src/main.ts` with node and start the debugger on port 9229
- `start` - Run `test` and `build`, then try and execute the `./dist/main.js` in the `./dist` directory to test - `start` - Run `test` and `build`, then try and execute the `./dist/main.js` in the `./dist` directory to test

View file

@ -10,6 +10,7 @@
"lint": "eslint .", "lint": "eslint .",
"build": "rimraf ./dist && tsc", "build": "rimraf ./dist && tsc",
"test": "npm run lint && npm run find-todo && npm run mocha", "test": "npm run lint && npm run find-todo && npm run mocha",
"debug": "node --inspect -r ts-node/register src/main",
"start": "npm test && npm run build && node ./dist/main.js", "start": "npm test && npm run build && node ./dist/main.js",
"prepublish": "npm test && npm run build" "prepublish": "npm test && npm run build"
}, },