(在某种程度上与此 相关但更具体到VsCode)
我试图使用visual studio代码调试AngularU入门套件.但是它将ts输出合并到一个bundle.js中,并带有一个bundle.js.map:
?web
?dist
?client
?server
?bundle.js
?bundle.js.map
?src
?server.ts
?client.ts
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时,我从VS UI收到错误:
request 'launch': cannot launch program '/home/.../web/src/server.ts'; setting the 'outDir' attribute might help
Run Code Online (Sandbox Code Playgroud)
OUTDIR工作在我的其他项目罚款(不使用的WebPack)时,输出文件不会被合并,但在这里它不帮助.很确定他正在寻找server.js(但只有一个bundle.js及其地图文件).
生成的单个文件输出是否有任何outFile选项?
我的launch.json:
{
"name": "WebServer",
"type": "node",
"request": "launch",
"program": "./web/src/server.ts",
"stopOnEntry": false,
"args": [],
"cwd": "./web",
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": true,
"outDir": "./web/dist/server"
}
Run Code Online (Sandbox Code Playgroud)
编辑:当我将webpack服务器输出重命名为server.js和server.map.js(而不是bundle.*)时它会运行,但不幸的是断点不起作用:
根据本教程, …