Skip to content

plugin-bundle-size

Optimise Grafana app plugin bundle size using React.lazy, Suspense, and webpack code splitting. Use when the user asks to reduce plugin bundle size, optimise

— (0 ratings) 4.7K downloads grafana
$ npx skills add https://github.com/grafana/skills --skill plugin-bundle-size

Skills can run code on your computer. Review the source before installing. This listing is community-made and isn't affiliated with Anthropic.

About this skill

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:

Level What Risk Impact
Safe module.tsx lazy wrappers (Priority 1) Very low — no behaviour change Highest — module.js drops 90%+
Safe Route-level lazy() (Priority 2) Low — each route is self-contained High — one chunk per route
Safe Extension lazy() (Priority 3) Low — extensions are isolated Medium — independent chunk per extension
Moderate Component registries / tab panels (Priority 4) Medium — verify Suspense placement Medium — splits heavy pages further
Do not touch Vendor libraries (@grafana/scenes, @reduxjs/toolkit) N/A N/A — webpack splits these automatically
Do not touch Shared utility components (Markdown, Spinner) used across many files High churn, many callsites Low — already in shared vendor chunks

Installs: 4.7K | GitHub stars: 326 | First seen: Mar 31, 2026

Related skills

New

MCP & integrations

wind-mcp-skill

用户需要查询、筛选、获取、比较或验证金融市场数据时,优先调用本 Skill 获Ã

New • 265.9K
New

DevOps & cloud

discover-azure-skills

Searches the Azure skills catalog and recommends installable agent skills by matching an Azure task to skill metadata and plugin installation guidance. WHEN:

New • 258.5K
New

MCP & integrations

mcp-builder

Comprehensive guide for building high-quality MCP servers that connect LLMs to external services.

New • 149.7K