bundle-size

Optimize JavaScript bundle size via code splitting, tree shaking, and dependency auditing.

1|Updated Jul 15, 2026
One-click install
npx skills add https://github.com/Dzakiamriz22/frontend-pack --skill bundle-size-dzakiamriz22
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bundle-size
Source: https://github.com/Dzakiamriz22/frontend-pack/tree/main/skills/bundle-size
Command: npx skills add https://github.com/Dzakiamriz22/frontend-pack --skill bundle-size-dzakiamriz22

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @next/bundle-analyzer, date-fns, lodash-es, recharts.

What problem does it solve?

This skill addresses bloated JavaScript bundles that degrade web performance, slow down initial page loads, and negatively impact user experience and SEO.

Core Features & Use Cases

  • Bundle Analysis: Identify heavy dependencies and visualize bundle composition using tools like next/bundle-analyzer.
  • Code Splitting: Implement dynamic imports and route-based splitting to reduce the initial JavaScript payload.
  • Tree Shaking: Audit and refactor imports to ensure unused code is stripped during the build process.
  • Use Case: When a dashboard application becomes sluggish, use this skill to audit large libraries like moment.js or lodash and replace them with lighter alternatives to improve load times.

Quick Start

Activate the bundle-size skill to analyze the current project dependencies and suggest specific code splitting opportunities.

Frequently Asked Questions about bundle-size

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

FAQPage Schema
How do I reduce JavaScript bundle size in a Next.js application?

Reduce JavaScript bundle size by implementing code splitting, applying tree shaking, and auditing dependencies to eliminate redundant library imports. This lowers initial JS payloads and improves production web performance for Next.js and React applications.

What is the best way to analyze heavy dependencies causing bloated JS bundles?

The best way to analyze heavy dependencies is using next/bundle-analyzer to visualize bundle composition and identify large libraries. This allows you to target specific heavy imports for replacement or removal.

How does tree shaking work to eliminate unused code during the build process?

Tree shaking eliminates unused code by auditing and refactoring imports so that dead code is stripped during the build process. This ensures only necessary modules are included, reducing the overall bundle size.

Can I use dynamic imports for code splitting in a React dashboard application?

Yes, you can use dynamic imports for code splitting in a React dashboard application. Implementing dynamic imports and route-based splitting reduces the initial JavaScript payload, improving load times for sluggish applications.

Why should I replace lodash or date-fns when optimizing bundle performance?

You should replace or audit heavy libraries like lodash or date-fns when optimizing bundle performance to eliminate redundant imports. Using lighter alternatives reduces the initial JavaScript payload and improves load times.