Debug Gridsome with VS Code
I was looking for a way to debug from Visual Studio Code the Gridsome server. I wanted to use break points in order to fully understand what was happening in some plugins.
It appears the needed configuration is quite easy. I have put it together by what I found here and there, and made it work. Note that for Windows system you might need to use \\
instead of /
in the program
path.
Here is the launch.json
file that I use for Gridsome:
You can also use the option watch: true
to enable restart when you need, but this can get annoying when working on the frontend with hot reloading enabled.
The runtimeVersion
allows you to select a specific version of node that is not your default. Typically if you are using many node version, this is very useful.
I hope this will save you some time!