1. 程式人生 > 其它 >在 vscode 除錯(debug) vue js 程式碼的配置

在 vscode 除錯(debug) vue js 程式碼的配置

參考資料
https://vuejs.bootcss.com/cookbook/debugging-in-vscode.html
https://blog.csdn.net/yezonggang/article/details/110070915 按這個也不能進入斷點,需要在 launch.json 加多1行

  1. 配置vue有原始碼,找到這個段即可,可能在 vue.config.js 或 webpack裡面
    configureWebpack: {
    devtool: 'source-map',
    },

  2. vscode 能夠呼叫的 launch.json 配置

{
    // 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": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}/src",
            "breakOnLoad": true,
            "sourceMapPathOverrides": {
                "webpack:///./src/*": "${webRoot}/*",
                "webpack:///src/*": "${webRoot}/*"
            }
        }
    ]
}

本文來自部落格園,作者:正版軟體開發,轉載請註明原文連結:https://www.cnblogs.com/16win-cn/p/15584747.html

網站開發