UNPKG

@nuxt/schema

Version:

Nuxt types and default configuration

1,277 lines 161 kB
{ "id": "#", "properties": { "components": { "title": "Configure Nuxt component auto-registration.", "description": "Any components in the directories configured here can be used throughout your pages, layouts (and other components) without needing to explicitly import them.", "tags": [ "@see [`components/` directory documentation](https://nuxt.com/docs/guide/directory-structure/components)" ], "tsType": "boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']", "markdownType": "boolean | SrcTypesComponentsComponentsOptions | SrcTypesComponentsComponentsOptions['dirs']", "id": "#components", "default": { "dirs": [ { "path": "~/components/global", "global": true }, "~/components" ] }, "type": "object" }, "imports": { "title": "Configure how Nuxt auto-imports composables into your application.", "description": "", "tags": [ "@see [Nuxt documentation](https://nuxt.com/docs/guide/directory-structure/composables)" ], "tsType": "typeof import('../src/types/imports').ImportsOptions", "markdownType": "SrcTypesImportsImportsOptions", "id": "#imports", "properties": { "global": { "type": "boolean", "id": "#imports/global", "default": false }, "scan": { "title": "Whether to scan your `composables/` and `utils/` directories for composables to auto-import. Auto-imports registered by Nuxt or other modules, such as imports from `vue` or `nuxt`, will still be enabled.", "description": "", "tags": [], "id": "#imports/scan", "default": true, "type": "boolean" }, "dirs": { "title": "An array of custom directories that will be auto-imported. Note that this option will not override the default directories (~/composables, ~/utils).", "description": "", "tags": [ "@example\n```js\nimports: {\n // Auto-import pinia stores defined in `~/stores`\n dirs: ['stores']\n}\n```" ], "id": "#imports/dirs", "default": [], "type": "array", "items": { "type": "any" } } }, "default": { "global": false, "scan": true, "dirs": [] }, "type": "object" }, "pages": { "title": "Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be enabled if you have a `pages/` directory in your source folder.", "description": "", "tags": [], "type": "boolean", "tsType": "boolean", "id": "#pages" }, "telemetry": { "title": "Manually disable nuxt telemetry.", "description": "", "tags": [ "@see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information." ], "tsType": "boolean | Record<string, any>", "id": "#telemetry", "default": {}, "type": "any" }, "devtools": { "title": "Enable Nuxt DevTools for development.", "description": "Breaking changes for devtools might not reflect on the version of Nuxt.", "tags": [ "@see [Nuxt DevTools](https://devtools.nuxt.com/) for more information." ], "tsType": " { enabled: boolean, [key: string]: any } ", "id": "#devtools", "default": {}, "type": "any" }, "vue": { "title": "Vue.js config", "description": "", "tags": [], "id": "#vue", "properties": { "transformAssetUrls": { "title": "", "description": "", "tags": [], "tsType": "typeof import('@vue/compiler-sfc').AssetURLTagConfig", "markdownType": "@vueCompilerSfcAssetURLTagConfig", "id": "#vue/transformAssetUrls", "properties": { "video": { "type": "array", "id": "#vue/transformAssetUrls/video", "default": [ "src", "poster" ], "items": { "type": "string" } }, "source": { "type": "array", "id": "#vue/transformAssetUrls/source", "default": [ "src" ], "items": { "type": "string" } }, "img": { "type": "array", "id": "#vue/transformAssetUrls/img", "default": [ "src" ], "items": { "type": "string" } }, "image": { "type": "array", "id": "#vue/transformAssetUrls/image", "default": [ "xlink:href", "href" ], "items": { "type": "string" } }, "use": { "type": "array", "id": "#vue/transformAssetUrls/use", "default": [ "xlink:href", "href" ], "items": { "type": "string" } } }, "default": { "video": [ "src", "poster" ], "source": [ "src" ], "img": [ "src" ], "image": [ "xlink:href", "href" ], "use": [ "xlink:href", "href" ] }, "type": "object" }, "compilerOptions": { "title": "Options for the Vue compiler that will be passed at build time.", "description": "", "tags": [ "@see [Vue documentation](https://vuejs.org/api/application.html#app-config-compileroptions)" ], "tsType": "typeof import('@vue/compiler-core').CompilerOptions", "markdownType": "@vueCompilerCoreCompilerOptions", "id": "#vue/compilerOptions", "default": {}, "type": "any" }, "runtimeCompiler": { "title": "Include Vue compiler in runtime bundle.", "description": "", "tags": [], "id": "#vue/runtimeCompiler", "default": false, "type": "boolean" }, "propsDestructure": { "title": "Enable reactive destructure for `defineProps`", "description": "", "tags": [], "type": "boolean", "tsType": "boolean", "id": "#vue/propsDestructure", "default": true }, "config": { "title": "It is possible to pass configure the Vue app globally. Only serializable options may be set in your `nuxt.config`. All other options should be set at runtime in a Nuxt plugin..", "description": "", "tags": [ "@see [Vue app config documentation](https://vuejs.org/api/application.html#app-config)" ], "id": "#vue/config", "default": {}, "type": "any" } }, "default": { "transformAssetUrls": { "video": [ "src", "poster" ], "source": [ "src" ], "img": [ "src" ], "image": [ "xlink:href", "href" ], "use": [ "xlink:href", "href" ] }, "compilerOptions": {}, "runtimeCompiler": false, "propsDestructure": true, "config": {} }, "type": "object" }, "app": { "title": "Nuxt App configuration.", "description": "", "tags": [], "id": "#app", "properties": { "baseURL": { "title": "The base path of your Nuxt application.", "description": "For example:", "tags": [ "@example\n```ts\nexport default defineNuxtConfig({\n app: {\n baseURL: '/prefix/'\n }\n})\n```", "This can also be set at runtime by setting the NUXT_APP_BASE_URL environment variable.", "@example\n```bash\nNUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs\n```" ], "id": "#app/baseURL", "default": "/", "type": "string" }, "buildAssetsDir": { "title": "The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). This is set at build time and should not be customized at runtime.", "description": "", "tags": [], "id": "#app/buildAssetsDir", "default": "/_nuxt/", "type": "string" }, "cdnURL": { "title": "An absolute URL to serve the public folder from (production-only).", "description": "For example:", "tags": [ "@example\n```ts\nexport default defineNuxtConfig({\n app: {\n cdnURL: 'https://mycdn.org/'\n }\n})\n```", "This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable.", "@example\n```bash\nNUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs\n```" ], "id": "#app/cdnURL", "default": "", "type": "string" }, "head": { "title": "Set default configuration for `<head>` on every page.", "description": "", "tags": [ "@example\n```js\napp: {\n head: {\n meta: [\n // <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n { name: 'viewport', content: 'width=device-width, initial-scale=1' }\n ],\n script: [\n // <script src=\"https://myawesome-lib.js\"></script>\n { src: 'https://awesome-lib.js' }\n ],\n link: [\n // <link rel=\"stylesheet\" href=\"https://myawesome-lib.css\">\n { rel: 'stylesheet', href: 'https://awesome-lib.css' }\n ],\n // please note that this is an area that is likely to change\n style: [\n // <style type=\"text/css\">:root { color: red }</style>\n { children: ':root { color: red }', type: 'text/css' }\n ],\n noscript: [\n // <noscript>JavaScript is required</noscript>\n { children: 'JavaScript is required' }\n ]\n }\n}\n```" ], "tsType": "typeof import('../src/types/config').NuxtAppConfig['head']", "markdownType": "SrcTypesConfigNuxtAppConfig['head']", "id": "#app/head", "default": { "meta": [ { "name": "viewport", "content": "width=device-width, initial-scale=1" }, { "charset": "utf-8" } ], "link": [], "style": [], "script": [], "noscript": [] }, "type": "object" }, "layoutTransition": { "title": "Default values for layout transitions.", "description": "This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.", "tags": [ "@see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition)" ], "tsType": "typeof import('../src/types/config').NuxtAppConfig['layoutTransition']", "markdownType": "SrcTypesConfigNuxtAppConfig['layoutTransition']", "id": "#app/layoutTransition", "default": false, "type": "boolean" }, "pageTransition": { "title": "Default values for page transitions.", "description": "This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.", "tags": [ "@see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition)" ], "tsType": "typeof import('../src/types/config').NuxtAppConfig['pageTransition']", "markdownType": "SrcTypesConfigNuxtAppConfig['pageTransition']", "id": "#app/pageTransition", "default": false, "type": "boolean" }, "viewTransition": { "title": "Default values for view transitions.", "description": "This only has an effect when **experimental** support for View Transitions is [enabled in your nuxt.config file](/docs/getting-started/transitions#view-transitions-api-experimental).\nThis can be overridden with `definePageMeta` on an individual page.", "tags": [ "@see [Nuxt View Transition API docs](https://nuxt.com/docs/getting-started/transitions#view-transitions-api-experimental)" ], "tsType": "typeof import('../src/types/config').NuxtAppConfig['viewTransition']", "markdownType": "SrcTypesConfigNuxtAppConfig['viewTransition']", "id": "#app/viewTransition", "default": false, "type": "boolean" }, "keepalive": { "title": "Default values for KeepAlive configuration between pages.", "description": "This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.", "tags": [ "@see [Vue KeepAlive](https://vuejs.org/api/built-in-components.html#keepalive)" ], "tsType": "typeof import('../src/types/config').NuxtAppConfig['keepalive']", "markdownType": "SrcTypesConfigNuxtAppConfig['keepalive']", "id": "#app/keepalive", "default": false, "type": "boolean" }, "rootId": { "title": "Customize Nuxt root element id.", "description": "", "tags": [ "@deprecated Prefer `rootAttrs.id` instead" ], "tsType": "string | false", "id": "#app/rootId", "default": "__nuxt", "type": "string" }, "rootTag": { "title": "Customize Nuxt root element tag.", "description": "", "tags": [], "id": "#app/rootTag", "default": "div", "type": "string" }, "rootAttrs": { "title": "Customize Nuxt root element id.", "description": "", "tags": [], "tsType": "typeof import('@unhead/schema').HtmlAttributes", "markdownType": "@unheadSchemaHtmlAttributes", "id": "#app/rootAttrs", "default": { "id": "__nuxt" }, "type": "object" }, "teleportTag": { "title": "Customize Nuxt Teleport element tag.", "description": "", "tags": [], "id": "#app/teleportTag", "default": "div", "type": "string" }, "teleportId": { "title": "Customize Nuxt Teleport element id.", "description": "", "tags": [ "@deprecated Prefer `teleportAttrs.id` instead" ], "tsType": "string | false", "id": "#app/teleportId", "default": "teleports", "type": "string" }, "teleportAttrs": { "title": "Customize Nuxt Teleport element attributes.", "description": "", "tags": [], "tsType": "typeof import('@unhead/schema').HtmlAttributes", "markdownType": "@unheadSchemaHtmlAttributes", "id": "#app/teleportAttrs", "default": { "id": "teleports" }, "type": "object" }, "spaLoaderTag": { "title": "Customize Nuxt SpaLoader element tag.", "description": "", "tags": [], "id": "#app/spaLoaderTag", "default": "div", "type": "string" }, "spaLoaderAttrs": { "title": "Customize Nuxt Nuxt SpaLoader element attributes.", "description": "", "tags": [], "tsType": "typeof import('@unhead/schema').HtmlAttributes", "markdownType": "@unheadSchemaHtmlAttributes", "id": "#app/spaLoaderAttrs", "properties": { "id": { "type": "string", "id": "#app/spaLoaderAttrs/id", "default": "__nuxt-loader" } }, "default": { "id": "__nuxt-loader" }, "type": "object" } }, "default": { "baseURL": "/", "buildAssetsDir": "/_nuxt/", "cdnURL": "", "head": { "meta": [ { "name": "viewport", "content": "width=device-width, initial-scale=1" }, { "charset": "utf-8" } ], "link": [], "style": [], "script": [], "noscript": [] }, "layoutTransition": false, "pageTransition": false, "viewTransition": false, "keepalive": false, "rootId": "__nuxt", "rootTag": "div", "rootAttrs": { "id": "__nuxt" }, "teleportTag": "div", "teleportId": "teleports", "teleportAttrs": { "id": "teleports" }, "spaLoaderTag": "div", "spaLoaderAttrs": { "id": "__nuxt-loader" } }, "type": "object" }, "spaLoadingTemplate": { "title": "Boolean or a path to an HTML file with the contents of which will be inserted into any HTML page rendered with `ssr: false`.", "description": "- If it is unset, it will use `~/app/spa-loading-template.html` file in one of your layers, if it exists. - If it is false, no SPA loading indicator will be loaded. - If true, Nuxt will look for `~/app/spa-loading-template.html` file in one of your layers, or a\n default Nuxt image will be used.\nSome good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners).", "tags": [ "@example ~/app/spa-loading-template.html\n```html\n<!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md -->\n<div class=\"loader\"></div>\n<style>\n.loader {\n display: block;\n position: fixed;\n z-index: 1031;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 18px;\n height: 18px;\n box-sizing: border-box;\n border: solid 2px transparent;\n border-top-color: #000;\n border-left-color: #000;\n border-bottom-color: #efefef;\n border-right-color: #efefef;\n border-radius: 50%;\n -webkit-animation: loader 400ms linear infinite;\n animation: loader 400ms linear infinite;\n}\n\n\\@-webkit-keyframes loader {\n 0% {\n -webkit-transform: translate(-50%, -50%) rotate(0deg);\n }\n 100% {\n -webkit-transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n\\@keyframes loader {\n 0% {\n transform: translate(-50%, -50%) rotate(0deg);\n }\n 100% {\n transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n</style>\n```" ], "tsType": "string | boolean", "id": "#spaLoadingTemplate", "default": null, "type": "any" }, "plugins": { "title": "An array of nuxt app plugins.", "description": "Each plugin can be a string (which can be an absolute or relative path to a file). If it ends with `.client` or `.server` then it will be automatically loaded only in the appropriate context.\nIt can also be an object with `src` and `mode` keys.", "tags": [ "@note Plugins are also auto-registered from the `~/plugins` directory\nand these plugins do not need to be listed in `nuxt.config` unless you\nneed to customize their order. All plugins are deduplicated by their src path.", "@see [`plugins/` directory documentation](https://nuxt.com/docs/guide/directory-structure/plugins)", "@example\n```js\nplugins: [\n '~/plugins/foo.client.js', // only in client side\n '~/plugins/bar.server.js', // only in server side\n '~/plugins/baz.js', // both client & server\n { src: '~/plugins/both-sides.js' },\n { src: '~/plugins/client-only.js', mode: 'client' }, // only on client side\n { src: '~/plugins/server-only.js', mode: 'server' } // only on server side\n]\n```" ], "tsType": "(typeof import('../src/types/nuxt').NuxtPlugin | string)[]", "markdownType": "(SrcTypesNuxtNuxtPlugin | string)[]", "id": "#plugins", "default": [], "type": "array", "items": { "type": "any" } }, "css": { "title": "You can define the CSS files/modules/libraries you want to set globally (included in every page).", "description": "Nuxt will automatically guess the file type by its extension and use the appropriate pre-processor. You will still need to install the required loader if you need to use them.", "tags": [ "@example\n```js\ncss: [\n // Load a Node.js module directly (here it's a Sass file).\n 'bulma',\n // CSS file in the project\n '~/assets/css/main.css',\n // SCSS file in the project\n '~/assets/css/main.scss'\n]\n```" ], "tsType": "string[]", "id": "#css", "default": [], "type": "array", "items": { "type": "any" } }, "unhead": { "title": "An object that allows us to configure the `unhead` nuxt module.", "description": "", "tags": [], "id": "#unhead", "properties": { "renderSSRHeadOptions": { "title": "An object that will be passed to `renderSSRHead` to customize the output.", "description": "", "tags": [ "@see [`unhead` options documentation](https://unhead.unjs.io/setup/ssr/installation#options)", "@example\n```ts\nexport default defineNuxtConfig({\n unhead: {\n renderSSRHeadOptions: {\n omitLineBreaks: true\n }\n})\n```" ], "tsType": "typeof import('@unhead/schema').RenderSSRHeadOptions", "markdownType": "@unheadSchemaRenderSSRHeadOptions", "id": "#unhead/renderSSRHeadOptions", "default": { "omitLineBreaks": false }, "type": "object" } }, "default": { "renderSSRHeadOptions": { "omitLineBreaks": false } }, "type": "object" }, "builder": { "title": "The builder to use for bundling the Vue part of your application.", "description": "", "tags": [], "tsType": "'vite' | 'webpack' | 'rspack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }", "markdownType": "'vite' | 'webpack' | 'rspack' | { bundle: (nuxt: SrcTypesNuxtNuxt) => Promise<void> }", "id": "#builder", "default": "@nuxt/vite-builder", "type": "string" }, "sourcemap": { "title": "Configures whether and how sourcemaps are generated for server and/or client bundles.", "description": "If set to a single boolean, that value applies to both server and client. Additionally, the `'hidden'` option is also available for both server and client.\nAvailable options for both client and server: - `true`: Generates sourcemaps and includes source references in the final bundle. - `false`: Does not generate any sourcemaps. - `'hidden'`: Generates sourcemaps but does not include references in the final bundle.", "tags": [], "tsType": "boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }", "id": "#sourcemap", "default": { "server": true, "client": false }, "type": "object" }, "logLevel": { "title": "Log level when building logs.", "description": "Defaults to 'silent' when running in CI or when a TTY is not available. This option is then used as 'silent' in Vite and 'none' in Webpack", "tags": [], "tsType": "'silent' | 'info' | 'verbose'", "id": "#logLevel", "default": "info", "type": "string" }, "build": { "title": "Shared build configuration.", "description": "", "tags": [], "id": "#build", "properties": { "transpile": { "title": "If you want to transpile specific dependencies with Babel, you can add them here. Each item in transpile can be a package name, a function, a string or regex object matching the dependency's file name.", "description": "You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }).", "tags": [ "@example\n```js\ntranspile: [({ isLegacy }) => isLegacy && 'ky']\n```" ], "tsType": "Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)>", "id": "#build/transpile", "default": [], "type": "array", "items": { "type": "any" } }, "templates": { "title": "It is recommended to use `addTemplate` from `@nuxt/kit` instead of this option.", "description": "", "tags": [ "@example\n```js\ntemplates: [\n {\n src: '~/modules/support/plugin.js', // `src` can be absolute or relative\n dst: 'support.js', // `dst` is relative to project `.nuxt` dir\n }\n]\n```" ], "tsType": "typeof import('../src/types/nuxt').NuxtTemplate<any>[]", "markdownType": "SrcTypesNuxtNuxtTemplate<any>[]", "id": "#build/templates", "default": [], "type": "array", "items": { "type": "any" } }, "analyze": { "title": "Nuxt allows visualizing your bundles and how to optimize them.", "description": "Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options).", "tags": [ "@example\n```js\nanalyze: {\n analyzerMode: 'static'\n}\n```" ], "tsType": "boolean | { enabled?: boolean } & ((0 extends 1 & typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options ? {} : typeof import('webpack-bundle-analyzer').BundleAnalyzerPlugin.Options) | typeof import('rollup-plugin-visualizer').PluginVisualizerOptions)", "markdownType": "boolean | { enabled?: boolean } & ((0 extends 1 & WebpackBundleAnalyzerBundleAnalyzerPluginOptions ? {} : WebpackBundleAnalyzerBundleAnalyzerPluginOptions) | RollupPluginVisualizerPluginVisualizerOptions)", "id": "#build/analyze", "default": { "template": "treemap", "projectRoot": "/<rootDir>", "filename": "/<rootDir>/.nuxt/analyze/{name}.html" }, "type": "object" } }, "default": { "transpile": [], "templates": [], "analyze": { "template": "treemap", "projectRoot": "/<rootDir>", "filename": "/<rootDir>/.nuxt/analyze/{name}.html" } }, "type": "object" }, "optimization": { "title": "Build time optimization configuration.", "description": "", "tags": [], "id": "#optimization", "properties": { "keyedComposables": { "title": "Functions to inject a key for.", "description": "As long as the number of arguments passed to the function is less than `argumentLength`, an additional magic string will be injected that can be used to deduplicate requests between server and client. You will need to take steps to handle this additional key.\nThe key will be unique based on the location of the function being invoked within the file.", "tags": [], "tsType": "Array<{ name: string, source?: string | RegExp, argumentLength: number }>", "id": "#optimization/keyedComposables", "default": [ { "name": "callOnce", "argumentLength": 3 }, { "name": "defineNuxtComponent", "argumentLength": 2 }, { "name": "useState", "argumentLength": 2 }, { "name": "useFetch", "argumentLength": 3 }, { "name": "useAsyncData", "argumentLength": 3 }, { "name": "useLazyAsyncData", "argumentLength": 3 }, { "name": "useLazyFetch", "argumentLength": 3 } ], "type": "array", "items": { "type": "object" } }, "treeShake": { "title": "Tree shake code from specific builds.", "description": "", "tags": [], "id": "#optimization/treeShake", "properties": { "composables": { "title": "Tree shake composables from the server or client builds.", "description": "", "tags": [ "@example\n```js\ntreeShake: { client: { myPackage: ['useServerOnlyComposable'] } }\n```" ], "id": "#optimization/treeShake/composables", "properties": { "server": { "id": "#optimization/treeShake/composables/server", "default": { "vue": [ "onMounted", "onUpdated", "onUnmounted", "onBeforeMount", "onBeforeUpdate", "onBeforeUnmount", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated" ], "#app": [ "definePayloadReviver", "definePageMeta" ] }, "type": "object" }, "client": { "id": "#optimization/treeShake/composables/client", "default": { "vue": [ "onRenderTracked", "onRenderTriggered", "onServerPrefetch" ], "#app": [ "definePayloadReducer", "definePageMeta", "onPrehydrate" ] }, "type": "object" } }, "default": { "server": { "vue": [ "onMounted", "onUpdated", "onUnmounted", "onBeforeMount", "onBeforeUpdate", "onBeforeUnmount", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated" ], "#app": [ "definePayloadReviver", "definePageMeta" ] }, "client": { "vue": [ "onRenderTracked", "onRenderTriggered", "onServerPrefetch" ], "#app": [ "definePayloadReducer", "definePageMeta", "onPrehydrate" ] } }, "type": "object" } }, "default": { "composables": { "server": { "vue": [ "onMounted", "onUpdated", "onUnmounted", "onBeforeMount", "onBeforeUpdate", "onBeforeUnmount", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated" ], "#app": [ "definePayloadReviver", "definePageMeta" ] }, "client": { "vue": [ "onRenderTracked", "onRenderTriggered", "onServerPrefetch" ], "#app": [ "definePayloadReducer", "definePageMeta", "onPrehydrate" ] } } }, "type": "object" }, "asyncTransforms": { "title": "Options passed directly to the transformer from `unctx` that preserves async context after `await`.", "description": "", "tags": [], "tsType": "typeof import('unctx/transform').TransformerOptions", "markdownType": "UnctxTransformTransformerOptions", "id": "#optimization/asyncTransforms", "properties": { "asyncFunctions": { "type": "array", "id": "#optimization/asyncTransforms/asyncFunctions", "default": [ "defineNuxtPlugin", "defineNuxtRouteMiddleware" ], "items": { "type": "string" } }, "objectDefinitions": { "id": "#optimization/asyncTransforms/objectDefinitions", "properties": { "defineNuxtComponent": { "type": "array", "id": "#optimization/asyncTransforms/objectDefinitions/defineNuxtComponent", "default": [ "asyncData", "setup" ], "items": { "type": "string" } }, "defineNuxtPlugin": { "type": "array", "id": "#optimization/asyncTransforms/objectDefinitions/defineNuxtPlugin", "default": [ "setup" ], "items": { "type": "string" } }, "definePageMeta": { "type": "array", "id": "#optimization/asyncTransforms/objectDefinitions/definePageMeta", "default": [ "middleware", "validate" ], "items": { "type": "string" } } }, "default": { "defineNuxtComponent": [ "asyncData", "setup" ], "defineNuxtPlugin": [ "setup" ], "definePageMeta": [ "middleware", "validate" ] }, "type": "object" } }, "default": { "asyncFunctions": [ "defineNuxtPlugin", "defineNuxtRouteMiddleware" ], "objectDefinitions": { "defineNuxtComponent": [ "asyncData", "setup" ], "defineNuxtPlugin": [ "setup" ], "definePageMeta": [ "middleware", "validate" ] } }, "type": "object" } }, "default": { "keyedComposables": [ { "name": "callOnce", "argumentLength": 3 }, { "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": { "server": { "vue": [ "onMounted", "onUpdated", "onUnmounted", "onBeforeMount", "onBeforeUpdate", "onBeforeUnmount", "onRenderTracked", "onRenderTriggered", "onActivated", "onDeactivated" ], "#app": [ "definePayloadReviver", "definePageMeta" ] }, "client": { "vue": [ "onRenderTracked", "onRenderTriggered", "onServerPrefetch" ], "#app": [ "definePayloadReducer", "definePageMeta", "onPrehydrate" ] } } }, "asyncTransforms": { "asyncFunctions": [ "defineNuxtPlugin", "defineNuxtRouteMiddleware" ], "objectDefinitions": { "defineNuxtComponent": [ "asyncData", "setup" ], "defineNuxtPlugin": [ "setup" ], "definePageMeta": [ "middleware", "validate" ] } } }, "type": "object" }, "extends": { "title": "Extend project from multiple local or remote sources.", "description": "Value should be either a string or array of strings pointing to source directories or config path relative to current config.\nYou can use `github:`, `gh:` `gitlab:` or `bitbucket:`", "tags": [ "@see [`c12` docs on extending config layers](https://github.com/unjs/c12#extending-config-layer-from-remote-sources)", "@see [`giget` documentation](https://github.com/unjs/giget)" ], "tsType": "string | [string, typeof import('c12').SourceOptions?] | (string | [string, typeof import('c12').SourceOptions?])[]", "markdownType": "string | [string, C12SourceOptions?] | (string | [string, C12SourceOptions?])[]", "id": "#extends", "default": null, "type": "any" }, "compatibilityDate": { "title": "Specify a compatibility date for your app.", "description": "This is used to control the behavior of presets in Nitro, Nuxt Image and other modules that may change behavior without a major version bump.\nWe plan to improve the tooling around this feature in the future.", "tags": [], "tsType": "typeof import('compatx').CompatibilityDateSpec", "markdownType": "CompatxCompatibilityDateSpec", "id": "#compatibilityDate", "default": {}, "type": "any" }, "theme": { "title": "Extend project from a local or remote source.", "description": "Value should be a string pointing to source directory or config path relative to current config.\nYou can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.", "tags": [], "type": "string", "tsType": "string", "id": "#theme", "default": null }, "rootDir": { "title": "Define the root directory of your application.", "description": "This property can be overwritten (for example, running `nuxt ./my-app/` will set the `rootDir` to the absolute path of `./my-app/` from the current/working directory.\nIt is normally not needed to configure this option.", "tags": [], "id": "#rootDir", "default": "/<rootDir>", "type": "string" }, "workspaceDir": { "title": "Define the workspace directory of your application.", "description": "Often this is used when in a monorepo setup. Nuxt will attempt to detect your workspace directory automatically, but you can override it here.\nIt is normally not needed to configure this option.", "tags": [], "id": "#workspaceDir", "default": "/<workspaceDir>", "type": "string" }, "srcDir": { "title": "Define the source directory of your Nuxt application.", "description": "If a relative path is specified, it will be relative to the `rootDir`.", "tags": [ "@example\n```js\nexport default {\n srcDir: 'src/'\n}\n```\nThis would work with the following folder structure:\n```bash\n-| app/\n---| node_modules/\n---| nuxt.config.js\n---| package.json\n---| src/\n------| assets/\n------| components/\n------| layouts/\n------| middleware/\n------| pages/\n------| plugins/\n------| public/\n------| store/\n------| server/\n------| app.config.ts\n------| app.vue\n------| error.vue\n```" ], "id": "#srcDir", "default": "/<srcDir>", "type": "string" }, "serverDir": { "title": "Define the server directory of your Nuxt application, where Nitro routes, middleware and plugins are kept.", "description": "If a relative path is specified, it will be relative to your `rootDir`.", "tags": [], "id": "#serverDir", "default": "/<srcDir>/server", "type": "string" }, "buildDir": { "title": "Define the directory where your built Nuxt files will be placed.", "description": "Many tools assume that `.nuxt` is a hidden directory (because it starts with a `.`). If that is a problem, you can use this option to prevent that.", "tags": [ "@example\n```js\nexport default {\n buildDir: 'nuxt-build'\n}\n```" ], "id": "#buildDir", "default": "/<rootDir>/.nuxt", "type": "string" }, "appId": { "title": "For multi-app projects, the unique id of the Nuxt application.", "description": "Defaults to `nuxt-app`.", "tags": [], "id": "#appId", "default": "nuxt-app", "type": "string" }, "buildId": { "title": "A unique identifier matching the build. This may contain the hash of the current state of the project.", "description": "", "tags": [], "id": "#buildId", "default": "ccc5ae97-dafb-4eec-96a7-6079193880ea", "type": "string" }, "modulesDir": { "title": "Used to set the modules directories for path resolving (for example, webpack's `resolveLoading`, `nodeExternals` and `postcss`).", "description": "The configuration path is relative to `options.rootDir` (default is current working directory).\nSetting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository.", "tags": [ "@example\n```js\nexport default {\n modulesDir: ['../../node_modules']\n}\n```" ], "id": "#modulesDir", "default": [ "/<rootDir>/node_modules" ], "type": "array", "items": { "type": "string" } }, "analyzeDir": { "title": "The directory where Nuxt will store the generated files when running `nuxt analyze`.", "description": "If a relative path is specified, it will be relative to your `rootDir`.", "tags": [], "id": "#analyzeDir", "default": "/<rootDir>/.nuxt/analyze", "type": "string" }, "dev": { "title": "Whether Nuxt is running in development mode.", "description": "Normally, you should not need to set this.", "tags": [], "id": "#dev", "default": false, "type": "boolean" }, "test": { "title": "Whether your app is being unit tested.", "description": "", "tags": [], "id": "#test", "default": false, "type": "boolean" }, "debug": { "title": "Set to `true` to enable debug mode.", "description": "At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.", "tags": [], "id": "#debug", "default": false, "type": "boolean" }, "ssr": { "title": "Whether to enable rendering of HTML - either dynamically (in server mode) or at generate time. If set to `false` generated pages will have no content.", "description": "", "tags": [], "id": "#ssr", "default": true, "type": "boolean" }, "modules": { "title": "Modules are Nuxt extensions which can extend its core functionality and add endless integrations.", "description": "Each module is either a string (which can refer to a package, or be a path to a file), a tuple with the module as first string and the options as a second object, or an inline module function.\nNuxt tries to resolve each item in the modules array using node require path (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used.", "tags": [ "@note Modules are executed sequentially so the order is important. First, the modules defined in `nuxt.config.ts` are loaded. Then, modules found in the `modules/`\ndirectory are executed, and they load in alphabetical order.", "@example\n```js\nmodules: [\n // Using package name\n '@nuxtjs/axios',\n // Relative to your project srcDir\n '~/modules/awesome.js',\n // Providing options\n ['@nuxtjs/google-analytics', { ua: 'X1234567' }],\n // Inline definition\n function () {}\n]\n```" ], "tsType": "(typeof import('../src/types/module').NuxtModule<any> | string | [typeof import('../src/types/module').NuxtModule | string, Record<string, any>] | undefined | null | false)[]", "markdownType": "(SrcTypesModuleNuxtModule<any> | string | [SrcTypesModuleNuxtModule | string, Record<string, any>] | undefined | null | false)[]", "id": "#modules", "default": [], "type": "array", "items": { "type": "any" } }, "dir": { "title": "Customize default directory structure used by Nuxt.", "description": "It is better to stick with defaults unless needed.", "tags": [], "id": "#dir", "properties": { "app": { "id": "#dir/app", "default": "app", "type": "string" }, "assets": { "title": "The assets directory (aliased as `~assets` in your build).", "description": "", "tags": [], "id": "#dir/assets", "default": "assets", "type": "string" }, "layouts": { "title": "The layouts directory, each file of which will be auto-registered as a Nuxt layout.", "description": "", "tags": [], "id": "#dir/layouts", "default": "layouts", "type": "string" }, "middleware": { "title": "The middleware directory, each file of which will be auto-registered as a Nuxt middleware.", "description": "", "tags": [], "id": "#dir/middleware", "default": "middleware", "type": "string" }, "modules": { "title": "The modules directory, each file in which will be auto-registered as a Nuxt module.", "description": "", "tags": [], "id": "#dir/modules", "default": "modules", "type": "string" }, "pages": { "title": "The directory which will be processed to auto-generate your application page routes.", "description": "", "tags": [], "id": "#dir/pages", "default": "pages", "type": "string" }, "plugins": { "title": "The plugins directory, each file of which will be auto-registered as a Nuxt plugin.", "description": "", "tags": [], "id": "#dir/plugins", "default": "plugins", "type": "string" }, "shared": { "title": "The shared directory. This directory is shared between the app and the server.", "description": "", "tags": [], "id": "#dir/shared", "default": "shared", "type": "string" }, "public": { "title": "The directory containing your static files, which will be directly accessible via the Nuxt server and copied across into your `dist` folder when your app is generated.", "description": "", "tags": [], "id": "#dir/public", "default": "public", "type": "string" }, "static": { "deprecated": "use `dir.public` option instead", "id": "#dir/static", "default": "public", "type": "string" } }, "default": { "app": "app", "assets": "assets", "layouts": "layouts", "middleware": "middleware", "modules": "modules", "pages": "pages", "plugins": "plugins", "shared": "shared", "static": "public", "public": "public" }, "type": "object" }, "extensions": { "title": "The extensions that should be resolved by the Nuxt resolver.", "description": "", "tags": [], "i