Next.js Adapter
The Next.js Adapter in Kiln provides production-grade single-binary compilation for both App Router and Pages Router applications.
Supported Versions
Section titled “Supported Versions”- Next.js 16.x (with top-level
adapterPath) - Next.js 15.x (with
experimental.adapterPath) - Turbopack builds
- React 19 & Server Actions
Configuration
Section titled “Configuration”In your next.config.ts:
import type { NextConfig } from "next";
const nextConfig: NextConfig = { adapterPath: import.meta.resolve("kiln-compiler"),};
export default nextConfig;Build Commands
Section titled “Build Commands”Add the following scripts to your package.json:
"scripts": { "dev": "next dev", "build": "next build", "compile": "kiln -o ./bin/app", "build:compile": "next build && kiln -o ./bin/app"}Run:
bun run build:compile./bin/appMonorepo & pnpm Support
Section titled “Monorepo & pnpm Support”In monorepo workspaces (pnpm, Bun workspaces, npm workspaces), Next.js outputs standalone builds into nested subdirectories (e.g. .next/standalone/apps/web/).
Kiln automatically:
- Detects
relativeAppDirfromrequired-server-files.json. - Unnests the standalone output structure so the binary executes cleanly in any target folder.
- Resolves packages across standard
node_modules,.pnpm/, and.bun/virtual stores.
