Files
gil-wiki/reference/4.api/5.kit/2.programmatic.md
gil 5f664546cf feat: 위키 저장소 초기 커밋
- CLAUDE.md 운영 규칙
- wiki/ 정리된 지식 페이지 (Nuxt + Claude Code)
- raw/ 원본 자료
- reference/ Nuxt 4.x 공식 문서

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 00:31:51 +09:00

2.8 KiB

title, description, links
title description links
Programmatic Usage Nuxt Kit provides a set of utilities to help you work with Nuxt programmatically. These functions allow you to load Nuxt, build Nuxt, and load Nuxt configuration.
label icon to size
Source i-simple-icons-github https://github.com/nuxt/nuxt/tree/main/packages/kit/src/loader xs

Programmatic usage can be helpful when you want to use Nuxt programmatically, for example, when building a CLI tool or test utils.

loadNuxt

Load Nuxt programmatically. It will load the Nuxt configuration, instantiate and return the promise with Nuxt instance.

Type

function loadNuxt (loadOptions?: LoadNuxtOptions): Promise<Nuxt>

Parameters

loadOptions: Loading conditions for Nuxt. loadNuxt uses c12 under the hood, so it accepts the same options as c12.loadConfig with some additional options:

Property Type Required Description
dev boolean false If set to true, Nuxt will be loaded in development mode.
ready boolean true If set to true, Nuxt will be ready to use after the loadNuxt call. If set to false, you will need to call nuxt.ready() to make sure Nuxt is ready to use.

buildNuxt

Build Nuxt programmatically. It will invoke the builder (currently @nuxt/vite-builder or @nuxt/webpack-builder) to bundle the application.

Type

function buildNuxt (nuxt: Nuxt): Promise<any>

Parameters

nuxt: Nuxt instance to build. It can be retrieved from the context via useNuxt() call.

loadNuxtConfig

Load Nuxt configuration. It will return the promise with the configuration object.

Type

function loadNuxtConfig (options: LoadNuxtConfigOptions): Promise<NuxtOptions>

Parameters

options: Options to pass in c12 loadConfig call.

writeTypes

Generates tsconfig.json and writes it to the project buildDir.

Type

function writeTypes (nuxt?: Nuxt): void

Parameters

nuxt: Nuxt instance to build. It can be retrieved from the context via useNuxt() call.