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,运行项目,断点自动执行

相关推荐
普通码农6 小时前
在 Cursor 中使用 VS Code 扩展
visual studio code·cursor
用户94658117999181 天前
我做了个 VSCode 插件,让你在写代码时顺手炒股
visual studio code
甲枫叶2 天前
【claude产品经理系列11】实现后端接口——数据在背后如何流动
java·数据库·人工智能·产品经理·ai编程·visual studio code
楼田莉子4 天前
C++项目:日志&&线程池
linux·c++·学习·visual studio code
xzjiang_3655 天前
检查是否安装了MinGW 编译器
开发语言·qt·visual studio code
淡海水9 天前
【节点】[EyeSurfaceTypeDebug节点]原理解析与实际应用
unity·游戏引擎·debug·shadergraph·图形·surface·eye
沐墨染11 天前
黑词分析与可疑对话挖掘组件的设计与实现
前端·elementui·数据挖掘·数据分析·vue·visual studio code
十五年专注C++开发11 天前
C++中各平台表示Debug的宏
开发语言·c++·debug
玹外之音12 天前
VSCode + Codex · 32ai 零魔法集成
visual studio code
执风挽^12 天前
Python_func_principle
开发语言·python·算法·visual studio code