vscode调试Vue
1、参考https://cn.vuejs.org/v2/cookbook/debugging-in-vscode.html2、安装Debugger for Chrome3、vue.config.jsconfigureWebpack: {devtool: 'source-map'},4、launch.json端口与vue.config.js中的port一致{// 使用 IntelliSense 了解
·
3、vue.config.js
configureWebpack: {
devtool: 'source-map'
},
4、launch.json
端口与vue.config.js中的port一致
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "vuejs: chrome",
"url": "http://localhost:9001",
"webRoot": "${workspaceFolder}/src",
"breakOnLoad": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
]
}
5、运行
npm run dev
6、下断点,并启动调试
7、命中断点
更多推荐
已为社区贡献1条内容
所有评论(0)