Nuxt/docs/content/3.api/4.advanced/2.kit.md
2022-10-24 10:53:02 +02:00

2.5 KiB

title description
Kit Utilities Nuxt Kit provides composable utilities to help interacting with Nuxt Hooks and Nuxt Builder.

Kit Utilities

::ReadMore{link="/guide/going-further/kit"} ::

Utilities

Modules

source code

  • installModule(module, inlineOptions)

Programmatic Usage

source code

  • loadNuxt(loadOptions)
  • buildNuxt(nuxt)
  • loadNuxtConfig(loadOptions)

Compatibility

source code

  • checkNuxtCompatibility(constraints)
  • assertNuxtCompatibility(constraints)
  • hasNuxtCompatibility(constraints)
  • isNuxt2()
  • isNuxt3()
  • getNuxtVersion()

Auto-imports

source code

  • addImports(imports)
  • addImportsDir(autoImportDirs)
  • addImportsSources(autoImportSources)

Components

source code

  • addComponentsDir(dir)
  • addComponent(componentObject)

Context

source code

  • useNuxt()

Plugins

source code

  • addPlugin(pluginOptions, { append? })
  • addPluginTemplate(pluginOptions, { append? })

Templates

source code

  • addTemplate(templateOptions)
  • updateTemplates({ filter?: ResolvedNuxtTemplate => boolean })

Nitro

source code

  • addServerMiddleware(serverMiddleware)
  • addServerHandler (handler)
  • addDevServerHandler (handler)
  • useNitro() (only usable after ready hook)

Resolving

source code

  • resolvePath (path, resolveOptions?)
  • resolveAlias (path, aliases?)
  • findPath (paths, resolveOptions?)
  • createResolver (base)

Logging

source code

  • useLogger(scope?)

Builder

source code

  • extendWebpackConfig(callback, options?)
  • extendViteConfig(callback, options?)
  • addWebpackPlugin(webpackPlugin, options?)
  • addVitePlugin(vitePlugin, options?)