Nuxt 2 reached End-of-Life on June 30th, 2024.


Examples of Nuxt Kit utilities in use.

Accessing Nuxt Vite Config

If you are building an integration that needs access to the runtime Vite or webpack config that Nuxt uses, it is possible to extract this using Kit utilities.

Some examples of projects doing this already:

Here is a brief example of how you might access the Vite config from a project; you could implement a similar approach to get the webpack configuration.

import { loadNuxt, buildNuxt } from '@nuxt/kit'

async function getViteConfig() {
  const nuxt = await loadNuxt({ cwd: process.cwd(), dev: false, overrides: { ssr: false } })
  return new Promise((resolve, reject) => {
    nuxt.hook('vite:extendConfig', (config, { isClient }) => {
      if (isClient) {
        throw new Error('_stop_')
    buildNuxt(nuxt).catch((err) => {
      if (!err.toString().includes('_stop_')) {
  }).finally(() => nuxt.close())

const viteConfig = await getViteConfig()