Registry
N

nuxt-2-convert-nuxt.js-config-to-`defineNuxtConfig`

No description available

nishant22530 executions

  • Legacy
  • nuxt
Connect a repo
npx codemod nuxt-2-convert-nuxt.js-config-to-`defineNuxtConfig`

Convert Nuxt.js Config to defineNuxtConfig

This codemod helps you migrate your Nuxt.js configuration files to use the new defineNuxtConfig format. This is useful when updating to a newer version of Nuxt.js that supports this method for defining configuration.

The codemod transforms the existing export default Nuxt.js configuration objects into the defineNuxtConfig function call. This standardizes the configuration format and ensures compatibility with the latest Nuxt.js features.

Example Transformations

Below are some examples demonstrating how the codemod transforms the configuration:

Example 1

Before:

ts
export default {
  // ...
};

After

ts
export default defineNuxtConfig({
  // ...
});

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.