GoldenJoe
GoldenJoe

Reputation: 8012

How do I set up VS Code debugging for a workspace using Angular and Flutter (both Dart)?

I have a VS Code workspace with the following structure:

Root
--[core] (basic Dart package)
--[mobile] (Flutter)
--[web] (Angular Dart)

How do I configure the debugger for each package? So far, I only have mobile working:

// launch.json
{
   "version": "0.2.0",
   "configurations": [
      {
         "name": "Mobile",
         "program": "mobile/lib/main.dart",
         "request": "launch",
         "type": "dart"
      },
   ]
}

To run the angular dart app through CLI:

cd [web directory]
pub global activate webdev 
webdev serve

Upvotes: 1

Views: 749

Answers (1)

Amr Elshamy
Amr Elshamy

Reputation: 26

You can configure a new task and use the following configuration. just run the task and it will do the trick.

{
  // 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
    }
  ]
}

Upvotes: 1

Related Questions