
Plugin Bundle Size
This walks you through systematically shrinking a Grafana app plugin's module.js from multi-megabyte bloat down to under 200 KB using React.lazy, Suspense, and webpack code splitting. The breakdown is unusually pragmatic: it gives you a risk matrix showing exactly what to split (routes, extensions) and what to leave alone (vendor libs, shared utils), plus a CI action that posts bundle diffs on every PR so you can see the impact immediately. The step-by-step goes from measurement to analysis to implementation in priority order, with real shell commands to measure production bundle size and grep for heavy imports. If your Grafana plugin is slow to load or you're staring at a 2 MB module.js, this is the playbook.
- skills.sh installs
- 4.5K
- GitHub stars
- 307
- last updated
- Aug 21, 2026
Install
$ npx -y skills add grafana/skills --skill plugin-bundle-size --agent claude-codeInstalls into .claude/skills of the current project.
Files
Grafana plugin bundle size optimisation
module.js is the render-blocking entry point for every Grafana app plugin. The smaller it is, the less impact the plugin has on Grafana's overall startup time. A well-split plugin should have a module.js under ~200 KB that contains nothing but lazy-loaded wrappers — all feature code loads on demand.
Target: ~15–25 JS chunks total. Fewer means too little splitting; far more (50+) means over-engineering.
Risk levels
Not all splitting opportunities carry the same risk. Apply them in this order:
Sponsors
Details
- Repository
- github.com/grafana/skills
- Categories
- Frontend Development, Backend & APIs, Debugging
- First seen
- Jun 3, 2026
More from grafana/skills
All 42- React 19 Plugin Migration4.5K
- Admin4.4K
- Ml Ai4.4K
- Private Connectivity4.4K
- Skill Authoring4.2K
- Prometheus Label Strategy4.2K
- Your Skill Name4.1K
- Prometheus Cardinality Troubleshooter4.1K
- K6 Perf Test Website3.7K
- Dashboarding9.5K
- Promql9.1K
- Loki8.5K
- Loki Label Analyzer7.2K
- Opentelemetry6.6K
- Grafana Oss6K
- Prometheus5.6K
- Alerting Irm5.5K
- Assistant Mcp5.4K
- Alloy5.4K
- K65.3K
- Tempo5.2K
- Beyla5.1K
- Mimir5K
- Pyroscope5K