Q26: What are Static Exports (output: 'export') and what features are disabled?

Configuring output: 'export' in next.config.js builds a pure static HTML/CSS/JS site that can be hosted on any static storage bucket (like AWS S3 or Nginx). However, Node.js server features like Server Actions, Middleware, Dynamic SSR routes, and Image Optimization are disabled.

Configuring Static Export
// next.config.js
module.exports = {
  output: 'export', // Generates 'out' folder containing static HTML/CSS/JS
  images: { unoptimized: true }, // Disables Node.js image processing
};

output: export produces static assets suitable for CDN or AWS S3 hosting.

Key Takeaways
  • Outputs static HTML assets for un-hosted web server deployments.

  • Disables Node.js runtime features (Server Actions, Middleware, SSR).

Knowledge Check

Which core Next.js feature CANNOT be used when next.config.js is set to output: 'export'?