optimize-bundle-size

Reduce Kibana plugin page load bundle size and manage package limits.

21.2k|8.6k|Updated Jan 26, 2013
One-click install
npx skills add https://github.com/elastic/kibana --skill optimize-bundle-size
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize-bundle-size
Source: https://github.com/elastic/kibana/tree/main/.agents/skills/optimize-bundle-size
Command: npx skills add https://github.com/elastic/kibana --skill optimize-bundle-size

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps reduce plugin page load bundle size and prevents unnecessary increases in packages/kbn-optimizer/limits.yml, ensuring efficient loading times for Kibana plugins.

Core Features & Use Cases

  • Proactive Optimization: Optimize bundles before they become an issue.
  • CI Overages Investigation: Debug and resolve page-load performance problems flagged in CI.
  • PR Review: Assess changes that might impact bundle limits.
  • Use Case: A new feature in a Kibana plugin is causing its bundle size to increase significantly, leading to slower load times. This Skill can be used to identify the cause and refactor the code to keep the bundle size within acceptable limits.

Quick Start

Use the optimize-bundle-size skill to reduce the bundle size for the 'maps' plugin.

Frequently Asked Questions about optimize-bundle-size

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce Kibana plugin page load bundle size?

To reduce Kibana plugin page load bundle size, analyze build metrics and refactor code splitting and module imports. This identifies heavy dependencies and prevents unnecessary increases to package limits.

Why does my Kibana CI page-load bundle size overage fail my pull requests?

Kibana CI page-load overages occur when plugin changes exceed the bundle limits defined in packages. Pull requests fail when new features introduce heavy imports or unoptimized code that inflates the bundle beyond acceptable thresholds.

What is the best way to debug a Kibana plugin bundle size overage in CI?

The best way to debug a Kibana plugin bundle size overage is to use profiling and build metrics to analyze the plugin. This identifies the specific modules causing the bloat so you can optimize code splitting and resolve the CI page-load issue.

How can I optimize JavaScript bundle size before it impacts Kibana package limits?

You can optimize JavaScript bundle size proactively by analyzing module imports and utilizing build metrics to enforce code splitting. This prevents unnecessary increases to the package limits file and avoids CI page-load overages during development.

Does the optimize-bundle-size Skill work without external dependencies?

Yes, the optimize-bundle-size Skill works without external dependencies. It uses built-in scripts and references to analyze Kibana build metrics, manage package limits, and refactor module imports to reduce plugin bundle sizes effectively.