0

vodode (github repo)와 함께 nodemon 디버그 구성이 있습니다. 디버깅하는 동안 Sourcemap은 장소 (익스프레스 경로)를 제외하고는 작동하지 않습니다. 궁금 이유입니다 :전체 응용 프로그램에서 vscode (nodemon 디버깅)에서 소스 맵이 작동하지 않습니다.

.vscode/launch.json

{ 
    "version": "0.2.0", 
    "configurations": [ 
     { 
      "type": "node", 
      "request": "attach", 
      "name": "Quick Attach", 
      "port": 18531, 
      "sourceMaps": true, 
      "address": "localhost", 
      "restart": true 
     } 
    ] 
} 

내 typescipt 응용 프로그램 :

import * as http from 'http'; 
import * as url from 'url'; 
import * as express from 'express'; 
import * as bodyParser from 'body-parser'; 
import errorHandler = require('errorhandler'); 
import methodOverride = require('method-override'); 
const cors = require('cors'); 
const app = express(); 
let port: number = 3000; 
app.use(bodyParser.urlencoded({ extended: true })); 
app.use(bodyParser.json()); 
app.use(methodOverride()); 
app.use(errorHandler()); 
app.use(cors()); 

app.get('/test', (req, res) => { 
    res.send('hello') // SOURCE MAP WORKS ONLY HERE 
}); 

app.listen(port, function() { 
    console.log('Server listening on port %d in %s mode', port, app.settings.env); 
}); 

export var App = app; 

및 tsconfig.json 또한

{ 
    "compileOnSave": true, 
    "compilerOptions": { 
     "declaration": false, 
     "experimentalDecorators": true, 
     "emitDecoratorMetadata": true, 
     "outDir": "./dist", 
     "sourceMap": true, 
     "skipLibCheck": true 
    }, 
    "files": [ 
     "index.ts" 
    ] 
    } 

내 nodemon 명령 : nodemon --inspect=18531 dist/index.js 및 typescipt c ommand : tsc -w

나는 실행하고 있습니다 : - 윈도우 10 기업 - nodejs를 : 9.2.0 - nodemon : 1.12.1 OK 어떻게 든이 내에서라도에 노력하고 있습니다

+0

당신이 ** 비주얼 스튜디오 코드 1.19.0했다 ... Windows에서 –

답변

0

nodejs 문제없이 9.2.0 : launch.json

 { 
      "type": "node", 
      "request": "launch", 
      "remoteRoot": "${workspaceRoot}/dist", 
      "name": "Lanuch full nodemon", 
      "runtimeExecutable": "nodemon", 
      "program": "${workspaceFolder}/dist/index.js", 
      "restart": true, 
      "sourceMaps": true, 
      "console": "internalConsole", 
      "internalConsoleOptions": "neverOpen" 
     } 

tsconfig.json

{ 
    "compileOnSave": true, 
    "compilerOptions": { 
     "declaration": false, 
     "experimentalDecorators": true, 
     "emitDecoratorMetadata": true, 

     "watch": true, 
     "outDir": "./dist", 
     "rootDir": "./", 
     "sourceMap": true, 
     "skipLibCheck": true 
    } 
    } 
+0

도하고있다 "소스지도가 작동하지 않습니다"말할 때 당신은 더 구체적으로 수 내부자 ** 버그. –