optimize-bundle-size
Reduce and optimize bundle sizes through analysis, configuration, and code splitting strategies
Imported description, not reviewed yet
This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.
Download
Install
After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.
For this project
It goes in: .claude/commands/
mkdir -p .claude/commands && unzip ~/Downloads/optimize-bundle-size.zip -d .claude/commandsFor your account on the whole machine
It goes in: ~/.claude/commands/
mkdir -p ~/.claude/commands && unzip ~/Downloads/optimize-bundle-size.zip -d ~/.claude/commands
Instructions
Optimize Bundle Size
Reduce and optimize bundle sizes: $ARGUMENTS
Instructions
-
Bundle Analysis and Assessment
- Analyze current bundle size and composition using webpack-bundle-analyzer or similar tools
- Identify large dependencies and unused code across all bundles
- Assess current build configuration and optimization settings
- Create baseline measurements for optimization tracking
- Document current performance metrics and loading times
-
Build Tool Configuration
- Configure build tool optimization settings for production builds
- Enable code splitting and chunk optimization features
- Configure tree shaking and dead code elimination
- Set up bundle analyzers and visualization tools
- Optimize build performance and output sizes
-
Code Splitting and Lazy Loading
- Implement route-based code splitting for single-page applications
- Set up dynamic imports for components and modules
- Configure lazy loading for non-critical resources
- Optimize chunk sizes and loading strategies
- Implement progressive loading patterns
-
Tree Shaking and Dead Code Elimination
- Configure build tools for optimal tree shaking
- Mark packages as side-effect free where appropriate
- Optimize import statements for better tree shaking
- Use ES6 modules and avoid CommonJS where possible
- Implement babel plugins for automatic import optimization
-
Dependency Optimization
- Analyze and audit package dependencies for size impact
- Replace large libraries with smaller alternatives
- Use specific imports instead of importing entire libraries
- Implement dependency deduplication strategies
- Configure external dependencies and CDN usage
-
Asset Optimization
- Optimize images through compression and format conversion
- Implement responsive image loading strategies
- Configure asset minification and compression
- Set up efficient file loaders and processors
- Optimize font loading and subsetting
-
Module Federation and Micro-frontends
- Implement module federation for large applications
- Configure shared dependencies and runtime optimization
- Set up micro-frontend architecture for code sharing
- Optimize remote module loading and caching
- Implement federation performance monitoring
-
Performance Monitoring and Measurement
- Set up bundle size monitoring and tracking
- Configure automated bundle analysis in CI/CD
- Monitor bundle size changes over time
- Set up performance budgets and alerts
- Track loading performance metrics
-
Progressive Loading Strategies
- Implement resource hints (preload, prefetch, dns-prefetch)
- Configure service workers for caching strategies
- Set up intersection observer for lazy loading
- Optimize critical resource loading priorities
- Implement adaptive loading based on connection speed
-
Validation and Continuous Monitoring
- Set up automated bundle size validation in CI/CD
- Configure bundle size thresholds and alerts
- Implement bundle size regression testing
- Monitor real-world loading performance
- Set up automated optimization recommendations
Focus on optimizations that provide the most significant bundle size reductions while maintaining application functionality. Always measure the impact of changes on both bundle size and runtime performance.
Files
- LICENSE1 KB
- optimize-bundle-size.md3.6 KB
What the automatic scan found
We scanned the files automatically when they were imported. This is what the scan pointed at. It does not mean the item is harmful, and it does not mean it is safe: read it yourself.
- Needs a lookAllowed tools with no limits
In file cli-tool/components/commands/performance/optimize-bundle-size.md
Comments (0)
No comments yet. Be the first.
Sign in to comment. Commenting comes at level 1 (Member).