output file tracing
The build step where Next.js follows every import from your server code to find exactly which files are needed at runtime.
In more detail
It powers the standalone output: only traced files from node_modules are copied. Files loaded dynamically by path may be missed and need adding with outputFileTracingIncludes.
Related terms
- standalone output — A next.config setting that makes next build produce a self-contained folder with a minimal server.js and only the node_modules files it needs.
- module graph — The map of which files and packages import which, starting from your entry files.
Taught in
- Containerized Deployment: Multi-Stage Docker Builds — Next.js 15 & Modern App Router Architecture