Next.js export the 404 page statically in standalone

I work on a Next.js application with a page using SSR. I also have created a 404 page wich I'd like to export statically to give it to my exploitation service asking for a standalone page to point the Nginx config to in case of status 400 or 500 to avoid to cover all case in case of my docker container is down.

I don't want to have a second page in my project on git, I'd really like to be able to copy the page generated by Next.js (next build or next build && next export). This page contain external css file and load custom fonts too.

How can I do to keep my 404.tsx page in my project with fonts and styles in their actual directories and export a single html file (with fonts and image associated) with a specific bulid ?

Thank you,


Read more here:

Content Attribution

This content was originally published by Antoine at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: