Back to ⚡ Performance & Optimization

Reduce Bundle Size

PerformanceBundleOptimization
---
description: Analyze and reduce JS bundle
---

1. **Analyze Bundle**:
// turbo
- Run npm install @next/bundle-analyzer
// turbo
- Run ANALYZE=true npm run build

2. **Replace Heavy Libraries**:
- moment.js → date-fns
- lodash → Native JS

3. **Use Dynamic Imports**:
const Chart = dynamic(() => import('@/components/Chart'), {
ssr: false
});


4. **Pro Tips**:
- Aim for <200KB initial bundle.
- Use npm dedupe.
By Antigravity Team

How to Use This Workflow

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/workflows/
  3. Save the file as reduce-javascript-bundle-size-optimization.md
  4. In Antigravity, type /reduce_javascript_bundle_size_optimization or just describe what you want to do

Learn more about workflows →

Related Workflows

Recommended Rules

View more rules →

Recommended MCP Servers

View more MCP servers →

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide