Hint
webpack-bundle-analyzer, Vite's rollup-plugin-visualizer, source-map-explorer — find what is large and why
Tools:
webpack-bundle-analyzer — generates an interactive treemap of all modules and their sizes. Run with ANALYZE=true next build.rollup-plugin-visualizer / vite-bundle-visualizer — equivalent for Vite/Rollup.source-map-explorer — analyzes the production source map to show the real size contribution of each module.Common culprits found during analysis:
date-fns or configure IgnorePlugin to exclude locales.import _ from 'lodash' bundles everything. Fix: import debounce from 'lodash/debounce' or use lodash-es.import { X } from '@ui' may pull in the entire library. Fix: deep imports or sideEffects: false.