Nâng CaoNext.js iconNext.js

Bundle analyzer trong Next.js được dùng như thế nào?

Dùng @next/bundle-analyzer để visualize bundle size.

  • Cấu hình trong next.config.js với withBundleAnalyzer wrapper.
  • Chạy ANALYZE=true npm run build để tạo report HTML.
  • Giúp identify: large dependencies, duplicate code, unnecessary imports.
  • Sau đó tối ưu: dynamic imports, tree-shaking, replace heavy libraries.

Xem toàn bộ Next.js cùng filter theo level & chủ đề con.

Mở danh sách Next.js