调试

修改

如果需要调试koa-cola项目,需要添加两个依赖npm i ts-node typescript -S,然后在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"
}

便可享受vscode的调试ts的乐趣。

另外,koa-cola加了redux调试支持,你也可以使用chrome的redux插件调试:

Drawing