vercel-deploy-payload-postgres
vercel-deploy-payload-postgres copied to clipboard
Frontend is loading all admin chunks
I just applied the bundle analyzer to a production build of my site and noticed that all payload chunks are being loaded in the frontend of the Next.js website. Is this intended? This adds almost 3MB of data that should only be loaded in the admin panel though.
I just figured out that all those chunks are imported with the configPromise used in a server component:
import configPromise from '@payload-config'
import { getPayloadHMR } from '@payloadcms/next/utilities'
const payload = getPayloadHMR({ config: await configPromise })