https://nextjs.org/docs/app/guides/package-bundling
インストール
npm i @next/bundle-analyzer
next.config.js
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = withBundleAnalyzer(nextConfig)
機動
ANALYZE=true npm run build