bundle-optimizer

Analyze JavaScript bundles and implement code splitting for the emotive-mascot platform.

18|1|Updated Sep 3, 2025
One-click install
npx skills add https://github.com/joshtol/emotive-engine --skill bundle-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bundle-optimizer
Source: https://github.com/joshtol/emotive-engine/tree/main/skills/bundle-optimizer
Command: npx skills add https://github.com/joshtol/emotive-engine --skill bundle-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @rollup/plugin-terser, webpack-bundle-analyzer, depcheck, bundle-phobia.

What problem does it solve?

This Skill helps you combat slow page load times and high bandwidth usage by analyzing and reducing the size of your JavaScript bundles, ensuring a faster and smoother user experience.

Core Features & Use Cases

  • Bundle Analysis: Use powerful tools to visualize your bundle's composition, identify large modules, and pinpoint duplicate dependencies.
  • Code Splitting & Tree Shaking: Implement dynamic imports and configure build tools (Rollup, Next.js) to eliminate dead code and load features on demand.
  • Progressive Loading: Design strategies to deliver a minimal initial bundle for fast first paint, then lazy-load additional features as needed.
  • Use Case: Your website's initial load time is too slow. Use this skill to analyze the bundle, identify large dependencies, and implement code splitting for the audio engine, reducing the initial payload and improving user experience.

Quick Start

Use the bundle-optimizer skill to analyze the current bundle size of the emotive-mascot project and identify the largest modules.

Frequently Asked Questions about bundle-optimizer

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

FAQPage Schema
How do I reduce JavaScript bundle size for faster page loads?

Reduce bundle size by analyzing your JavaScript with tools like webpack-bundle-analyzer to identify large modules, then apply code splitting with dynamic imports and tree-shaking to eliminate dead code. This cuts initial payload and speeds up first paint.

What's the difference between code splitting and tree-shaking?

Code splitting breaks your bundle into smaller chunks loaded on demand via dynamic imports, reducing initial load time. Tree-shaking removes unused code during the build process. Both are complementary techniques that minimize bundle size and improve performance.

Can I use Rollup and webpack together for bundle optimization?

Rollup and webpack serve different purposes—webpack is a module bundler, Rollup excels at library bundling and tree-shaking. You typically choose one as your primary bundler. This Skill covers configuration for both to achieve your gzipped size targets and performance goals.

How do I identify and remove unused dependencies from my bundle?

Use depcheck to scan your project and find unused dependencies, then remove them from package.json. Combine this with webpack-bundle-analyzer to visualize what's actually included in your bundle and confirm unused code is eliminated.

What's progressive loading and when should I implement it?

Progressive loading delivers a minimal initial bundle for fast first paint, then lazy-loads additional features as needed. Implement it when your website's initial load is slow due to large bundles, using dynamic imports to defer non-critical code.

Does bundle optimization work for large monorepos or just single projects?

This Skill applies to scenarios with large bundles and slow first paint regardless of project structure. It guides dynamic imports, dependency pruning, and build-configuration optimizations to meet gzipped size targets across your architecture.