vscode 使用JavsScript debugger 插件调试Vue+vite项目

vscode 使用JavsScript debugger 插件调试Vue+vite项目,JavsScript debugger 插件是vscode自带的,我用的vscode 版本Version: 1.88.1

插件有了,试着点击vscode 运行和调试按钮

选择Web App(Chrome)

出现Launch Chrome against 点击运行

启动了Chrome,项目启动失败,因为端口改为了8080 并且自动生成了launch.json文件

需要先启动项目 npm run dev 或者yarn dev, 把launch.json端口改成项目的端口,关掉先前调试的浏览器窗口,重新开始运行调试。

kotlin 复制代码
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:5173", // 换成项目的端口
      "webRoot": "${workspaceFolder}"
    }
  ]
}

进入断点了,但是另一个文件断点却是没生效,unbound,因为项目还没执行到没生效的那个文件,执行到这个文件,就生效了,如下图

也可以新建js debug terminal 运行项目打开调试断点


想要在vite.config.ts打断点,需要新建js debug terminal,运行项目,断点自动执行

相关推荐
yiyesushu15 小时前
GitHub Copilot 在 vscode 中使用之 Prompt
人工智能·visual studio code
程序员Supers3 天前
VSCode 好用插件推荐
visual studio code
慢功夫3 天前
💡第五篇:VSCode插件是如何与主进程通信的?
前端·visual studio code
凉凉的知识库4 天前
用 GPT-5.6 SOL 写了个 VS Code 插件,效果出乎意料
api·测试·visual studio code
土土哥tutuge6 天前
开源项目 Claude Code Notifier Plus:让 Claude Code 真正需要你时再提醒你
ai编程·visual studio code
慢功夫7 天前
💡第四篇:编辑器内核, Monaco model、URI、dirty 状态和 tabs 是怎么协作的?
前端·visual studio code
annekqiu8 天前
VS code 部署agent
github·visual studio code
RequieMa8 天前
再见了,所有的 VS Code 预览窗
visual studio code
mCell10 天前
从 VS Code 学系统架构:回到当时,理解它为什么这样演进
架构·源码阅读·visual studio code
你脑门上的脚印11 天前
VSCode 更新后 Cmd(Ctrl)+点击终端地址在编辑器内部打开?一个设置帮你搞定
visual studio code