Optimize JavaScript Bundle Size
AI prompt to analyze and reduce JavaScript bundle size. Get actionable recommendations for faster web performance and better UX.
Prompt Template
Variables to Customize
[FRAMEWORK] The JavaScript framework being used
Example: React 18 with TypeScript
[BUNDLE_TOOL] The bundling tool and version
Example: Webpack 5.75
[CURRENT_SIZE] Current bundle size
Example: 2.8MB (850KB gzipped)
[TARGET_SIZE] Desired bundle size goal
Example: Under 1.5MB (500KB gzipped)
[DEPENDENCIES] Major dependencies that might impact bundle size
Example: lodash, moment.js, material-ui, axios, recharts
Example Output
Pro Tips for Best Results
- Run bundle analyzer tools like webpack-bundle-analyzer before optimization to identify the biggest opportunities
- Focus on the largest dependencies first - replacing one heavy library often has more impact than multiple small optimizations
- Test bundle changes in staging with real user scenarios to ensure code splitting doesn't hurt user experience
- Set up automated bundle size monitoring in CI/CD to prevent regression
- Consider the trade-off between bundle size and number of HTTP requests when implementing code splitting
Tags
Want 500+ Expert Prompts?
Get the Premium Prompt Pack — organized, tested, and ready to use.
Get it for $29Related Prompts You Might Like
Implement JWT Authentication System
I need you to implement a complete JWT (JSON Web Token) authentication system for my [PROGRAMMING_LANGUAGE] application ...
Build Secure File Upload Handler
Create a secure file upload handler for a [PROGRAMMING_LANGUAGE] backend application using [FRAMEWORK]. The handler shou...
Implement Search Functionality
I need to implement search functionality for my [APPLICATION_TYPE] application. Here are the key requirements: **Techni...
Implement Data Serialization for APIs
You are an expert backend developer specializing in data serialization for APIs. I need you to implement a complete data...
Create Responsive CSS Layout
Create a responsive CSS layout for [LAYOUT_TYPE] with the following specifications: Layout Requirements: - Type: [LAYOU...
Implement Rate Limiting for APIs
You are an expert backend engineer specializing in API security and performance optimization. I need you to implement a ...