I am new to vscode and grunt / gulp frameworks and I was wondering, if there is a possible way for your task to do some task ( let say transpile some files, minify some images etc. ) and then access vscode and run the chrome debugger ?
Any advice how I could accomplish that.
It depends on exactly what you mean. It is easy to accomplish the following workflow.
Start the chrome debugger extension via a "launch" command in .vscode/launch.json that connects to that same url started in step 1. Something like
Your js will stop at your breakpoints and be debuggable now.
If you need help with the necessary gulp task let me know. But here is an example gulp.js code (I am using gulp4.0 here, it will not work in 3.x!!):
As I have written it, you start the task "sync" by ctr-shift-p : run task and chose sync
Then - assuming you have the chrome debugger extension installed - launch that via the debug icon : chose "Chrome : Launch with sourcemaps" from the dropdown menu : and run it (with the little green arrow to the left of the dropdown menu).
Good luck.
[EDIT starts here].
Since I wrote this answer 2016, vscode has added the ability to launch multiple tasks at once with the compounds key.
will now run the gulp "sync" task first and then launch Chrome in debug mode.
When I use this I have
in the browserSync options so it doesn't open an additional default browser window (besides chrome which is about to be launched).