N

Next/15/Refactor-Imports-from-@next/font-to-next/font

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Refactor Imports from @next/font to next/font

This codemod refactors import statements in your code to replace @next/font with next/font, aligning with the latest Next.js module structure.

  • Find Import Declarations: Identifies all ImportDeclaration nodes in the code.

  • Check Import Path: Ensures that the import path starts with @next/font.

  • Replace Import Path: Updates the import path to use next/font instead of @next/font.

Before

js

After

js

Ready to contribute?

Build your own codemod and share it with the community.