Debugging

Edit

When debugging a koa-cola project, we need to add two dependencies:

1
npm i ts-node typescript -S

and add debug config in vscode:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"name": "DebugApp",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
"stopOnEntry": false,
"args": [],
"runtimeArgs": [
"-r", "ts-node/register",
"${workspaceRoot}/app.ts"
],
"sourceMaps": true,
"console": "internalConsole",
"internalConsoleOptions": "openOnSessionStart"
}
Then we can debug ts via vscode.

In addition, koa-cola integrate redux debug tool, we can use the chrome's redux plug-in:

Drawing