Debug my custom data source plugin in Grafana

I desperately need a better way to debug my custom data source plugin .Currently (every time) as I change my plugin, I am required to perform a yarn dev, then copy the dist folder contents to /data/plugins/my-plugin folder (on the server). Then I need to debug my plugin code in the browser. And because yarn dev takes time, I have to needlessly wait. Surely a better mechanism is there but I don’t know. Pls help.

What about yarn watch?

That, and create a symbolic link to your plugin from /data/plugins/{my-plugin} to your plugin dir

That way you don’t have to copy / paste the dist folder

I’d also recommend developing using a Grafana instance on your local machine rather than copying the plugin to another server on every rebuild.

docker makes this SUPER easy!

Thanks to all…will give it a try.

I have done some changes and apparently Grafana does not seem to pick up a (soft) symbolic link that points to my plugin/dist folder. But having said that I can do a mount of my plugin/dist folder to /data/plugins/my-plugin folder, so that works fine.

So I did something like "sudo mount -o bind ~/my-plugin/dist ~/grafana/data/plugins/my-plugin

However I am surprised that yarn start enables the watch mode but it doesn’t pick up my .ts file changes everytime I change a typescript file. Wierd.