bundle-analysis

Audits production bundles for server leaks, duplicated route manifests, and oversized chunks.

Updated Nov 7, 2025
One-click install
npx skills add https://github.com/rangojs/rango --skill bundle-analysis-rangojs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bundle-analysis
Source: https://github.com/rangojs/rango/tree/main/.claude/skills/bundle-analysis
Command: npx skills add https://github.com/rangojs/rango --skill bundle-analysis-rangojs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Production bundles can silently ship server code to the client, duplicate generated route data across eager and lazy chunks, or include both development and production React builds when NODE_ENV is not folded. These regressions are invisible to tree-shaking and unit tests, so they need a dedicated audit before releases or after changes to the Vite plugin or public exports. ## Core Features & Use Cases - Server-leak detection: Builds all wired Cloudflare and e2e apps with the analyzer enabled and flags any server-only modules that reach the client bundle with non-zero gzip size. - Route-manifest sanity check: Verifies that the virtual routes-manifest module stays under 1 KB in the eager chunk, with trie data living only in the lazy per-router chunk. - Cross-environment duplication and React variant audit: Detects dev React builds in SSR output and large files triple-bundled across client, SSR, and RSC environments. - Use Case: Before publishing an experimental release of the router, run the audit to confirm no server code leaked, the stress-demo manifest stayed small, and chunk sizes match the 50-60 KB gzip baseline. ## Quick Start Run the bundle analysis audit across all wired apps and report any server leaks, manifest duplication, or chunk size regressions.

Frequently Asked Questions about bundle-analysis

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

FAQPage Schema
How do I check if server code is leaking into my client bundle?

Build the app with the analyzer enabled and run the bundle report script, which lists server-only modules found in the client bundle with their gzip sizes. Non-zero gzip entries are real leaks; zero-byte entries are tree-shaken stubs that are safe.

How to detect bundle size regressions before publishing a release?

Build all wired apps with the analyzer flag, then run the report script and compare per-app totals against the documented baseline. A jump over 10 KB gzip in the router chunk or a routes-manifest over 1 KB signals a regression.

Why does my SSR bundle include both development and production React?

This happens when process.env.NODE_ENV is not folded at build time, so React's CJS files ship both variants. The fix is adding an explicit define for NODE_ENV in the Vite config for SSR and RSC builds.

What causes generated route data to be duplicated across chunks?

Duplication occurs when the eager manifest module inlines the route trie and precomputed entries instead of leaving them in the lazy per-router chunk. Tree-shaking cannot catch this, so the audit checks the eager manifest stays under 1 KB.

When should I run a bundle audit instead of relying on unit tests?

Run the audit when changing Vite plugin virtual-module codegen, public package exports, or adding new apps, since unit tests only cover one guarded app. The audit covers all wired apps across client, SSR, and RSC environments.