bundle-analyzer

Analyze JavaScript bundle sizes and propose code-splitting optimizations.

6|2|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/Dexploarer/claudius-skills --skill bundle-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bundle-analyzer
Source: https://github.com/Dexploarer/claudius-skills/tree/main/examples/intermediate/performance-skills/bundle-analyzer
Command: npx skills add https://github.com/Dexploarer/claudius-skills --skill bundle-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires webpack-bundle-analyzer, rollup-plugin-visualizer, source-map-explorer, @next/bundle-analyzer, size-limit, @size-limit/preset-app, compression-webpack-plugin, @fullhuman/postcss-purgecss.

What problem does it solve?

Large JavaScript bundles significantly slow down page load times, impacting user experience and SEO. This Skill automates the analysis of bundle sizes, pinpointing heavy dependencies and suggesting actionable optimizations.

Core Features & Use Cases

  • Multi-Bundler Support: Configures bundle analysis for Webpack, Vite, Rollup, and Next.js projects.
  • Detailed Size Breakdown: Provides treemap visualizations and reports to identify large dependencies, duplicate code, and unused modules.
  • Use Case: "Analyze my Webpack bundle size, identify the largest dependencies, and suggest strategies for code splitting and tree shaking."

Quick Start

Analyze the JavaScript bundle size for my Next.js project and provide optimization recommendations.

Frequently Asked Questions about bundle-analyzer

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

FAQPage Schema
How do I analyze JavaScript bundle size and find optimization opportunities?

Bundle analysis identifies large dependencies, duplicate packages, and code-splitting opportunities by generating visualizations and reports. Tools like webpack-bundle-analyzer, rollup-plugin-visualizer, and source-map-explorer break down bundle composition across Webpack, Vite, Rollup, Next.js, and Create React App projects to pinpoint what's consuming space.

Can I analyze bundle size in Next.js, Webpack, and Vite projects?

Yes. This Skill supports multi-bundler analysis across Next.js (@next/bundle-analyzer), Webpack (webpack-bundle-analyzer), Vite, Rollup (rollup-plugin-visualizer), and Create React App. It detects your build tool, installs appropriate analyzers, and generates size reports specific to your project setup.

What's the best way to reduce JavaScript bundle size and improve load times?

Bundle analysis reveals optimization strategies: code splitting isolates unused code, tree-shaking removes dead imports, and compression (via compression-webpack-plugin) reduces file size. Identifying large dependencies lets you replace heavy libraries or load them conditionally.

How do I detect duplicate packages and unused code in my bundle?

Bundle analysis tools generate treemap visualizations and detailed reports showing duplicate dependencies and unused modules. size-limit and @size-limit/preset-app track bundle growth over time, while source-map-explorer maps code to source files to expose dead code and redundant imports.

Does bundle analysis work with CSS optimization?

Yes. Beyond JavaScript analysis, CSS optimization is supported via @fullhuman/postcss-purgecss, which removes unused CSS rules. Combined with JavaScript bundle analysis, this provides comprehensive optimization coverage for both assets.

Why should I analyze bundle size before optimizing?

Analysis reveals what's actually slowing load times—large dependencies, duplicates, or unoptimized code splitting patterns. Without visibility, optimization efforts are guesswork. Reports pinpoint exact problems, making optimization targeted and measurable.