Next.js Codemods are the automated code-transformation scripts Vercel ships with the framework, run through the @next/codemod CLI, to rewrite a project's code when a Next.js release deprecates or renames an API. Vercel published the @next/codemod package in October 2020 alongside Next.js 10 and has added a new set of transforms with most major releases since, including Next.js 13, 14, 15, and 16. Each codemod targets one specific breaking change, such as converting next/image imports or updating middleware geo/ip usage, so a major upgrade typically requires running several in sequence, and coverage is limited to the changes Vercel has chosen to automate.
Frontend Modernization
Next.js Codemods are the automated code-transformation scripts Vercel ships with the framework, run through the @next/codemod CLI, to rewrite a project's code when a Next.js release deprecates or renames an API. Vercel published the @next/codemod package in October 2020 alongside Next.js 10 and has added a new set of transforms with most major releases since, including Next.js 13, 14, 15, and 16. Each codemod targets one specific breaking change, such as converting next/image imports or updating middleware geo/ip usage, so a major upgrade typically requires running several in sequence, and coverage is limited to the changes Vercel has chosen to automate.