Next.js standalone output

Next.js has a standalone output mode that produces a minimal runtime with only the files your app actually needs. No giant node_modules, no source, just the compiled server and its dependencies. This is the build output you want to ship to production.

next.config.js
javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'standalone',
};

module.exports = nextConfig;

One line opts you into the standalone output.

Quiz: Quiz

Loading practice…