⚡
React Bundle Size Reducer
Identify and fix bundle bloat in React applications
prompt template
Analyze and reduce the bundle size of this React application: **Framework:** [FRAMEWORK — e.g., "Next.js 15"] **Current bundle:** [SIZE — e.g., "First Load JS: 450KB"] **Target:** [TARGET — e.g., "under 200KB"] **Heavy dependencies:** [DEPS — e.g., "moment.js, lodash, chart.js"] Generate optimizations: 1. **Dependency audit** — identify heavy packages with lighter alternatives - moment.js → dayjs or date-fns - lodash → native methods or lodash-es with tree-shaking - Heavy UI libraries → individual component imports 2. **Code splitting** — dynamic imports for route-level and component-level 3. **Tree shaking** — fix barrel exports that prevent tree shaking 4. **Image optimization** — next/image, WebP/AVIF, responsive sizing 5. **Font optimization** — subset fonts, use next/font 6. **Lazy loading** — defer non-critical below-fold components 7. **Analysis** — webpack-bundle-analyzer or @next/bundle-analyzer setup Include specific code changes and expected size reduction for each.
How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More Performance Prompts
Related performance templates from the vault
⚡
React Memo Optimization Audit
Use this prompt to react memo optimization audit with AI assistance
Beginnerperformancereact
⚡
Server Response Time Optimizer
Use this prompt to server response time optimizer with AI assistance
Intermediateperformanceserver
⚡
Next.js Performance Optimization
Optimize a Next.js application for Core Web Vitals and loading speed
Intermediateperformancenext.js
⚡
Core Web Vitals Performance Sprint
Run a focused performance sprint to bring all Core Web Vitals into the green zone with measurable before/after improvements
Intermediateperformancecore-web-vitals
You Might Also Like
Prompts from other categories that share similar tags
🎨
FrontendPRO
React Server Component Data Pattern
Implement efficient data fetching patterns with React Server Components
Shared:reactnext.jsperformance
🗄️
DatabasePRO
SQL Query Optimizer
Optimize slow SQL queries with explain analysis
Shared:optimizationperformance
🐛
Debugging
Performance Bottleneck Finder
Identify and fix performance issues in slow code
Shared:performanceoptimization
🎨
Frontend
Infinite Scroll with Virtualization
Use this prompt to infinite scroll with virtualization with AI assistance
Shared:reactperformance
Keep Exploring the Vault