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 天前
Claude Code使用技巧-为Claude Code接入国产大模型
ai·ai编程·visual studio code
TUTO_TUTO6 天前
【python-词汇指标提取工具开发】自学笔记(1)-后端程序
人工智能·python·pandas·visual studio code
Clarice__6 天前
Anaconda安装、使用教程
windows·python·机器学习·conda·visual studio code
C++ 老炮儿的技术栈7 天前
CMFCEditBrowseCtrl用法一例
c语言·开发语言·c++·windows·qt·visual studio code
luoqice9 天前
彻底清除vscode注册表解决重装后无法使用问题
visual studio code
xiaobobo333011 天前
EIDE的最新版本已经默认只支持debug调试STM32单片机了
stm32·单片机·debug·eide
晚霞的不甘14 天前
Flutter for OpenHarmony 实战:[开发环境搭建与项目编译指南]
git·flutter·react native·react.js·elasticsearch·visual studio code
散峰而望15 天前
OJ 题目的做题模式和相关报错情况
java·c语言·数据结构·c++·vscode·算法·visual studio code
智驾18 天前
【瑞萨RA x Zephyr评测】四、在线调试功能
vscode·debug·瑞萨·zephyr·renesas·ra6e2·fpb-ra6e2
冬奇Lab18 天前
稳定性性能系列之十五——系统稳定性监控体系建设:从指标到预警的完整方案
android·性能优化·debug