vscode 如何在edge浏览器运行ts项目并在编辑器上进行断点调试
时间: 2023-08-10 08:02:17 浏览: 134
要在VSCode中使用Edge浏览器运行TypeScript项目并进行断点调试,您需要遵循以下步骤:
1. 在项目根目录中打开终端,运行以下命令来安装必要的依赖项:
```
npm install -g typescript ts-node-dev
```
2. 添加以下配置到项目的 `launch.json` 文件中:
```
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "Launch via ts-node-dev",
"request": "launch",
"runtimeArgs": ["-r", "ts-node/register", "-r", "tsconfig-paths/register", "src/server.ts"],
"restart": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": ["<node_internals>/**"]
},
{
"type": "pwa-msedge",
"request": "launch",
"name": "Launch Edge against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
```
3. 运行项目,按 `F5` 键启动调试模式。
4. 在Edge浏览器中打开 `http://localhost:3000`,您应该能够看到您的应用程序正在运行。
5. 在VSCode中打开您的TypeScript文件并设置断点,您应该能够开始调试了。
希望这可以帮助您在VSCode中使用Edge浏览器运行TypeScript项目并进行断点调试。
阅读全文
相关推荐















