Group
  • Performance

    Audit my bundle for bloated and duplicate dependencies

    Visualizes the production bundle, finds oversized and duplicate packages, and replaces or tree-shakes the offenders.

    • Debug & fix
    • Improve quality
    • Intermediate
    • General

Free Prompt

Audit my JavaScript bundle for dependency bloat and shrink it. 1. Visualize: generate a bundle analysis (source-map-explorer, webpack-bundle-analyzer, or my build tool's equivalent) for the production build and list the largest contributors by parsed size. 2. Hunt the usual suspects: moment.js (replace with date-fns or Intl), full lodash imports (switch to per-method imports or native equivalents), entire icon libraries imported for a handful of icons, multiple versions of the same package bundled due to transitive dependencies, and heavy libraries loaded on pages that never use them. 3. Tree-shaking check: confirm my build is actually tree-shaking (ESM imports, sideEffects flags honored) and fix import styles that defeat it, like importing from a library's root when per-module imports shake better. 4. Remove the dead: find dependencies in package.json that nothing imports anymore and uninstall them. Check devDependencies did not leak into the client bundle. 5. Code-split: any large dependency used on only one route or behind a user action (charts, editors, PDF tools) moves to a dynamic import so it loads on demand, not in the initial bundle. 6. Verify: rebuild and report initial bundle size before and after, plus confirmation that the features using moved dependencies still work (lazy-loaded, with a loading state if the chunk takes time). Do not replace a library I actively use just to chase size if the replacement means rewriting working code; prioritize removals, dedupes, and code-splitting first. Do not break SSR if my app server-renders; dynamic imports need the right handling there. Give me: the top bundle contributors, each change made and its size impact, and the final before/after comparison.

What This Does / How This Helps

Opens up your production bundle, names the biggest packages in it, and removes, dedupes, or lazy-loads the ones wasting bandwidth. Bundle bloat in vibe-coded apps is mostly dependency decisions the AI made for you: moment.js because it was popular in the training data, all of lodash for one debounce call, an entire icon set for six icons, and a charting library in the initial bundle for a page most users never open. The prompt visualizes what is actually shipping, fixes the import patterns that defeat tree-shaking, splits route-specific heavies into on-demand chunks, and gives you the before/after numbers to prove it.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts