Performance: Build optimization for production
HIGH IMPACT
This affects the page load speed by reducing bundle size and improving resource loading efficiency.
vite build --mode production
// or
vue-cli-service build --mode production --modernvite build --mode development
// or
vue-cli-service build --mode development| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Development build | Normal | Multiple due to larger scripts | High due to blocking scripts | [X] Bad |
| Production build with minification | Normal | Single or fewer reflows | Lower paint cost | [OK] Good |
| Import full library | Normal | Multiple reflows due to heavy scripts | High paint cost | [X] Bad |
| Import only used components | Normal | Fewer reflows | Lower paint cost | [OK] Good |
| Unoptimized images | Normal | Reflows triggered by late image load | High paint cost and CLS | [X] Bad |
| Optimized images with lazy loading | Normal | Minimal reflows | Low paint cost and stable layout | [OK] Good |