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

相关推荐
卷卷的小趴菜学编程1 天前
c++之多态
c语言·开发语言·c++·面试·visual studio code
不浪brown4 天前
服务器繁忙?在 VSCode 中运行本地DeepSeek-R1保姆级教程!仅需10分钟!亲测有效!(建议收藏)
人工智能·visual studio code·deepseek
晚秋大魔王5 天前
C# 添加图标
c#·visual studio code
长安第一美人8 天前
Qt中2个.app源文件之间函数与变量的互相调用
开发语言·c++·嵌入式硬件·qt·visual studio code
一梦南柯12 天前
开发新体验:基于Ollama+deepseek打造私有化代码助手
人工智能·visual studio code·deepseek
敲敲敲敲暴你脑袋12 天前
vue3中ref响应式变量为什么script中要用.value,而template模板中不需?
javascript·vue.js·visual studio code
红虾程序员15 天前
CSS盒子模型详解
前端·pycharm·intellij-idea·css3·html5·visual studio code
天机️灵韵16 天前
Continue 与 CodeGPT 插件 的对比分析
ide·visualstudio·intellij-idea·visual studio code
Lorcian20 天前
web前端12--表单和表格
前端·css·笔记·html5·visual studio code
Lorcian1 个月前
web前端11--伪类与过渡
前端·css·笔记·html5·visual studio code