2017-03-06 36 views
0

我將使用此項目express-typescript-starter,但是當我在VS代碼上放置斷點並開始調試時,他說「斷點因爲生成的代碼而被忽略未找到(源圖問題?)「。無法調試我的ts-node express項目(由於生成的代碼未找到而忽略了斷點)

launch.json

"version": "0.2.0", 
"configurations": [ 
    { 
     "type": "node", 
     "request": "launch", 
     "name": "Launch Program", 
     "program": "${workspaceRoot}\\index.js", 
     "cwd": "${workspaceRoot}" 
    }, 
    { 
     "type": "node", 
     "request": "attach", 
     "name": "Attach to Process", 
     "port": 5858 
    } 
] 

tsconfig.json

"compilerOptions": { 
    "target": "es5", 
    "module": "commonjs", 
    "declaration": false, 
    "noImplicitAny": false, 
    "removeComments": true, 
    "noLib": false, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "sourceMap": true, 
    "listFiles": false 
}, 
"exclude": [ 
    "node_modules" 
] 

回答

0

應該用TSC生成的文件JS和JS.MAP是必要的tasks.json。但我不知道爲什麼,因爲我把TS文件的斷點和作品,我...

"version": "0.1.0", 
"command": "tsc", 
"isShellCommand": true, 
"args": ["-p", "."], 
"showOutput": "silent", 
"problemMatcher": "$tsc" 

庫與解決方案:

https://github.com/bsalesc/express-typescript-starter/

相關問題