Using Next and Next Export is a great way to generate a static site. Unfortunately, it is not possible to generate non HTML static assets. Adding a custom permalink would allow non important non HTML files. Examples include:
Add a function or parameter to set the custom permalink for a page. We could also consider making the render function of the React component return a string for the body.
You can generate these files outside of the Next.js build ecosystem but that seems like a lot of extra complexity to the developer experience.
This idea was discussed in #9051
This is already possible with Static File Serving feature.
public/robots.txt file will be access in your site via https://example.com/robots.txt
I know that I can do that if I write the robots.txt by hand. I want the ability to generate static files at build time. I think the sitemap and RSS feed examples are more compelling to be honest.
While I think this would be incredibly valuable, here I have a solution that allows you to have a dynamically-generated sitemap that covers dynamic routes and static ones, as an interim solution of sorts:
It uses a lambda for the sitemap generation, routed via @now/node in vercel.json, with the static pages/routes built with a script before deploy.
Maybe it'll help you. It supports static routes, and allows for newly-dynamic pages to still be valid and added (like for products, in that example).
Most helpful comment
I know that I can do that if I write the robots.txt by hand. I want the ability to generate static files at build time. I think the sitemap and RSS feed examples are more compelling to be honest.