1.配置tsconfig.json 

"sourceMap": true
2.终端->配置任务->tsc: 监视 - tsconfig.json
{
    "type": "typescript",
    "tsconfig": "tsconfig.json",
    "option": "watch",
    "problemMatcher": [
        "$tsc-watch"
    ],
    "group": "build",
    "label": "tsc: 监视 - tsconfig.json"
}

3.配置launch.json

"configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "启动程序",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}/dist/src/index.js",
            "preLaunchTask": "tsc: 监视 - tsconfig.json",
            "outFiles": [
                "${workspaceFolder}/dist/src/**/*.js"
            ]
        }
    ]

 

 posted on 2020-04-10 14:00  Allen-0827  阅读(544)  评论(0)    收藏  举报