主要分为以下三个步骤
- 安装 debug for chrome
- 配置 launch.json 文件
配置内容如下
{
"version": "0.2.0",
"configurations": [{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000", // 改为目标 url
"sourceMaps": true,
"webRoot": "${workspaceFolder}",
"skipFiles": [
"node_modules/**"
],
"sourceMapPathOverrides": {
"webpack:///*": "${webRoot}/*"
}
}]
}
- 打断点,在 Debug 模块启动调试
本配置参考 csdn 博客进行配置,详细链接在此 链接
原文地址:https://www.cnblogs.com/yaolin1228/p/11625016.html
时间: 2024-11-04 03:54:14