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

相关推荐
怦怦蓝5 小时前
IDEA 项目打印日志全攻略:从基础使用到高级配置
java·开发语言·debug
冬奇Lab20 小时前
稳定性性能系列之十二——Android渲染性能深度优化:SurfaceFlinger与GPU
android·性能优化·debug
2501_941871457 天前
面向分布式事务与最终一致性设计的互联网系统高可靠架构与多语言工程实践分享
intellij-idea·visual studio code
冬奇Lab7 天前
Android车机代驾模式黑屏之谜:一次STR唤醒问题的深度剖析
android·性能优化·debug
Eiceblue8 天前
Python 实现 CSV 转 TXT 格式 (单文件 + 批量处理)
开发语言·python·visual studio code
冬奇Lab10 天前
一次必现ANR问题的深度分析与解决之旅:当NestedScrollView遇上VelocityTracker
android·性能优化·debug
冬奇Lab11 天前
一次 Android 车机黑屏问题的深度剖析:当显示驱动遇上中断风暴
android·性能优化·debug
冬奇Lab12 天前
稳定性性能系列之六——Java异常与JE分析实战
android·性能优化·debug