diff --git a/packages/next/cli/next-dev.ts b/packages/next/cli/next-dev.ts index 22e63a521d15..1f0fc1ab875d 100755 --- a/packages/next/cli/next-dev.ts +++ b/packages/next/cli/next-dev.ts @@ -183,6 +183,12 @@ const nextDev: cliCommand = async (argv) => { await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, undefined, true) ) as NextConfig + if (typeof rawNextConfig === 'function') { + rawNextConfig = (rawNextConfig as any)(PHASE_DEVELOPMENT_SERVER, { + defaultConfig, + }) + } + const checkUnsupportedCustomConfig = ( configKey = '', parentUserConfig: any,