我有一个具有以下结构的VS Code工作区:
Root
--[core] (basic Dart package)
--[mobile] (Flutter)
--[web] (Angular Dart)
如何为每个软件包配置调试器?到目前为止,我只能进行移动工作:
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Mobile",
"program": "mobile/lib/main.dart",
"request": "launch",
"type": "dart"
},
]
}
要通过CLI运行angular dart应用程序:
cd [web directory]
pub global activate webdev
webdev serve
答案 0 :(得分:1)
您可以配置新任务并使用以下配置。只需运行任务,它就能解决问题。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"command": "$HOME/.pub-cache/bin/webdev",
"type": "shell",
"args": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"options": {
"cwd": "./web"
},
"tasks": [
{
"label": "serve",
"args": [],
"isBackground": true
}
]
}