Put JavaScript bundles on a diet
Analyze, split, and replace dependencies so routes ship only the code they execute.
Track: 🎨 Frontend Engineering · Domain: Web Performance · Level: intermediate · ~35 min
Who this is for: Frontend Engineers, Full-Stack Developers, Design Engineers, UI Developers
When to Use This Skill
Analyze, split, and replace dependencies so routes ship only the code they execute. Use it whenever a matching task appears in conversation — the agent loads these instructions on demand.
Steps
- Generate a bundle report; list the ten largest modules per route
- Replace moment/lodash-class imports with native APIs or per-function imports
- Dynamic-import heavy widgets (editors, charts) behind interaction
- Move date/number formatting and markdown parsing server-side where possible
- Set an import lint rule banning known-bloated packages
- Track route-level JS budget over time; investigate any growth spike same week
Common Pitfalls
- Tree-shaking defeated by side-effectful barrel files
- Polyfills duplicated by transpilation misconfig
Commands
Install with skills CLI
npx skills add aniruddhaadak80/skills --skill web-performance-js-bundle-diet
Install globally
npx skills add aniruddhaadak80/skills --skill web-performance-js-bundle-diet -g
Part of aniruddhaadak80/skills · Browse all at https://skills.sh/aniruddhaadak80/skills