Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Frontend is loading all admin chunks #5

Open
digitaledge-git opened this issue Aug 1, 2024 · 1 comment
Open

Frontend is loading all admin chunks #5

digitaledge-git opened this issue Aug 1, 2024 · 1 comment

Comments

@digitaledge-git
Copy link

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.

bundle_analyze

@digitaledge-git
Copy link
Author

digitaledge-git commented Aug 2, 2024

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 })

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant