nuxt.config.ts
Nuxt 可以通过一个 nuxt.config 文件轻松配置。
nuxt.config
文件扩展名可以是 .js
、.ts
或 .mjs
。
¥The nuxt.config
file extension can either be .js
, .ts
or .mjs
.
nuxt.config.ts
export default defineNuxtConfig({
// My Nuxt config
})
defineNuxtConfig
助手无需导入即可全局使用。如果你愿意,可以从 nuxt/config
显式导入 defineNuxtConfig
:
¥You can explicitly import defineNuxtConfig
from nuxt/config
if you prefer:
nuxt.config.ts
import { defineNuxtConfig } from 'nuxt/config'
export default defineNuxtConfig({
// My Nuxt config
})
:
探索 Nuxt 配置文档中所有可用选项。
¥Discover all the available options in the Nuxt configuration documentation.
::
为了确保你的配置是最新的,Nuxt 在检测到主配置文件(.env
、.nuxtignore
和 .nuxtrc
点文件)中的更改时将进行完全重启。
¥To ensure your configuration is up to date, Nuxt will make a full restart when detecting changes in the main configuration file, the .env
, .nuxtignore
and .nuxtrc
dotfiles.