Hi all! I’m updating my plugin, Psychart (Psychrometric Chart for Grafana). With it I am adding some screenshots. Here is a snippet from my configuration in plugin.json:
{
"name": "General use case: Psychart as a thermodynamic calculator.",
"path": "img/screenshot_calc.png"
},
{
"name": "Random data, for illustrative purposes on customizing the appearance.",
"path": "img/screenshot_rand.png"
}
The problem? I notice that when I build the plugin using yarn build, I get these following warnings:
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
img/screenshot_calc.png (562 KiB)
img/screenshot_rand.png (556 KiB)
From unpackaging my plugin, I see that it is including all the icons and screenshots in the .zip file. Packaging the icons is good, but packaging the screenshots is not necessary for my plugin. Is there a way I can tell the compiler not to copy certain image files?
Hi @mikhailvolkov, thanks for your reply. I want to keep the screenshots in the plugin’s download page like below. (I assume this is what you mean by catalog?) I just don’t see a need to package them with the code as that would increase the download size. Plus, the screenshots are not referenced anywhere in the plugin.
Perhaps I can put an image URL in the "path" attribute in plugin.json?
This is probably the best alternate fix, but I do like how the screenshots are displayed currently in the catalog. Do you know if it would work if I put absolute URLs in plugin.json instead?
Unfortunately, I cannot add absolute screenshots in plugin.json. From the Validate Plugin step, this is the error(s) I get:
error: plugin.json: screenshot path should be relative to plugin.json: https://raw.githubusercontent.com/nicfv/Psychart/main/screenshots/display_options.png
detail: Don't use absolute paths inside plugin.json
Is there a way I could request this feature removed? Link to GitHub
For anyone reading this in the future: Plugins with absolute URLS within plugin.json are not accepted.
This is the direction I went moving forward. However, there is 1 catch - you are, in fact required to have at least 1 relative screenshot in plugin.json. Since the plugin’s logo is packaged anyway, I used that as my 1 screenshot and put “see README for screenshots” in the image description.