Next.js static HTML export with Payload #9855
Closed
bratvanov
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
Thanks to a discussion in vercel/next.js#81242 – it turns out Next.js static HTML export with Payload is indeed possible. For this, you need to use custom Next.js page extensions, for example, appending next.config.mjs
package.json
Gerharddc has been kind to create an example repo here: https://github.com/Gerharddc/payload-ssg-example |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to use static exports with Payload in the same Next.js app?
Setting
output: 'export'
in the Next.js configuration breaks the Payload admin panel. I'm unsure if it's possible to conditionally define multiple output values in a single config file—for example,output: 'standalone'
for/src/app/(payload)
andoutput: 'export'
for/src/app/(frontend)
.This issue was discussed on Discord, where the suggested workaround was to use two separate Next.js apps: one for Payload and another for the front-end. However, this approach has significant drawbacks:
Beta Was this translation helpful? Give feedback.
All reactions