Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug Dart Builders with breakpoints in WebStorm

Tags:

dart

dart-pub

Dart uses the build package to generate code. What if you want to debug your own Builder or an existing one?

like image 974
HerrJohr Avatar asked Jan 03 '23 21:01

HerrJohr


1 Answers

Instead of calling pub run build_runner you can execute and debug the file build.dart which can be found here:

.dart_tool/build/entrypoint/

enter image description here

To enter your command like serve as in pub run build_runner serve you can edit your debug configurations:

enter image description here

Put the command inside the field Program arguments:

enter image description here

Click Apply and start debugging again. Webstorm will interrupt when a breakpoint is reached.

like image 187
HerrJohr Avatar answered Jan 30 '23 06:01

HerrJohr