Use vscode to debug the code, it is very easy to use in actual testing
Note: Only vue2.x is supported now.
1. Configure launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"type": "pwa-chrome",
"request": "launch",
"url": "http://localhost:8999",
"sourceMapPathOverrides": {
//配置映射
"test://src/*": "${workspaceRoot}/src/*" // 映射的路径
}
}
]
}
2. configuration webpack output devtoolModuleFilenameTemplate
output: {
...
devtoolModuleFilenameTemplate: 'test://[resource-path]' //test 为自定义名称
}