[英]How to debug node.js app running with TypeScript in WebStorm?
如何调试WebStorm中以TypeScript运行的node.js应用程序?
Update tsconfig.json to add sourceMap=true
property in compilerOptions
更新tsconfig.json添加
sourceMap=true
财产compilerOptions
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"noImplicitReturns": true,
"outDir": "lib",
"target": "es6",
"preserveConstEnums": true,
"removeComments": false,
"sourceMap": true,
"inlineSources": true,
"typeRoots": [
"./node_modules/@types"
]
},
"exclude": [
"node_modules",
"lib"
]
}
In the Edit Run/Debug Configuration , 在“ 编辑运行/调试配置”中 ,
--inspect=3000 --require ts-node/register
Mention your entry .ts file in Javascript file field. 在Javascript文件字段中提及您的条目.ts文件。 In my case it is bin/www.ts
在我的情况下是bin / www.ts
Debug your newly created configuration 调试新创建的配置
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.