Next.js · Junior · Question 41 of 75
How do you build a Next.js app into a set of static files without a Node.js server?
- ✓Correct answer: Set
output: 'export'innext.config - 2Run
next start --static - 3Delete the
appfolder and keep onlypublic
Explanation
A static export puts HTML, CSS and JS into the out folder, which you can host on any static hosting. Limitations: features that need a server don't work - cookies(), dynamic Route Handlers, ISR, default image optimization, Server Functions.