grafana / plugin-tools

Create Grafana plugins with ease.
https://grafana.com/developers/plugin-tools/
Apache License 2.0
58 stars 32 forks source link

Create Plugin: Add `buildMode` property to plugin.json asset #1281

Closed sunker closed 3 weeks ago

sunker commented 3 weeks ago

What this PR does / why we need it:

This PR adds a simple webpack plugin the inserts a buildMode prop to the plugin.json asset. Knowing if the plugin was build for dev or production might be useful in a different scenarios. For example, in the plugin extensions API we put error messages in the dev console in case Grafana is in dev mode. However, most Grafana contributors would consider these errors spam. It would be better if we could only log errors related to a certain plugin in case that specific plugin was built for development.

Should buildMode be added to the plugin.json schema? Note that this is only added to the asset build time.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions
:sparkles: Test out this PR locally via: ```bash npm install @grafana/create-plugin@5.8.0-canary.1281.9616e88.0 # or yarn add @grafana/create-plugin@5.8.0-canary.1281.9616e88.0 ```
github-actions[bot] commented 3 weeks ago

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new minor release. NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

grafana-plugins-platform-bot[bot] commented 3 weeks ago

:rocket: PR was released in @grafana/create-plugin@5.8.0 :rocket: