vs code调试vue3

475 阅读1分钟

具体的不说了,重点记录两个配置。

但是只能调试部分代码,vue文件打断点完全不行,可能还没完全支持

vue.config.js添加代码

module.exports = {
  configureWebpack: {
    devtool: 'source-map'
  }
}

配置vs code的运行和调试

{
  // 使用 IntelliSense 了解相关属性。 
  // 悬停以查看现有属性的描述。
  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "vuejs: chrome",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceFolder}",
      "breakOnLoad": true
    }
  ]
}