- 安装 vscode-chrome-debug
- 进行插件配置(配置如下)
launch.json
{
"version": "0.2.0",
"configurations": [{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"sourceMaps": true,
"webRoot": "${workspaceRoot}/app",
"diagnosticLogging": true,
"sourceMapPathOverrides": {
"ember-debug-demo/*": "${workspaceRoot}/app/*" //ember-debug-demo is the project name i.e the name of the file generated in dist\assets\<Project Name>.js
}
}, {
"name": "Attach to Chrome, with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"webRoot": "${workspaceRoot}/app",
"diagnosticLogging": true,
"sourceMapPathOverrides": {
"ember-debug-demo/*": "${workspaceRoot}/app/*" //ember-debug-demo is the project name i.e the name of the file generated in dist\assets\<Project Name>.js
}
}]
}