我发现很多关于这种调试经验的问题而没有好的答案。
这是我在调试浏览器内情景的配置。 1.安装适用于Chrome扩展程序的Debugger。 2.在nuxt.config.js中添加配置:
extend(cfg, ctx) {
cfg.devtool = 'source-map';
}
3.添加启动配置:
{
"type": "chrome",
"request": "launch",
"name": "Debug Front in Chrome",
"url": "http://localhost:YourSitePortHere",
"webRoot": "${workspaceFolder}",
"breakOnLoad": true,
"sourceMapPathOverrides": {
"webpack:///*": "${webRoot}/*"
}
}