Capítulo 434 de 456

Configuration (Adapters)

Core Idea

How to register a deployment adapter with Next.js: point to it via adapterPath in config, or NEXT_ADAPTER_PATH for zero-config platform usage.

Key Concepts

  • adapterPath: config option pointing to the adapter module (typically via require.resolve).
  • NEXT_ADAPTER_PATH: env var alternative, enables zero-config usage by deployment platforms without touching next.config.js.

Code Examples

/** @type {import('next').NextConfig} */
const nextConfig = {
  adapterPath: require.resolve('./my-adapter.js'),
}

module.exports = nextConfig
  • O que demonstra: registra um adapter local via adapterPath.

Key Takeaways

  1. Duas formas de ativar um adapter: config explícita (adapterPath) ou env var (NEXT_ADAPTER_PATH) para setup zero-config em plataformas.

Connects To

  • Creating an Adapter (ch435): define a interface que o módulo apontado por adapterPath deve implementar.