Nuxt Configuration
Discover all the options you can use in your nuxt.config.ts file.
_build
- Type:
boolean
- Default:
false
_cli
- Type:
boolean
- Default:
false
_generate
- Type:
boolean
- Default:
false
_installedModules
- Type:
array
_legacyGenerate
- Type:
boolean
- Default:
false
_majorVersion
- Type:
number
- Default:
3
_modules
- Type:
array
_nuxtConfigFile
_nuxtConfigFiles
- Type:
array
_prepare
- Type:
boolean
- Default:
false
_requiredModules
_start
- Type:
boolean
- Default:
false
alias
- Type:
object
- Default
{
"~": "/<rootDir>",
"@": "/<rootDir>",
"~~": "/<rootDir>",
"@@": "/<rootDir>",
"assets": "/<rootDir>/assets",
"public": "/<rootDir>/public"
}
analyzeDir
- Type:
string
- Default:
"/<rootDir>/.nuxt/analyze"
app
baseURL
- Type:
string
- Default:
"/"
buildAssetsDir
- Type:
string
- Default:
"/_nuxt/"
cdnURL
- Type:
string
- Default:
""
head
- Type:
object
- Default
{
"meta": [
{
"name": "viewport",
"content": "width=device-width, initial-scale=1"
},
{
"charset": "utf-8"
}
],
"link": [],
"style": [],
"script": [],
"noscript": []
}
keepalive
- Type:
boolean
- Default:
false
layoutTransition
- Type:
boolean
- Default:
false
pageTransition
- Type:
boolean
- Default:
false
rootId
- Type:
string
- Default:
"__nuxt"
rootTag
- Type:
string
- Default:
"div"
appConfig
nuxt
appDir
- Type:
string
- Default:
""
build
analyze
- Type:
object
- Default
{
"template": "treemap",
"projectRoot": "/<rootDir>",
"filename": "/<rootDir>/.nuxt/analyze/{name}.html"
}
templates
- Type:
array
transpile
- Type:
array
buildDir
- Type:
string
- Default:
"/<rootDir>/.nuxt"
builder
- Type:
string
- Default:
"@nuxt/vite-builder"
components
- Type:
object
- Default
{
"dirs": [
{
"path": "~/components/global",
"global": true
},
"~/components"
]
}
css
- Type:
array
debug
- Type:
boolean
- Default:
false
dev
- Type:
boolean
- Default:
false
devServer
host
https
- Type:
boolean
- Default:
false
loadingTemplate
- Type:
function
port
- Type:
number
- Default:
3000
url
- Type:
string
- Default:
"http://localhost:3000"
devServerHandlers
- Type:
array
devtools
dir
assets
- Type:
string
- Default:
"assets"
layouts
- Type:
string
- Default:
"layouts"
middleware
- Type:
string
- Default:
"middleware"
modules
- Type:
string
- Default:
"modules"
pages
- Type:
string
- Default:
"pages"
plugins
- Type:
string
- Default:
"plugins"
public
- Type:
string
- Default:
"public"
static
- Type:
string
- Default:
"public"
experimental
appManifest
- Type:
boolean
- Default:
true
asyncContext
- Type:
boolean
- Default:
false
asyncEntry
- Type:
boolean
- Default:
false
clientFallback
- Type:
boolean
- Default:
false
componentIslands
- Type:
boolean
- Default:
false
configSchema
- Type:
boolean
- Default:
true
crossOriginPrefetch
- Type:
boolean
- Default:
false
defaults
nuxtLink
componentName
- Type:
string
- Default:
"NuxtLink"
useAsyncData
deep
- Type:
boolean
- Default:
true
useFetch
emitRouteChunkError
- Type:
string
- Default:
"automatic"
externalVue
- Type:
boolean
- Default:
true
headNext
- Type:
boolean
- Default:
false
inlineRouteRules
- Type:
boolean
- Default:
false
localLayerAliases
- Type:
boolean
- Default:
true
noVueServer
- Type:
boolean
- Default:
false
payloadExtraction
- Type:
boolean
- Default:
true
polyfillVueUseHead
- Type:
boolean
- Default:
false
renderJsonPayloads
- Type:
boolean
- Default:
true
respectNoSSRHeader
- Type:
boolean
- Default:
false
restoreState
- Type:
boolean
- Default:
false
templateRouteInjection
- Type:
boolean
- Default:
true
treeshakeClientOnly
- Type:
boolean
- Default:
true
typedPages
- Type:
boolean
- Default:
false
viewTransition
- Type:
boolean
- Default:
false
watcher
- Type:
string
- Default:
"chokidar-granular"
writeEarlyHints
- Type:
boolean
- Default:
false
extends
- Default:
null
extensions
- Type:
array
- Default
[
".js",
".jsx",
".mjs",
".ts",
".tsx",
".vue"
]
features
inlineStyles
- Type:
boolean
- Default:
true
noScripts
- Type:
boolean
- Default:
false
future
typescriptBundlerResolution
- Type:
boolean
- Default:
false
generate
exclude
- Type:
array
routes
- Type:
array
hooks
- Default:
null
ignore
- Type:
array
- Default
[
"**/*.stories.{js,cts,mts,ts,jsx,tsx}",
"**/*.{spec,test}.{js,cts,mts,ts,jsx,tsx}",
"**/*.d.{cts,mts,ts}",
"**/.{pnpm-store,vercel,netlify,output,git,cache,data}",
".nuxt/analyze",
".nuxt",
"**/-*.*"
]
ignoreOptions
ignorePrefix
- Type:
string
- Default:
"-"
imports
dirs
- Type:
array
global
- Type:
boolean
- Default:
false
logLevel
- Type:
string
- Default:
"info"
modules
- Type:
array
modulesDir
- Type:
array
- Default
[
"/<rootDir>/node_modules",
"/Users/daniel/code/nuxt/nuxt/packages/schema/node_modules"
]
nitro
routeRules
- Type:
object
optimization
asyncTransforms
asyncFunctions
- Type:
array
- Default
[
"defineNuxtPlugin",
"defineNuxtRouteMiddleware"
]
objectDefinitions
defineNuxtComponent
- Type:
array
- Default
[
"asyncData",
"setup"
]
defineNuxtPlugin
- Type:
array
- Default
[
"setup"
]
definePageMeta
- Type:
array
- Default
[
"middleware",
"validate"
]
keyedComposables
- Type:
array
- Default
[
{
"name": "callOnce",
"argumentLength": 2
},
{
"name": "defineNuxtComponent",
"argumentLength": 2
},
{
"name": "useState",
"argumentLength": 2
},
{
"name": "useFetch",
"argumentLength": 3
},
{
"name": "useAsyncData",
"argumentLength": 3
},
{
"name": "useLazyAsyncData",
"argumentLength": 3
},
{
"name": "useLazyFetch",
"argumentLength": 3
}
]
treeShake
composables
client
- Type:
object
- Default
{
"vue": [
"onServerPrefetch",
"onRenderTracked",
"onRenderTriggered"
],
"#app": [
"definePayloadReducer",
"definePageMeta"
]
}
server
- Type:
object
- Default
{
"vue": [
"onBeforeMount",
"onMounted",
"onBeforeUpdate",
"onRenderTracked",
"onRenderTriggered",
"onActivated",
"onDeactivated",
"onBeforeUnmount"
],
"#app": [
"definePayloadReviver",
"definePageMeta"
]
}
pages
- Type:
boolean
plugins
- Type:
array
postcss
plugins
autoprefixer
cssnano
- Type:
object
rootDir
- Type:
string
- Default:
"/<rootDir>"
routeRules
router
options
hashMode
- Type:
boolean
- Default:
false
scrollBehaviorType
- Type:
string
- Default:
"auto"
runtimeConfig
- Type:
object
- Default
{
"public": {},
"app": {
"baseURL": "/",
"buildAssetsDir": "/_nuxt/",
"cdnURL": ""
}
}
serverDir
- Type:
string
- Default:
"/<rootDir>/server"
serverHandlers
- Type:
array
sourcemap
- Type:
object
- Default
{
"server": true,
"client": false
}
spaLoadingTemplate
- Default:
null
srcDir
- Type:
string
- Default:
"/<rootDir>"
ssr
- Type:
boolean
- Default:
true
telemetry
test
- Type:
boolean
- Default:
false
theme
- Type:
string
- Default:
null
typescript
builder
- Default:
null
includeWorkspace
- Type:
boolean
- Default:
false
shim
- Type:
boolean
- Default:
true
strict
- Type:
boolean
- Default:
true
tsConfig
- Type:
object
- Default
{
"compilerOptions": {}
}
typeCheck
- Type:
boolean
- Default:
false
vite
build
assetsDir
- Type:
string
- Default:
"_nuxt/"
emptyOutDir
- Type:
boolean
- Default:
false
clearScreen
- Type:
boolean
- Default:
true
define
- Type:
object
- Default
{
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": false,
"process.dev": false,
"import.meta.dev": false,
"process.test": false,
"import.meta.test": false
}
esbuild
jsxFactory
- Type:
string
- Default:
"h"
jsxFragment
- Type:
string
- Default:
"Fragment"
tsconfigRaw
- Type:
string
- Default:
"{}"
mode
- Type:
string
- Default:
"production"
optimizeDeps
exclude
- Type:
array
- Default
[
"vue-demi"
]
publicDir
- Type:
string
- Default:
"/<rootDir>/public"
resolve
extensions
- Type:
array
- Default
[
".mjs",
".js",
".ts",
".jsx",
".tsx",
".json",
".vue"
]
root
- Type:
string
- Default:
"/<rootDir>"
server
fs
allow
- Type:
array
- Default
[
"/<rootDir>/.nuxt",
"/<rootDir>",
"/<rootDir>",
"/<rootDir>",
"/<rootDir>/node_modules",
"/Users/daniel/code/nuxt/nuxt/packages/schema/node_modules"
]
vue
isProduction
- Type:
boolean
- Default:
true
script
defineModel
- Type:
boolean
- Default:
false
propsDestructure
- Type:
boolean
- Default:
false
template
compilerOptions
- Type:
object
vueJsx
- Type:
object
vue
compilerOptions
defineModel
- Type:
boolean
- Default:
false
propsDestructure
- Type:
boolean
- Default:
false
runtimeCompiler
- Type:
boolean
- Default:
false
watch
- Type:
array
watchers
chokidar
ignoreInitial
- Type:
boolean
- Default:
true
rewatchOnRawEvents
webpack
aggregateTimeout
- Type:
number
- Default:
1000
webpack
aggressiveCodeRemoval
- Type:
boolean
- Default:
false
analyze
- Type:
object
- Default
{
"template": "treemap",
"projectRoot": "/<rootDir>",
"filename": "/<rootDir>/.nuxt/analyze/{name}.html"
}
cssSourceMap
- Type:
boolean
- Default:
false
devMiddleware
stats
- Type:
string
- Default:
"none"
experiments
extractCSS
- Type:
boolean
- Default:
true
filenames
app
- Type:
function
chunk
- Type:
function
css
- Type:
function
font
- Type:
function
img
- Type:
function
video
- Type:
function
friendlyErrors
- Type:
boolean
- Default:
true
hotMiddleware
loaders
css
esModule
- Type:
boolean
- Default:
false
importLoaders
- Type:
number
- Default:
0
url
filter
- Type:
function
cssModules
esModule
- Type:
boolean
- Default:
false
importLoaders
- Type:
number
- Default:
0
modules
localIdentName
- Type:
string
- Default:
"[local]_[hash:base64:5]"
url
filter
- Type:
function
esbuild
file
esModule
- Type:
boolean
- Default:
false
fontUrl
esModule
- Type:
boolean
- Default:
false
limit
- Type:
number
- Default:
1000
imgUrl
esModule
- Type:
boolean
- Default:
false
limit
- Type:
number
- Default:
1000
less
- Default
{
"sourceMap": false
}
pugPlain
sass
sassOptions
indentedSyntax
- Type:
boolean
- Default:
true
scss
- Default
{
"sourceMap": false
}
stylus
- Default
{
"sourceMap": false
}
vue
compilerOptions
- Type:
object
defineModel
- Type:
boolean
- Default:
false
propsDestructure
- Type:
boolean
- Default:
false
transformAssetUrls
embed
- Type:
string
- Default:
"src"
object
- Type:
string
- Default:
"src"
source
- Type:
string
- Default:
"src"
video
- Type:
string
- Default:
"src"
vueStyle
- Default
{
"sourceMap": false
}
optimization
minimize
- Type:
boolean
- Default:
true
minimizer
runtimeChunk
- Type:
string
- Default:
"single"
splitChunks
automaticNameDelimiter
- Type:
string
- Default:
"/"
cacheGroups
chunks
- Type:
string
- Default:
"all"
optimizeCSS
- Type:
boolean
- Default:
false
plugins
- Type:
array
postcss
postcssOptions
config
plugins
- Type:
object
- Default
{
"autoprefixer": {},
"cssnano": {}
}
profile
- Type:
boolean
- Default:
false
serverURLPolyfill
- Type:
string
- Default:
"url"
warningIgnoreFilters
- Type:
array
workspaceDir
- Type:
string
- Default:
"/<rootDir>"