这是我的工作启动脚本。这启用了使用断点逐行调试我的代码。此外,这与 Edge chromium-browser 一起使用。 (最新的 VS 代码编辑器)
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch localhost in Microsoft Edge",
"type": "edge",
"request": "launch",
"url": "http://localhost:3000/api",
"webRoot": "${workspaceFolder}/ABC-MVP/backend/src",
"sourceMapPathOverrides": {
"webpack:///*": "*",
"webpack:///./*": "${webRoot}/*",
"webpack:///src/*": "${webRoot}/*",
"webpack:///./~/*": "${webRoot}/node_modules/*"
}
},
{
"name": "Launch index.html in Microsoft Edge",
"type": "edge",
"request": "launch",
"port": 3000,
"file": "${workspaceFolder}/index.html"
},
{
"type": "node",
"name": "Debug CRA Tests",
"request": "launch",
"args": [
"app.ts",
"--runInBand",
"--no-cache",
"--env=jsdom"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
//"console": "integratedTerminal",
"internalConsoleOptions": "openOnSessionStart",
"disableOptimisticBPs": true,
"runtimeExecutable":
"${workspaceFolder}/ABC-MVP/backend/node_modules/.bin/react-scripts",
//"${workspaceFolder}/ABC-MVP/backend/src/models",
"protocol": "inspector"
}
]
}