@nuxt/schema-nightly
Advanced tools
Comparing version 3.8.1-28312745.ebb5767b to 3.8.1-28312851.c4bb8f31
{ | ||
"name": "@nuxt/schema-nightly", | ||
"version": "3.8.1-28312745.ebb5767b", | ||
"version": "3.8.1-28312851.c4bb8f31", | ||
"repository": "nuxt/nuxt", | ||
@@ -33,3 +33,3 @@ "description": "Nuxt types and default configuration", | ||
"@types/sass-loader": "8.0.7", | ||
"@unhead/schema": "1.8.0", | ||
"@unhead/schema": "1.8.1", | ||
"@vitejs/plugin-vue": "4.4.0", | ||
@@ -36,0 +36,0 @@ "@vitejs/plugin-vue-jsx": "3.0.2", |
@@ -30,412 +30,80 @@ import type { ComponentsOptions } from '../src/types/components' | ||
export interface ConfigSchema { | ||
/** | ||
* Configure Nuxt component auto-registration. | ||
* | ||
* Any components in the directories configured here can be used throughout your pages, layouts (and other components) without needing to explicitly import them. | ||
* | ||
* | ||
* @see https://nuxt.com/docs/guide/directory-structure/components | ||
*/ | ||
components: boolean | ComponentsOptions | ComponentsOptions['dirs'], | ||
/** | ||
* Configure how Nuxt auto-imports composables into your application. | ||
* | ||
* | ||
* @see [Nuxt 3 documentation](https://nuxt.com/docs/guide/directory-structure/composables) | ||
*/ | ||
imports: ImportsOptions, | ||
/** | ||
* 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. | ||
* | ||
*/ | ||
pages: boolean, | ||
/** | ||
* Manually disable nuxt telemetry. | ||
* | ||
* | ||
* @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information. | ||
*/ | ||
telemetry: boolean | Record<string, any>, | ||
/** | ||
* Enable Nuxt DevTools for development. | ||
* | ||
* Breaking changes for devtools might not reflect on the version of Nuxt. | ||
* | ||
* | ||
* @see [Nuxt DevTools](https://devtools.nuxt.com/) for more information. | ||
*/ | ||
devtools: { enabled: boolean, [key: string]: any } , | ||
/** | ||
* Vue.js config | ||
* | ||
*/ | ||
vue: { | ||
/** | ||
* Options for the Vue compiler that will be passed at build time. | ||
* | ||
* | ||
* @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions) | ||
*/ | ||
compilerOptions: CompilerOptions, | ||
/** | ||
* Include Vue compiler in runtime bundle. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
runtimeCompiler: boolean, | ||
/** | ||
* Vue Experimental: Enable reactive destructure for `defineProps` | ||
* | ||
* @default false | ||
* | ||
* @see [Vue RFC#502](https://github.com/vuejs/rfcs/discussions/502) | ||
*/ | ||
/** @default false */ | ||
propsDestructure: boolean, | ||
/** | ||
* Vue Experimental: Enable macro `defineModel` | ||
* | ||
* @default false | ||
* | ||
* @see [Vue RFC#503](https://github.com/vuejs/rfcs/discussions/503) | ||
*/ | ||
/** @default false */ | ||
defineModel: boolean, | ||
}, | ||
/** | ||
* Nuxt App configuration. | ||
* | ||
*/ | ||
app: { | ||
/** | ||
* The base path of your Nuxt application. | ||
* | ||
* This can be set at runtime by setting the NUXT_APP_BASE_URL environment variable. | ||
* | ||
* @default "/" | ||
* | ||
* @example | ||
* ```bash | ||
* NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs | ||
* ``` | ||
*/ | ||
/** @default "/" */ | ||
baseURL: string, | ||
/** | ||
* 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. | ||
* | ||
* @default "/_nuxt/" | ||
*/ | ||
/** @default "/_nuxt/" */ | ||
buildAssetsDir: string, | ||
/** | ||
* An absolute URL to serve the public folder from (production-only). | ||
* | ||
* This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. | ||
* | ||
* @default "" | ||
* | ||
* @example | ||
* ```bash | ||
* NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs | ||
* ``` | ||
*/ | ||
/** @default "" */ | ||
cdnURL: string, | ||
/** | ||
* Set default configuration for `<head>` on every page. | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* app: { | ||
* head: { | ||
* meta: [ | ||
* // <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
* { name: 'viewport', content: 'width=device-width, initial-scale=1' } | ||
* ], | ||
* script: [ | ||
* // <script src="https://myawesome-lib.js"></script> | ||
* { src: 'https://awesome-lib.js' } | ||
* ], | ||
* link: [ | ||
* // <link rel="stylesheet" href="https://myawesome-lib.css"> | ||
* { rel: 'stylesheet', href: 'https://awesome-lib.css' } | ||
* ], | ||
* // please note that this is an area that is likely to change | ||
* style: [ | ||
* // <style type="text/css">:root { color: red }</style> | ||
* { children: ':root { color: red }', type: 'text/css' } | ||
* ], | ||
* noscript: [ | ||
* // <noscript>JavaScript is required</noscript> | ||
* { children: 'JavaScript is required' } | ||
* ] | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
head: NuxtAppConfig['head'], | ||
/** | ||
* Default values for layout transitions. | ||
* | ||
* This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed. | ||
* | ||
* @default false | ||
* | ||
* @see https://vuejs.org/api/built-in-components.html#transition | ||
*/ | ||
/** @default false */ | ||
layoutTransition: NuxtAppConfig['layoutTransition'], | ||
/** | ||
* Default values for page transitions. | ||
* | ||
* This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed. | ||
* | ||
* @default false | ||
* | ||
* @see https://vuejs.org/api/built-in-components.html#transition | ||
*/ | ||
/** @default false */ | ||
pageTransition: NuxtAppConfig['pageTransition'], | ||
/** | ||
* Default values for KeepAlive configuration between pages. | ||
* | ||
* This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed. | ||
* | ||
* @default false | ||
* | ||
* @see https://vuejs.org/api/built-in-components.html#keepalive | ||
*/ | ||
/** @default false */ | ||
keepalive: NuxtAppConfig['keepalive'], | ||
/** | ||
* Customize Nuxt root element id. | ||
* | ||
* @default "__nuxt" | ||
*/ | ||
/** @default "__nuxt" */ | ||
rootId: string | false, | ||
/** | ||
* Customize Nuxt root element tag. | ||
* | ||
* @default "div" | ||
*/ | ||
/** @default "div" */ | ||
rootTag: string, | ||
}, | ||
/** | ||
* Boolean or a path to an HTML file with the contents of which will be inserted into any HTML page rendered with `ssr: false`. - If it is unset, it will use `~/app/spa-loading-template.html` 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 or a default Nuxt image will be used. | ||
* | ||
* Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners). | ||
* | ||
* | ||
* @example ~/app/spa-loading-template.html | ||
* ```html | ||
* <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md --> | ||
* <div class="loader"></div> | ||
* <style> | ||
* .loader { | ||
* display: block; | ||
* position: fixed; | ||
* z-index: 1031; | ||
* top: 50%; | ||
* left: 50%; | ||
* transform: translate(-50%, -50%); | ||
* width: 18px; | ||
* height: 18px; | ||
* box-sizing: border-box; | ||
* border: solid 2px transparent; | ||
* border-top-color: #000; | ||
* border-left-color: #000; | ||
* border-bottom-color: #efefef; | ||
* border-right-color: #efefef; | ||
* border-radius: 50%; | ||
* -webkit-animation: loader 400ms linear infinite; | ||
* animation: loader 400ms linear infinite; | ||
* } | ||
* | ||
* \@-webkit-keyframes loader { | ||
* 0% { | ||
* -webkit-transform: translate(-50%, -50%) rotate(0deg); | ||
* } | ||
* 100% { | ||
* -webkit-transform: translate(-50%, -50%) rotate(360deg); | ||
* } | ||
* } | ||
* \@keyframes loader { | ||
* 0% { | ||
* transform: translate(-50%, -50%) rotate(0deg); | ||
* } | ||
* 100% { | ||
* transform: translate(-50%, -50%) rotate(360deg); | ||
* } | ||
* } | ||
* </style> | ||
* ``` | ||
*/ | ||
spaLoadingTemplate: string | boolean, | ||
/** | ||
* An array of nuxt app plugins. | ||
* | ||
* 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. | ||
* It can also be an object with `src` and `mode` keys. | ||
* | ||
* | ||
* @note Plugins are also auto-registered from the `~/plugins` directory | ||
* and these plugins do not need to be listed in `nuxt.config` unless you | ||
* need to customize their order. All plugins are deduplicated by their src path. | ||
* | ||
* @see https://nuxt.com/docs/guide/directory-structure/plugins | ||
* | ||
* @example | ||
* ```js | ||
* plugins: [ | ||
* '~/plugins/foo.client.js', // only in client side | ||
* '~/plugins/bar.server.js', // only in server side | ||
* '~/plugins/baz.js', // both client & server | ||
* { src: '~/plugins/both-sides.js' }, | ||
* { src: '~/plugins/client-only.js', mode: 'client' }, // only on client side | ||
* { src: '~/plugins/server-only.js', mode: 'server' } // only on server side | ||
* ] | ||
* ``` | ||
*/ | ||
plugins: (NuxtPlugin | string)[], | ||
/** | ||
* You can define the CSS files/modules/libraries you want to set globally (included in every page). | ||
* | ||
* 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. | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* css: [ | ||
* // Load a Node.js module directly (here it's a Sass file). | ||
* 'bulma', | ||
* // CSS file in the project | ||
* '@/assets/css/main.css', | ||
* // SCSS file in the project | ||
* '@/assets/css/main.scss' | ||
* ] | ||
* ``` | ||
*/ | ||
css: string[], | ||
/** | ||
* The builder to use for bundling the Vue part of your application. | ||
* | ||
* @default "@nuxt/vite-builder" | ||
*/ | ||
/** @default "@nuxt/vite-builder" */ | ||
builder: 'vite' | 'webpack' | { bundle: (nuxt: Nuxt) => Promise<void> }, | ||
/** | ||
* Whether to generate sourcemaps. | ||
* | ||
*/ | ||
sourcemap: boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }, | ||
/** | ||
* Log level when building logs. | ||
* | ||
* 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 | ||
* | ||
* @default "info" | ||
*/ | ||
/** @default "info" */ | ||
logLevel: 'silent' | 'info' | 'verbose', | ||
/** | ||
* Shared build configuration. | ||
* | ||
*/ | ||
build: { | ||
/** | ||
* 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. | ||
* | ||
* You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }). | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* transpile: [({ isLegacy }) => isLegacy && 'ky'] | ||
* ``` | ||
*/ | ||
transpile: Array<string | RegExp | ((ctx: { isClient?: boolean; isServer?: boolean; isDev: boolean }) => string | RegExp | false)>, | ||
/** | ||
* You can provide your own templates which will be rendered based on Nuxt configuration. This feature is specially useful for using with modules. | ||
* | ||
* Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template). | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* templates: [ | ||
* { | ||
* src: '~/modules/support/plugin.js', // `src` can be absolute or relative | ||
* dst: 'support.js', // `dst` is relative to project `.nuxt` dir | ||
* options: { | ||
* // Options are provided to template as `options` key | ||
* live_chat: false | ||
* } | ||
* } | ||
* ] | ||
* ``` | ||
*/ | ||
templates: NuxtTemplate<any>[], | ||
/** | ||
* Nuxt allows visualizing your bundles and how to optimize them. | ||
* | ||
* 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). | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* analyze: { | ||
* analyzerMode: 'static' | ||
* } | ||
* ``` | ||
*/ | ||
analyze: boolean | { enabled?: boolean } & ((0 extends 1 & BundleAnalyzerPlugin.Options ? {} : BundleAnalyzerPlugin.Options) | PluginVisualizerOptions), | ||
}, | ||
/** | ||
* Build time optimization configuration. | ||
* | ||
*/ | ||
optimization: { | ||
/** | ||
* Functions to inject a key for. | ||
* | ||
* 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. | ||
* The key will be unique based on the location of the function being invoked within the file. | ||
* | ||
* @default [{"name":"defineNuxtComponent","argumentLength":2},{"name":"useState","argumentLength":2},{"name":"useFetch","argumentLength":3},{"name":"useAsyncData","argumentLength":3},{"name":"useLazyAsyncData","argumentLength":3},{"name":"useLazyFetch","argumentLength":3}] | ||
*/ | ||
/** @default [{"name":"defineNuxtComponent","argumentLength":2},{"name":"useState","argumentLength":2},{"name":"useFetch","argumentLength":3},{"name":"useAsyncData","argumentLength":3},{"name":"useLazyAsyncData","argumentLength":3},{"name":"useLazyFetch","argumentLength":3}] */ | ||
keyedComposables: Array<{ name: string, source?: string | RegExp, argumentLength: number }>, | ||
/** | ||
* Tree shake code from specific builds. | ||
* | ||
*/ | ||
treeShake: { | ||
/** | ||
* Tree shake composables from the server or client builds. | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* treeShake: { client: { myPackage: ['useServerOnlyComposable'] } } | ||
* ``` | ||
*/ | ||
composables: { | ||
@@ -452,250 +120,65 @@ server: { | ||
/** | ||
* Options passed directly to the transformer from `unctx` that preserves async context after `await`. | ||
* | ||
*/ | ||
asyncTransforms: TransformerOptions, | ||
}, | ||
/** | ||
* Extend project from multiple local or remote sources. | ||
* | ||
* Value should be either a string or array of strings pointing to source directories or config path relative to current config. | ||
* You can use `github:`, `gh:` `gitlab:` or `bitbucket:`. | ||
* | ||
* | ||
* @see https://github.com/unjs/c12#extending-config-layer-from-remote-sources | ||
* | ||
* @see https://github.com/unjs/giget | ||
*/ | ||
extends: string | [string, SourceOptions?] | (string | [string, SourceOptions?])[], | ||
/** | ||
* Extend project from a local or remote source. | ||
* | ||
* Value should be a string pointing to source directory or config path relative to current config. | ||
* You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. | ||
* | ||
* @default null | ||
*/ | ||
/** @default null */ | ||
theme: string, | ||
/** | ||
* Define the root directory of your application. | ||
* | ||
* 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. | ||
* It is normally not needed to configure this option. | ||
* | ||
* @default "/<rootDir>" | ||
*/ | ||
/** @default "/<rootDir>" */ | ||
rootDir: string, | ||
/** | ||
* Define the workspace directory of your application. | ||
* | ||
* Often this is used when in a monorepo setup. Nuxt will attempt to detect your workspace directory automatically, but you can override it here. | ||
* It is normally not needed to configure this option. | ||
* | ||
* @default "/<rootDir>" | ||
*/ | ||
/** @default "/<rootDir>" */ | ||
workspaceDir: string, | ||
/** | ||
* Define the source directory of your Nuxt application. | ||
* | ||
* If a relative path is specified, it will be relative to the `rootDir`. | ||
* | ||
* @default "/<rootDir>" | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* srcDir: 'src/' | ||
* } | ||
* ``` | ||
* This would work with the following folder structure: | ||
* ```bash | ||
* -| app/ | ||
* ---| node_modules/ | ||
* ---| nuxt.config.js | ||
* ---| package.json | ||
* ---| src/ | ||
* ------| assets/ | ||
* ------| components/ | ||
* ------| layouts/ | ||
* ------| middleware/ | ||
* ------| pages/ | ||
* ------| plugins/ | ||
* ------| static/ | ||
* ------| store/ | ||
* ------| server/ | ||
* ------| app.config.ts | ||
* ------| app.vue | ||
* ------| error.vue | ||
* ``` | ||
*/ | ||
/** @default "/<rootDir>" */ | ||
srcDir: string, | ||
/** | ||
* Define the server directory of your Nuxt application, where Nitro routes, middleware and plugins are kept. | ||
* | ||
* If a relative path is specified, it will be relative to your `rootDir`. | ||
* | ||
* @default "/<rootDir>/server" | ||
*/ | ||
/** @default "/<rootDir>/server" */ | ||
serverDir: string, | ||
/** | ||
* Define the directory where your built Nuxt files will be placed. | ||
* | ||
* 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. | ||
* | ||
* @default "/<rootDir>/.nuxt" | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* buildDir: 'nuxt-build' | ||
* } | ||
* ``` | ||
*/ | ||
/** @default "/<rootDir>/.nuxt" */ | ||
buildDir: string, | ||
/** | ||
* Used to set the modules directories for path resolving (for example, webpack's `resolveLoading`, `nodeExternals` and `postcss`). | ||
* | ||
* The configuration path is relative to `options.rootDir` (default is current working directory). | ||
* Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository. | ||
* | ||
* @default ["/<rootDir>/node_modules","/home/runner/work/nuxt/nuxt/packages/schema/node_modules"] | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* modulesDir: ['../../node_modules'] | ||
* } | ||
* ``` | ||
*/ | ||
/** @default ["/<rootDir>/node_modules","/home/runner/work/nuxt/nuxt/packages/schema/node_modules"] */ | ||
modulesDir: Array<string>, | ||
/** | ||
* The directory where Nuxt will store the generated files when running `nuxt analyze`. | ||
* | ||
* If a relative path is specified, it will be relative to your `rootDir`. | ||
* | ||
* @default "/<rootDir>/.nuxt/analyze" | ||
*/ | ||
/** @default "/<rootDir>/.nuxt/analyze" */ | ||
analyzeDir: string, | ||
/** | ||
* Whether Nuxt is running in development mode. | ||
* | ||
* Normally, you should not need to set this. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
dev: boolean, | ||
/** | ||
* Whether your app is being unit tested. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
test: boolean, | ||
/** | ||
* Set to `true` to enable debug mode. | ||
* | ||
* At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
debug: boolean, | ||
/** | ||
* 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. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
ssr: boolean, | ||
/** | ||
* Modules are Nuxt extensions which can extend its core functionality and add endless integrations. | ||
* | ||
* 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. | ||
* Nuxt 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. | ||
* | ||
* | ||
* @note Modules are executed sequentially so the order is important. | ||
* | ||
* @example | ||
* ```js | ||
* modules: [ | ||
* // Using package name | ||
* '@nuxtjs/axios', | ||
* // Relative to your project srcDir | ||
* '~/modules/awesome.js', | ||
* // Providing options | ||
* ['@nuxtjs/google-analytics', { ua: 'X1234567' }], | ||
* // Inline definition | ||
* function () {} | ||
* ] | ||
* ``` | ||
*/ | ||
modules: (NuxtModule | string | [NuxtModule | string, Record<string, any>] | undefined | null | false)[], | ||
/** | ||
* Customize default directory structure used by Nuxt. | ||
* | ||
* It is better to stick with defaults unless needed. | ||
* | ||
*/ | ||
dir: { | ||
/** | ||
* The assets directory (aliased as `~assets` in your build). | ||
* | ||
* @default "assets" | ||
*/ | ||
/** @default "assets" */ | ||
assets: string, | ||
/** | ||
* The layouts directory, each file of which will be auto-registered as a Nuxt layout. | ||
* | ||
* @default "layouts" | ||
*/ | ||
/** @default "layouts" */ | ||
layouts: string, | ||
/** | ||
* The middleware directory, each file of which will be auto-registered as a Nuxt middleware. | ||
* | ||
* @default "middleware" | ||
*/ | ||
/** @default "middleware" */ | ||
middleware: string, | ||
/** | ||
* The modules directory, each file in which will be auto-registered as a Nuxt module. | ||
* | ||
* @default "modules" | ||
*/ | ||
/** @default "modules" */ | ||
modules: string, | ||
/** | ||
* The directory which will be processed to auto-generate your application page routes. | ||
* | ||
* @default "pages" | ||
*/ | ||
/** @default "pages" */ | ||
pages: string, | ||
/** | ||
* The plugins directory, each file of which will be auto-registered as a Nuxt plugin. | ||
* | ||
* @default "plugins" | ||
*/ | ||
/** @default "plugins" */ | ||
plugins: string, | ||
/** | ||
* 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. | ||
* | ||
* @default "public" | ||
*/ | ||
/** @default "public" */ | ||
public: string, | ||
@@ -711,107 +194,20 @@ | ||
/** | ||
* The extensions that should be resolved by the Nuxt resolver. | ||
* | ||
* @default [".js",".jsx",".mjs",".ts",".tsx",".vue"] | ||
*/ | ||
/** @default [".js",".jsx",".mjs",".ts",".tsx",".vue"] */ | ||
extensions: Array<string>, | ||
/** | ||
* You can improve your DX by defining additional aliases to access custom directories within your JavaScript and CSS. | ||
* | ||
* | ||
* @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access | ||
* your alias by prefixing it with `~`. | ||
* | ||
* @note These aliases will be automatically added to the generated `.nuxt/tsconfig.json` so you can get full | ||
* type support and path auto-complete. In case you need to extend options provided by `./.nuxt/tsconfig.json` | ||
* further, make sure to add them here or within the `typescript.tsConfig` property in `nuxt.config`. | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* alias: { | ||
* 'images': fileURLToPath(new URL('./assets/images', import.meta.url)), | ||
* 'style': fileURLToPath(new URL('./assets/style', import.meta.url)), | ||
* 'data': fileURLToPath(new URL('./assets/other/data', import.meta.url)) | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* ```html | ||
* <template> | ||
* <img src="~images/main-bg.jpg"> | ||
* </template> | ||
* | ||
* <script> | ||
* import data from 'data/test.json' | ||
* </script> | ||
* | ||
* <style> | ||
* // Uncomment the below | ||
* //@import '~style/variables.scss'; | ||
* //@import '~style/utils.scss'; | ||
* //@import '~style/base.scss'; | ||
* body { | ||
* background-image: url('~images/main-bg.jpg'); | ||
* } | ||
* </style> | ||
* ``` | ||
*/ | ||
alias: Record<string, string>, | ||
/** | ||
* Pass options directly to `node-ignore` (which is used by Nuxt to ignore files). | ||
* | ||
* | ||
* @see [node-ignore](https://github.com/kaelzhang/node-ignore) | ||
* | ||
* @example | ||
* ```js | ||
* ignoreOptions: { | ||
* ignorecase: false | ||
* } | ||
* ``` | ||
*/ | ||
ignoreOptions: any, | ||
/** | ||
* Any file in `pages/`, `layouts/`, `middleware/` or `store/` will be ignored during building if its filename starts with the prefix specified by `ignorePrefix`. | ||
* | ||
* @default "-" | ||
*/ | ||
/** @default "-" */ | ||
ignorePrefix: string, | ||
/** | ||
* More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building. | ||
* | ||
* @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","**\/-*.*"] | ||
*/ | ||
/** @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","**\/-*.*"] */ | ||
ignore: Array<string>, | ||
/** | ||
* The watch property lets you define patterns that will restart the Nuxt dev server when changed. | ||
* | ||
* It is an array of strings or regular expressions. Strings should be either absolute paths or relative to the `srcDir` (and the `srcDir` of any layers). Regular expressions will be matched against the path relative to the project `srcDir` (and the `srcDir` of any layers). | ||
* | ||
*/ | ||
watch: Array<string | RegExp>, | ||
/** | ||
* The watchers property lets you overwrite watchers configuration in your `nuxt.config`. | ||
* | ||
*/ | ||
watchers: { | ||
/** | ||
* An array of event types, which, when received, will cause the watcher to restart. | ||
* | ||
*/ | ||
rewatchOnRawEvents: any, | ||
/** | ||
* `watchOptions` to pass directly to webpack. | ||
* | ||
* | ||
* @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions). | ||
*/ | ||
webpack: { | ||
@@ -822,8 +218,2 @@ /** @default 1000 */ | ||
/** | ||
* Options to pass directly to `chokidar`. | ||
* | ||
* | ||
* @see [chokidar](https://github.com/paulmillr/chokidar#api) | ||
*/ | ||
chokidar: { | ||
@@ -835,107 +225,20 @@ /** @default true */ | ||
/** | ||
* Hooks are listeners to Nuxt events that are typically used in modules, but are also available in `nuxt.config`. | ||
* | ||
* Internally, hooks follow a naming pattern using colons (e.g., build:done). | ||
* For ease of configuration, you can also structure them as an hierarchical object in `nuxt.config` (as below). | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* import fs from 'node:fs' | ||
* import path from 'node:path' | ||
* export default { | ||
* hooks: { | ||
* build: { | ||
* done(builder) { | ||
* const extraFilePath = path.join( | ||
* builder.nuxt.options.buildDir, | ||
* 'extra-file' | ||
* ) | ||
* fs.writeFileSync(extraFilePath, 'Something extra') | ||
* } | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
hooks: NuxtHooks, | ||
/** | ||
* Runtime config allows passing dynamic config and environment variables to the Nuxt app context. | ||
* | ||
* The value of this object is accessible from server only using `useRuntimeConfig`. | ||
* It mainly should hold _private_ configuration which is not exposed on the frontend. This could include a reference to your API secret tokens. | ||
* Anything under `public` and `app` will be exposed to the frontend as well. | ||
* Values are automatically replaced by matching env variables at runtime, e.g. setting an environment variable `NUXT_API_KEY=my-api-key NUXT_PUBLIC_BASE_URL=/foo/` would overwrite the two values in the example below. | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* runtimeConfig: { | ||
* apiKey: '' // Default to an empty string, automatically set at runtime using process.env.NUXT_API_KEY | ||
* public: { | ||
* baseURL: '' // Exposed to the frontend as well. | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
runtimeConfig: RuntimeConfig, | ||
/** | ||
* Additional app configuration | ||
* | ||
* For programmatic usage and type support, you can directly provide app config with this option. It will be merged with `app.config` file as default value. | ||
* | ||
*/ | ||
appConfig: AppConfig, | ||
devServer: { | ||
/** | ||
* Whether to enable HTTPS. | ||
* | ||
* @default false | ||
* | ||
* @example | ||
* ``` | ||
* export default defineNuxtConfig({ | ||
* devServer: { | ||
* https: { | ||
* key: './server.key', | ||
* cert: './server.crt' | ||
* } | ||
* } | ||
* }) | ||
* ``` | ||
*/ | ||
/** @default false */ | ||
https: boolean | { key: string; cert: string }, | ||
/** | ||
* Dev server listening port | ||
* | ||
* @default 3000 | ||
*/ | ||
/** @default 3000 */ | ||
port: number, | ||
/** | ||
* Dev server listening host | ||
* | ||
*/ | ||
host: any, | ||
/** | ||
* Listening dev server URL. | ||
* | ||
* This should not be set directly as it will always be overridden by the dev server with the full URL (for module and internal use). | ||
* | ||
* @default "http://localhost:3000" | ||
*/ | ||
/** @default "http://localhost:3000" */ | ||
url: string, | ||
/** | ||
* Template to show a loading screen | ||
* | ||
*/ | ||
loadingTemplate: (data: { loading?: string }) => string, | ||
@@ -945,261 +248,89 @@ }, | ||
experimental: { | ||
/** | ||
* Set to true to generate an async entry point for the Vue bundle (for module federation support). | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
asyncEntry: boolean, | ||
/** | ||
* Enable Vue's reactivity transform | ||
* | ||
* @default false | ||
* | ||
* @see [Vue Reactivity Transform Docs](https://vuejs.org/guide/extras/reactivity-transform.html) | ||
* | ||
* Warning: Reactivity transform feature has been marked as deprecated in Vue 3.3 and is planned to be | ||
* removed from core in Vue 3.4. | ||
* | ||
* @see [Vue RFC#369](https://github.com/vuejs/rfcs/discussions/369#discussioncomment-5059028) | ||
*/ | ||
/** @default false */ | ||
reactivityTransform: boolean, | ||
/** | ||
* Externalize `vue`, `@vue/*` and `vue-router` when building. | ||
* | ||
* @default true | ||
* | ||
* @see [Nuxt Issue #13632](https://github.com/nuxt/nuxt/issues/13632) | ||
*/ | ||
/** @default true */ | ||
externalVue: boolean, | ||
/** | ||
* Tree shakes contents of client-only components from server bundle. | ||
* | ||
* @default true | ||
* | ||
* @see [Nuxt PR #5750](https://github.com/nuxt/framework/pull/5750) | ||
*/ | ||
/** @default true */ | ||
treeshakeClientOnly: boolean, | ||
/** | ||
* Emit `app:chunkError` hook when there is an error loading vite/webpack chunks. | ||
* | ||
* By default, Nuxt will also perform a hard reload of the new route when a chunk fails to load when navigating to a new route. | ||
* You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`. | ||
* | ||
* @default "automatic" | ||
* | ||
* @see [Nuxt PR #19038](https://github.com/nuxt/nuxt/pull/19038) | ||
*/ | ||
/** @default "automatic" */ | ||
emitRouteChunkError: false | 'manual' | 'automatic', | ||
/** | ||
* By default the route object returned by the auto-imported `useRoute()` composable is kept in sync with the current page in view in `<NuxtPage>`. This is not true for `vue-router`'s exported `useRoute` or for the default `$route` object available in your Vue templates. | ||
* | ||
* By enabling this option a mixin will be injected to keep the `$route` template object in sync with Nuxt's managed `useRoute()`. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
templateRouteInjection: boolean, | ||
/** | ||
* Whether to restore Nuxt app state from `sessionStorage` when reloading the page after a chunk error or manual `reloadNuxtApp()` call. | ||
* | ||
* To avoid hydration errors, it will be applied only after the Vue app has been mounted, meaning there may be a flicker on initial load. | ||
* Consider carefully before enabling this as it can cause unexpected behavior, and consider providing explicit keys to `useState` as auto-generated keys may not match across builds. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
restoreState: boolean, | ||
/** | ||
* Inline styles when rendering HTML (currently vite only). | ||
* | ||
* You can also pass a function that receives the path of a Vue component and returns a boolean indicating whether to inline the styles for that component. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
inlineSSRStyles: boolean | ((id?: string) => boolean), | ||
/** | ||
* Turn off rendering of Nuxt scripts and JS resource hints. You can also disable scripts more granularly within `routeRules`. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
noScripts: boolean, | ||
/** | ||
* Render JSON payloads with support for revivifying complex types. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
renderJsonPayloads: boolean, | ||
/** | ||
* Disable vue server renderer endpoint within nitro. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
noVueServer: boolean, | ||
/** | ||
* When this option is enabled (by default) payload of pages that are prerendered are extracted | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
payloadExtraction: boolean | undefined, | ||
/** | ||
* Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client if there's an error in SSR. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
clientFallback: boolean, | ||
/** | ||
* Enable cross-origin prefetch using the Speculation Rules API. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
crossOriginPrefetch: boolean, | ||
/** | ||
* Enable View Transition API integration with client-side router. | ||
* | ||
* @default false | ||
* | ||
* @see [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions) | ||
*/ | ||
/** @default false */ | ||
viewTransition: boolean, | ||
/** | ||
* Write early hints when using node server. | ||
* | ||
* @default false | ||
* | ||
* @note nginx does not support 103 Early hints in the current version. | ||
*/ | ||
/** @default false */ | ||
writeEarlyHints: boolean, | ||
/** | ||
* Experimental component islands support with <NuxtIsland> and .island.vue files. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
componentIslands: true | 'local' | 'local+remote' | false, | ||
/** | ||
* Config schema support | ||
* | ||
* @default true | ||
* | ||
* @see [Nuxt Issue #15592](https://github.com/nuxt/nuxt/issues/15592) | ||
*/ | ||
/** @default true */ | ||
configSchema: boolean, | ||
/** | ||
* This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting for frameworks like Nuxt and Vite. | ||
* | ||
* It improves type support when using modern libraries with `exports`. | ||
* This is only not enabled by default because it could be a breaking change for some projects. | ||
* See https://github.com/microsoft/TypeScript/pull/51669 | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
typescriptBundlerResolution: boolean, | ||
/** | ||
* Whether or not to add a compatibility layer for modules, plugins or user code relying on the old `@vueuse/head` API. | ||
* | ||
* This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
polyfillVueUseHead: boolean, | ||
/** | ||
* Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
respectNoSSRHeader: boolean, | ||
/** | ||
* Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to their layer source and root directories. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
localLayerAliases: boolean, | ||
/** | ||
* Enable the new experimental typed router using [unplugin-vue-router](https://github.com/posva/unplugin-vue-router). | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
typedPages: boolean, | ||
/** | ||
* Use app manifests to respect route rules on client-side. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
appManifest: boolean, | ||
/** | ||
* Set an alternative watcher that will be used as the watching service for Nuxt. | ||
* | ||
* Nuxt uses 'chokidar-granular' by default, which will ignore top-level directories (like `node_modules` and `.git`) that are excluded from watching. | ||
* You can set this instead to `parcel` to use `@parcel/watcher`, which may improve performance in large projects or on Windows platforms. | ||
* You can also set this to `chokidar` to watch all files in your source directory. | ||
* | ||
* @default "chokidar-granular" | ||
* | ||
* @see [chokidar](https://github.com/paulmillr/chokidar) | ||
* | ||
* @see [Parcel watcher](https://github.com/parcel-bundler/watcher) | ||
*/ | ||
/** @default "chokidar-granular" */ | ||
watcher: 'chokidar' | 'parcel' | 'chokidar-granular', | ||
/** | ||
* Enable native async context to be accessible for nested composables | ||
* | ||
* @default false | ||
* | ||
* @see [Nuxt PR #20918](https://github.com/nuxt/nuxt/pull/20918) | ||
*/ | ||
/** @default false */ | ||
asyncContext: boolean, | ||
/** | ||
* Use new experimental head optimisations: - Add the capo.js head plugin in order to render tags in of the head in a more performant way. - Uses the hash hydration plugin to reduce initial hydration | ||
* | ||
* @default false | ||
* | ||
* @see [Nuxt Discussion #22632](https://github.com/nuxt/nuxt/discussions/22632] | ||
*/ | ||
/** @default false */ | ||
headNext: boolean, | ||
/** | ||
* Allow defining `routeRules` directly within your `~/pages` directory using `defineRouteRules`. | ||
* | ||
* Rules are converted (based on the path) and applied for server requests. For example, a rule defined in `~/pages/foo/bar.vue` will be applied to `/foo/bar` requests. A rule in `~/pages/foo/[id].vue` will be applied to `/foo/**` requests. | ||
* For more control, such as if you are using a custom `path` or `alias` set in the page's `definePageMeta`, you should set `routeRules` directly within your `nuxt.config`. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
inlineRouteRules: boolean, | ||
/** | ||
* This allows specifying the default options for core Nuxt components and composables. | ||
* | ||
* These options will likely be moved elsewhere in the future, such as into `app.config` or into the `app/` directory. | ||
* | ||
*/ | ||
defaults: { | ||
nuxtLink: NuxtLinkOptions, | ||
/** | ||
* Options that apply to `useAsyncData` (and also therefore `useFetch`) | ||
* | ||
*/ | ||
useAsyncData: { | ||
@@ -1215,163 +346,50 @@ /** @default true */ | ||
generate: { | ||
/** | ||
* The routes to generate. | ||
* | ||
* If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes. | ||
* It is preferred to use `nitro.prerender.routes`. | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* routes: ['/users/1', '/users/2', '/users/3'] | ||
* ``` | ||
*/ | ||
routes: string | string[], | ||
/** | ||
* This option is no longer used. Instead, use `nitro.prerender.ignore`. | ||
* | ||
* | ||
* @deprecated | ||
*/ | ||
exclude: Array<any>, | ||
}, | ||
/** | ||
* @default 3 | ||
* | ||
* @private | ||
*/ | ||
/** @default 3 */ | ||
_majorVersion: number, | ||
/** | ||
* @default false | ||
* | ||
* @private | ||
*/ | ||
/** @default false */ | ||
_legacyGenerate: boolean, | ||
/** | ||
* @default false | ||
* | ||
* @private | ||
*/ | ||
/** @default false */ | ||
_start: boolean, | ||
/** | ||
* @default false | ||
* | ||
* @private | ||
*/ | ||
/** @default false */ | ||
_build: boolean, | ||
/** | ||
* @default false | ||
* | ||
* @private | ||
*/ | ||
/** @default false */ | ||
_generate: boolean, | ||
/** | ||
* @default false | ||
* | ||
* @private | ||
*/ | ||
/** @default false */ | ||
_prepare: boolean, | ||
/** | ||
* @default false | ||
* | ||
* @private | ||
*/ | ||
/** @default false */ | ||
_cli: boolean, | ||
/** | ||
* | ||
* @private | ||
*/ | ||
_requiredModules: any, | ||
/** | ||
* | ||
* @private | ||
*/ | ||
_nuxtConfigFile: any, | ||
/** | ||
* | ||
* @private | ||
*/ | ||
_nuxtConfigFiles: Array<any>, | ||
/** | ||
* @default "" | ||
* | ||
* @private | ||
*/ | ||
/** @default "" */ | ||
appDir: string, | ||
/** | ||
* | ||
* @private | ||
*/ | ||
_installedModules: Array<any>, | ||
/** | ||
* | ||
* @private | ||
*/ | ||
_modules: Array<any>, | ||
/** | ||
* Configuration for Nitro. | ||
* | ||
* | ||
* @see https://nitro.unjs.io/config/ | ||
*/ | ||
nitro: NitroConfig, | ||
/** | ||
* Global route options applied to matching server routes. | ||
* | ||
* | ||
* @experimental This is an experimental feature and API may change in the future. | ||
* | ||
* @see https://nitro.unjs.io/config/#routerules | ||
*/ | ||
routeRules: NitroConfig['routeRules'], | ||
/** | ||
* Nitro server handlers. | ||
* | ||
* Each handler accepts the following options: - handler: The path to the file defining the handler. - route: The route under which the handler is available. This follows the conventions of https://github.com/unjs/radix3. - method: The HTTP method of requests that should be handled. - middleware: Specifies whether it is a middleware handler. - lazy: Specifies whether to use lazy loading to import the handler. | ||
* | ||
* | ||
* @see https://nuxt.com/docs/guide/directory-structure/server | ||
* | ||
* @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt. | ||
* | ||
* @example | ||
* ```js | ||
* serverHandlers: [ | ||
* { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' } | ||
* ] | ||
* ``` | ||
*/ | ||
serverHandlers: NitroEventHandler[], | ||
/** | ||
* Nitro development-only server handlers. | ||
* | ||
* | ||
* @see https://nitro.unjs.io/guide/routing | ||
*/ | ||
devServerHandlers: NitroDevEventHandler[], | ||
postcss: { | ||
/** | ||
* Options for configuring PostCSS plugins. | ||
* | ||
* https://postcss.org/ | ||
* | ||
*/ | ||
plugins: Record<string, any> & { autoprefixer?: any; cssnano?: any }, | ||
@@ -1381,187 +399,40 @@ }, | ||
router: { | ||
/** | ||
* Additional options passed to `vue-router`. | ||
* | ||
* Note: Only JSON serializable options should be passed by nuxt config. | ||
* For more control, you can use `app/router.options.ts` file. | ||
* | ||
* | ||
* @see [documentation](https://router.vuejs.org/api/interfaces/routeroptions.html). | ||
*/ | ||
options: RouterConfigSerializable, | ||
}, | ||
/** | ||
* Configuration for Nuxt's TypeScript integration. | ||
* | ||
*/ | ||
typescript: { | ||
/** | ||
* TypeScript comes with certain checks to give you more safety and analysis of your program. Once you’ve converted your codebase to TypeScript, you can start enabling these checks for greater safety. [Read More](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#getting-stricter-checks) | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
strict: boolean, | ||
/** | ||
* Which builder types to include for your project. | ||
* | ||
* By default Nuxt infers this based on your `builder` option (defaulting to 'vite') but you can either turn off builder environment types (with `false`) to handle this fully yourself, or opt for a 'shared' option. | ||
* The 'shared' option is advised for module authors, who will want to support multiple possible builders. | ||
* | ||
*/ | ||
builder: 'vite' | 'webpack' | 'shared' | false | undefined, | ||
/** | ||
* Include parent workspace in the Nuxt project. Mostly useful for themes and module authors. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
includeWorkspace: boolean, | ||
/** | ||
* Enable build-time type checking. | ||
* | ||
* If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. Requires to install `typescript` and `vue-tsc` as dev dependencies. | ||
* | ||
* @default false | ||
* | ||
* @see https://nuxt.com/docs/guide/concepts/typescript | ||
*/ | ||
/** @default false */ | ||
typeCheck: boolean | 'build', | ||
/** | ||
* You can extend generated `.nuxt/tsconfig.json` using this option. | ||
* | ||
*/ | ||
tsConfig: TSConfig, | ||
/** | ||
* Generate a `*.vue` shim. | ||
* | ||
* We recommend instead either enabling [**Take Over Mode**](https://vuejs.org/guide/typescript/overview.html#volar-takeover-mode) or adding TypeScript Vue Plugin (Volar)** 👉 [[Download](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)]. | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
shim: boolean, | ||
}, | ||
/** | ||
* Configuration that will be passed directly to Vite. | ||
* | ||
* See https://vitejs.dev/config for more information. Please note that not all vite options are supported in Nuxt. | ||
* | ||
*/ | ||
vite: ViteConfig & { $client?: ViteConfig, $server?: ViteConfig }, | ||
webpack: { | ||
/** | ||
* Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. | ||
* | ||
* 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). | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* analyze: { | ||
* analyzerMode: 'static' | ||
* } | ||
* ``` | ||
*/ | ||
analyze: boolean | { enabled?: boolean } & BundleAnalyzerPlugin.Options, | ||
/** | ||
* Enable the profiler in webpackbar. | ||
* | ||
* It is normally enabled by CLI argument `--profile`. | ||
* | ||
* @default false | ||
* | ||
* @see [webpackbar](https://github.com/unjs/webpackbar#profile). | ||
*/ | ||
/** @default false */ | ||
profile: boolean, | ||
/** | ||
* Enables Common CSS Extraction. | ||
* | ||
* Using [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) under the hood, your CSS will be extracted into separate files, usually one per component. This allows caching your CSS and JavaScript separately. | ||
* | ||
* @default true | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* webpack: { | ||
* extractCSS: true, | ||
* // or | ||
* extractCSS: { | ||
* ignoreOrder: true | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* If you want to extract all your CSS to a single file, there is a workaround for this. | ||
* However, note that it is not recommended to extract everything into a single file. | ||
* Extracting into multiple CSS files is better for caching and preload isolation. It | ||
* can also improve page performance by downloading and resolving only those resources | ||
* that are needed. | ||
* | ||
* @example | ||
* ```js | ||
* export default { | ||
* webpack: { | ||
* extractCSS: true, | ||
* optimization: { | ||
* splitChunks: { | ||
* cacheGroups: { | ||
* styles: { | ||
* name: 'styles', | ||
* test: /\.(css|vue)$/, | ||
* chunks: 'all', | ||
* enforce: true | ||
* } | ||
* } | ||
* } | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
/** @default true */ | ||
extractCSS: boolean | PluginOptions, | ||
/** | ||
* Enables CSS source map support (defaults to `true` in development). | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
cssSourceMap: boolean, | ||
/** | ||
* The polyfill library to load to provide URL and URLSearchParams. | ||
* | ||
* Defaults to `'url'` ([see package](https://www.npmjs.com/package/url)). | ||
* | ||
* @default "url" | ||
*/ | ||
/** @default "url" */ | ||
serverURLPolyfill: string, | ||
/** | ||
* Customize bundle filenames. | ||
* | ||
* To understand a bit more about the use of manifests, take a look at [this webpack documentation](https://webpack.js.org/guides/code-splitting/). | ||
* | ||
* | ||
* @note Be careful when using non-hashed based filenames in production | ||
* as most browsers will cache the asset and not detect the changes on first load. | ||
* | ||
* This example changes fancy chunk names to numerical ids: | ||
* | ||
* @example | ||
* ```js | ||
* filenames: { | ||
* chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js') | ||
* } | ||
* ``` | ||
*/ | ||
filenames: | ||
@@ -1585,56 +456,13 @@ Record< | ||
/** | ||
* Customize the options of Nuxt's integrated webpack loaders. | ||
* | ||
*/ | ||
loaders: { | ||
/** | ||
* See https://github.com/esbuild-kit/esbuild-loader | ||
* | ||
*/ | ||
esbuild: Omit<LoaderOptions, 'loader'>, | ||
/** | ||
* See: https://github.com/webpack-contrib/file-loader#options | ||
* | ||
* | ||
* @default | ||
* ```ts | ||
* { esModule: false } | ||
* ``` | ||
*/ | ||
file: Omit<Options, 'name'>, | ||
/** | ||
* See: https://github.com/webpack-contrib/file-loader#options | ||
* | ||
* | ||
* @default | ||
* ```ts | ||
* { esModule: false, limit: 1000 } | ||
* ``` | ||
*/ | ||
fontUrl: Omit<Options, 'name'>, | ||
/** | ||
* See: https://github.com/webpack-contrib/file-loader#options | ||
* | ||
* | ||
* @default | ||
* ```ts | ||
* { esModule: false, limit: 1000 } | ||
* ``` | ||
*/ | ||
imgUrl: Omit<Options, 'name'>, | ||
/** | ||
* See: https://pugjs.org/api/reference.html#options | ||
* | ||
*/ | ||
pugPlain: Options0, | ||
/** | ||
* See [vue-loader](https://github.com/vuejs/vue-loader) for available options. | ||
* | ||
*/ | ||
vue: Partial<VueLoaderOptions>, | ||
@@ -1671,33 +499,8 @@ | ||
/** | ||
* See: https://github.com/webpack-contrib/less-loader#options | ||
* | ||
*/ | ||
less: any, | ||
/** | ||
* See: https://github.com/webpack-contrib/sass-loader#options | ||
* | ||
* | ||
* @default | ||
* ```ts | ||
* { | ||
* sassOptions: { | ||
* indentedSyntax: true | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
sass: Options1, | ||
/** | ||
* See: https://github.com/webpack-contrib/sass-loader#options | ||
* | ||
*/ | ||
scss: Options1, | ||
/** | ||
* See: https://github.com/webpack-contrib/stylus-loader#options | ||
* | ||
*/ | ||
stylus: any, | ||
@@ -1708,81 +511,25 @@ | ||
/** | ||
* Add webpack plugins. | ||
* | ||
* | ||
* @example | ||
* ```js | ||
* import webpack from 'webpack' | ||
* import { version } from './package.json' | ||
* // ... | ||
* plugins: [ | ||
* new webpack.DefinePlugin({ | ||
* 'process.VERSION': version | ||
* }) | ||
* ] | ||
* ``` | ||
*/ | ||
plugins: Array<any>, | ||
/** | ||
* Hard-replaces `typeof process`, `typeof window` and `typeof document` to tree-shake bundle. | ||
* | ||
* @default false | ||
*/ | ||
/** @default false */ | ||
aggressiveCodeRemoval: boolean, | ||
/** | ||
* OptimizeCSSAssets plugin options. | ||
* | ||
* Defaults to true when `extractCSS` is enabled. | ||
* | ||
* @default false | ||
* | ||
* @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin). | ||
*/ | ||
/** @default false */ | ||
optimizeCSS: false | BasePluginOptions & DefinedDefaultMinimizerAndOptions<any>, | ||
/** | ||
* Configure [webpack optimization](https://webpack.js.org/configuration/optimization/). | ||
* | ||
*/ | ||
optimization: false | Configuration['optimization'], | ||
/** | ||
* Customize PostCSS Loader. Same options as https://github.com/webpack-contrib/postcss-loader#options | ||
* | ||
*/ | ||
postcss: { execute?: boolean, postcssOptions: ProcessOptions, sourceMap?: boolean, implementation?: any }, | ||
/** | ||
* See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options. | ||
* | ||
*/ | ||
devMiddleware: Options2<IncomingMessage, ServerResponse>, | ||
/** | ||
* See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options. | ||
* | ||
*/ | ||
hotMiddleware: MiddlewareOptions & { client?: ClientOptions }, | ||
/** | ||
* Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://github.com/nuxt/friendly-errors-webpack-plugin). | ||
* | ||
* @default true | ||
*/ | ||
/** @default true */ | ||
friendlyErrors: boolean, | ||
/** | ||
* Filters to hide build warnings. | ||
* | ||
*/ | ||
warningIgnoreFilters: Array<(warn: WebpackError) => boolean>, | ||
/** | ||
* Configure [webpack experiments](https://webpack.js.org/configuration/experiments/) | ||
* | ||
*/ | ||
experiments: false | Configuration['experiments'], | ||
}, | ||
} |
@@ -16,5 +16,3 @@ | ||
> An array of custom directories that will be auto-imported. Note that this option will not override the default directories (~/composables, ~/utils). | ||
# `pages` | ||
@@ -24,5 +22,3 @@ - **Type**: `boolean` | ||
> 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. | ||
# `telemetry` | ||
@@ -32,5 +28,3 @@ - **Type**: `boolean | Record<string, any>` | ||
> Manually disable nuxt telemetry. | ||
# `devtools` | ||
@@ -40,8 +34,3 @@ - **Type**: ` { enabled: boolean, [key: string]: any } ` | ||
> Enable Nuxt DevTools for development. | ||
Breaking changes for devtools might not reflect on the version of Nuxt. | ||
# `vue` | ||
@@ -53,5 +42,3 @@ | ||
> Options for the Vue compiler that will be passed at build time. | ||
## `runtimeCompiler` | ||
@@ -61,5 +48,3 @@ - **Type**: `boolean` | ||
> Include Vue compiler in runtime bundle. | ||
## `propsDestructure` | ||
@@ -69,5 +54,3 @@ - **Type**: `boolean` | ||
> Vue Experimental: Enable reactive destructure for `defineProps` | ||
## `defineModel` | ||
@@ -77,5 +60,3 @@ - **Type**: `boolean` | ||
> Vue Experimental: Enable macro `defineModel` | ||
# `app` | ||
@@ -87,8 +68,3 @@ | ||
> The base path of your Nuxt application. | ||
This can be set at runtime by setting the NUXT_APP_BASE_URL environment variable. | ||
## `buildAssetsDir` | ||
@@ -98,5 +74,3 @@ - **Type**: `string` | ||
> 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. | ||
## `cdnURL` | ||
@@ -106,8 +80,3 @@ - **Type**: `string` | ||
> An absolute URL to serve the public folder from (production-only). | ||
This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. | ||
## `head` | ||
@@ -119,8 +88,3 @@ | ||
> Default values for layout transitions. | ||
This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed. | ||
## `pageTransition` | ||
@@ -130,8 +94,3 @@ - **Type**: `SrcTypesConfigNuxtAppConfig['pageTransition']` | ||
> Default values for page transitions. | ||
This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed. | ||
## `keepalive` | ||
@@ -141,8 +100,3 @@ - **Type**: `SrcTypesConfigNuxtAppConfig['keepalive']` | ||
> Default values for KeepAlive configuration between pages. | ||
This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed. | ||
## `rootId` | ||
@@ -152,5 +106,3 @@ - **Type**: `string | false` | ||
> Customize Nuxt root element id. | ||
## `rootTag` | ||
@@ -160,5 +112,3 @@ - **Type**: `string` | ||
> Customize Nuxt root element tag. | ||
# `spaLoadingTemplate` | ||
@@ -168,8 +118,3 @@ - **Type**: `string | boolean` | ||
> Boolean or a path to an HTML file with the contents of which will be inserted into any HTML page rendered with `ssr: false`. - If it is unset, it will use `~/app/spa-loading-template.html` 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 or a default Nuxt image will be used. | ||
Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners). | ||
# `plugins` | ||
@@ -179,9 +124,3 @@ - **Type**: `(SrcTypesNuxtNuxtPlugin | string)[]` | ||
> An array of nuxt app plugins. | ||
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. | ||
It can also be an object with `src` and `mode` keys. | ||
# `css` | ||
@@ -191,8 +130,3 @@ - **Type**: `string[]` | ||
> You can define the CSS files/modules/libraries you want to set globally (included in every page). | ||
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. | ||
# `builder` | ||
@@ -202,5 +136,3 @@ - **Type**: `'vite' | 'webpack' | { bundle: (nuxt: SrcTypesNuxtNuxt) => Promise<void> }` | ||
> The builder to use for bundling the Vue part of your application. | ||
# `sourcemap` | ||
@@ -212,8 +144,3 @@ | ||
> Log level when building logs. | ||
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 | ||
# `build` | ||
@@ -225,8 +152,3 @@ | ||
> 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. | ||
You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }). | ||
## `templates` | ||
@@ -236,8 +158,3 @@ - **Type**: `SrcTypesNuxtNuxtTemplate<any>[]` | ||
> You can provide your own templates which will be rendered based on Nuxt configuration. This feature is specially useful for using with modules. | ||
Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template). | ||
## `analyze` | ||
@@ -251,9 +168,3 @@ | ||
> Functions to inject a key for. | ||
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. | ||
The key will be unique based on the location of the function being invoked within the file. | ||
## `treeShake` | ||
@@ -295,9 +206,3 @@ | ||
> Extend project from multiple local or remote sources. | ||
Value should be either a string or array of strings pointing to source directories or config path relative to current config. | ||
You can use `github:`, `gh:` `gitlab:` or `bitbucket:`. | ||
# `theme` | ||
@@ -307,9 +212,3 @@ - **Type**: `string` | ||
> Extend project from a local or remote source. | ||
Value should be a string pointing to source directory or config path relative to current config. | ||
You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. | ||
# `rootDir` | ||
@@ -319,9 +218,3 @@ - **Type**: `string` | ||
> Define the root directory of your application. | ||
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. | ||
It is normally not needed to configure this option. | ||
# `workspaceDir` | ||
@@ -331,9 +224,3 @@ - **Type**: `string` | ||
> Define the workspace directory of your application. | ||
Often this is used when in a monorepo setup. Nuxt will attempt to detect your workspace directory automatically, but you can override it here. | ||
It is normally not needed to configure this option. | ||
# `srcDir` | ||
@@ -343,8 +230,3 @@ - **Type**: `string` | ||
> Define the source directory of your Nuxt application. | ||
If a relative path is specified, it will be relative to the `rootDir`. | ||
# `serverDir` | ||
@@ -354,8 +236,3 @@ - **Type**: `string` | ||
> Define the server directory of your Nuxt application, where Nitro routes, middleware and plugins are kept. | ||
If a relative path is specified, it will be relative to your `rootDir`. | ||
# `buildDir` | ||
@@ -365,8 +242,3 @@ - **Type**: `string` | ||
> Define the directory where your built Nuxt files will be placed. | ||
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. | ||
# `modulesDir` | ||
@@ -376,9 +248,3 @@ - **Type**: `array` | ||
> Used to set the modules directories for path resolving (for example, webpack's `resolveLoading`, `nodeExternals` and `postcss`). | ||
The configuration path is relative to `options.rootDir` (default is current working directory). | ||
Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository. | ||
# `analyzeDir` | ||
@@ -388,8 +254,3 @@ - **Type**: `string` | ||
> The directory where Nuxt will store the generated files when running `nuxt analyze`. | ||
If a relative path is specified, it will be relative to your `rootDir`. | ||
# `dev` | ||
@@ -399,8 +260,3 @@ - **Type**: `boolean` | ||
> Whether Nuxt is running in development mode. | ||
Normally, you should not need to set this. | ||
# `test` | ||
@@ -410,5 +266,3 @@ - **Type**: `boolean` | ||
> Whether your app is being unit tested. | ||
# `debug` | ||
@@ -418,8 +272,3 @@ - **Type**: `boolean` | ||
> Set to `true` to enable debug mode. | ||
At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser. | ||
# `ssr` | ||
@@ -429,5 +278,3 @@ - **Type**: `boolean` | ||
> 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. | ||
# `modules` | ||
@@ -437,9 +284,3 @@ - **Type**: `(SrcTypesModuleNuxtModule | string | [SrcTypesModuleNuxtModule | string, Record<string, any>] | undefined | null | false)[]` | ||
> Modules are Nuxt extensions which can extend its core functionality and add endless integrations. | ||
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. | ||
Nuxt 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. | ||
# `dir` | ||
@@ -451,5 +292,3 @@ | ||
> The assets directory (aliased as `~assets` in your build). | ||
## `layouts` | ||
@@ -459,5 +298,3 @@ - **Type**: `string` | ||
> The layouts directory, each file of which will be auto-registered as a Nuxt layout. | ||
## `middleware` | ||
@@ -467,5 +304,3 @@ - **Type**: `string` | ||
> The middleware directory, each file of which will be auto-registered as a Nuxt middleware. | ||
## `modules` | ||
@@ -475,5 +310,3 @@ - **Type**: `string` | ||
> The modules directory, each file in which will be auto-registered as a Nuxt module. | ||
## `pages` | ||
@@ -483,5 +316,3 @@ - **Type**: `string` | ||
> The directory which will be processed to auto-generate your application page routes. | ||
## `plugins` | ||
@@ -491,5 +322,3 @@ - **Type**: `string` | ||
> The plugins directory, each file of which will be auto-registered as a Nuxt plugin. | ||
## `public` | ||
@@ -499,5 +328,3 @@ - **Type**: `string` | ||
> 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. | ||
## `static` | ||
@@ -512,5 +339,3 @@ - **Type**: `string` | ||
> The extensions that should be resolved by the Nuxt resolver. | ||
# `alias` | ||
@@ -522,5 +347,3 @@ | ||
> Pass options directly to `node-ignore` (which is used by Nuxt to ignore files). | ||
# `ignorePrefix` | ||
@@ -530,5 +353,3 @@ - **Type**: `string` | ||
> Any file in `pages/`, `layouts/`, `middleware/` or `store/` will be ignored during building if its filename starts with the prefix specified by `ignorePrefix`. | ||
# `ignore` | ||
@@ -538,5 +359,3 @@ - **Type**: `array` | ||
> More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building. | ||
# `watch` | ||
@@ -546,8 +365,3 @@ - **Type**: `Array<string | RegExp>` | ||
> The watch property lets you define patterns that will restart the Nuxt dev server when changed. | ||
It is an array of strings or regular expressions. Strings should be either absolute paths or relative to the `srcDir` (and the `srcDir` of any layers). Regular expressions will be matched against the path relative to the project `srcDir` (and the `srcDir` of any layers). | ||
# `watchers` | ||
@@ -559,5 +373,3 @@ | ||
> An array of event types, which, when received, will cause the watcher to restart. | ||
## `webpack` | ||
@@ -581,9 +393,3 @@ | ||
> Hooks are listeners to Nuxt events that are typically used in modules, but are also available in `nuxt.config`. | ||
Internally, hooks follow a naming pattern using colons (e.g., build:done). | ||
For ease of configuration, you can also structure them as an hierarchical object in `nuxt.config` (as below). | ||
# `runtimeConfig` | ||
@@ -604,5 +410,3 @@ | ||
> Whether to enable HTTPS. | ||
## `port` | ||
@@ -612,5 +416,3 @@ - **Type**: `number` | ||
> Dev server listening port | ||
## `host` | ||
@@ -620,5 +422,3 @@ - **Type**: `any` | ||
> Dev server listening host | ||
## `url` | ||
@@ -628,8 +428,3 @@ - **Type**: `string` | ||
> Listening dev server URL. | ||
This should not be set directly as it will always be overridden by the dev server with the full URL (for module and internal use). | ||
## `loadingTemplate` | ||
@@ -639,4 +434,2 @@ - **Type**: `(data: { loading?: string }) => string` | ||
> Template to show a loading screen | ||
```ts | ||
@@ -653,5 +446,3 @@ () => any | ||
> Set to true to generate an async entry point for the Vue bundle (for module federation support). | ||
## `reactivityTransform` | ||
@@ -661,5 +452,3 @@ - **Type**: `boolean` | ||
> Enable Vue's reactivity transform | ||
## `externalVue` | ||
@@ -669,5 +458,3 @@ - **Type**: `boolean` | ||
> Externalize `vue`, `@vue/*` and `vue-router` when building. | ||
## `treeshakeClientOnly` | ||
@@ -677,5 +464,3 @@ - **Type**: `boolean` | ||
> Tree shakes contents of client-only components from server bundle. | ||
## `emitRouteChunkError` | ||
@@ -685,9 +470,3 @@ - **Type**: `false | 'manual' | 'automatic'` | ||
> Emit `app:chunkError` hook when there is an error loading vite/webpack chunks. | ||
By default, Nuxt will also perform a hard reload of the new route when a chunk fails to load when navigating to a new route. | ||
You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`. | ||
## `templateRouteInjection` | ||
@@ -697,8 +476,3 @@ - **Type**: `boolean` | ||
> By default the route object returned by the auto-imported `useRoute()` composable is kept in sync with the current page in view in `<NuxtPage>`. This is not true for `vue-router`'s exported `useRoute` or for the default `$route` object available in your Vue templates. | ||
By enabling this option a mixin will be injected to keep the `$route` template object in sync with Nuxt's managed `useRoute()`. | ||
## `restoreState` | ||
@@ -708,9 +482,3 @@ - **Type**: `boolean` | ||
> Whether to restore Nuxt app state from `sessionStorage` when reloading the page after a chunk error or manual `reloadNuxtApp()` call. | ||
To avoid hydration errors, it will be applied only after the Vue app has been mounted, meaning there may be a flicker on initial load. | ||
Consider carefully before enabling this as it can cause unexpected behavior, and consider providing explicit keys to `useState` as auto-generated keys may not match across builds. | ||
## `inlineSSRStyles` | ||
@@ -720,8 +488,3 @@ - **Type**: `boolean | ((id?: string) => boolean)` | ||
> Inline styles when rendering HTML (currently vite only). | ||
You can also pass a function that receives the path of a Vue component and returns a boolean indicating whether to inline the styles for that component. | ||
## `noScripts` | ||
@@ -731,5 +494,3 @@ - **Type**: `boolean` | ||
> Turn off rendering of Nuxt scripts and JS resource hints. You can also disable scripts more granularly within `routeRules`. | ||
## `renderJsonPayloads` | ||
@@ -739,5 +500,3 @@ - **Type**: `boolean` | ||
> Render JSON payloads with support for revivifying complex types. | ||
## `noVueServer` | ||
@@ -747,5 +506,3 @@ - **Type**: `boolean` | ||
> Disable vue server renderer endpoint within nitro. | ||
## `payloadExtraction` | ||
@@ -755,5 +512,3 @@ - **Type**: `boolean | undefined` | ||
> When this option is enabled (by default) payload of pages that are prerendered are extracted | ||
## `clientFallback` | ||
@@ -763,5 +518,3 @@ - **Type**: `boolean` | ||
> Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client if there's an error in SSR. | ||
## `crossOriginPrefetch` | ||
@@ -771,5 +524,3 @@ - **Type**: `boolean` | ||
> Enable cross-origin prefetch using the Speculation Rules API. | ||
## `viewTransition` | ||
@@ -779,5 +530,3 @@ - **Type**: `boolean` | ||
> Enable View Transition API integration with client-side router. | ||
## `writeEarlyHints` | ||
@@ -787,5 +536,3 @@ - **Type**: `boolean` | ||
> Write early hints when using node server. | ||
## `componentIslands` | ||
@@ -795,5 +542,3 @@ - **Type**: `true | 'local' | 'local+remote' | false` | ||
> Experimental component islands support with <NuxtIsland> and .island.vue files. | ||
## `configSchema` | ||
@@ -803,5 +548,3 @@ - **Type**: `boolean` | ||
> Config schema support | ||
## `typescriptBundlerResolution` | ||
@@ -811,10 +554,3 @@ - **Type**: `boolean` | ||
> This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting for frameworks like Nuxt and Vite. | ||
It improves type support when using modern libraries with `exports`. | ||
This is only not enabled by default because it could be a breaking change for some projects. | ||
See https://github.com/microsoft/TypeScript/pull/51669 | ||
## `polyfillVueUseHead` | ||
@@ -824,8 +560,3 @@ - **Type**: `boolean` | ||
> Whether or not to add a compatibility layer for modules, plugins or user code relying on the old `@vueuse/head` API. | ||
This can be disabled for most Nuxt sites to reduce the client-side bundle by ~0.5kb. | ||
## `respectNoSSRHeader` | ||
@@ -835,5 +566,3 @@ - **Type**: `boolean` | ||
> Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header. | ||
## `localLayerAliases` | ||
@@ -843,5 +572,3 @@ - **Type**: `boolean` | ||
> Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to their layer source and root directories. | ||
## `typedPages` | ||
@@ -851,5 +578,3 @@ - **Type**: `boolean` | ||
> Enable the new experimental typed router using [unplugin-vue-router](https://github.com/posva/unplugin-vue-router). | ||
## `appManifest` | ||
@@ -859,5 +584,3 @@ - **Type**: `boolean` | ||
> Use app manifests to respect route rules on client-side. | ||
## `watcher` | ||
@@ -867,10 +590,3 @@ - **Type**: `'chokidar' | 'parcel' | 'chokidar-granular'` | ||
> Set an alternative watcher that will be used as the watching service for Nuxt. | ||
Nuxt uses 'chokidar-granular' by default, which will ignore top-level directories (like `node_modules` and `.git`) that are excluded from watching. | ||
You can set this instead to `parcel` to use `@parcel/watcher`, which may improve performance in large projects or on Windows platforms. | ||
You can also set this to `chokidar` to watch all files in your source directory. | ||
## `asyncContext` | ||
@@ -880,5 +596,3 @@ - **Type**: `boolean` | ||
> Enable native async context to be accessible for nested composables | ||
## `headNext` | ||
@@ -888,5 +602,3 @@ - **Type**: `boolean` | ||
> Use new experimental head optimisations: - Add the capo.js head plugin in order to render tags in of the head in a more performant way. - Uses the hash hydration plugin to reduce initial hydration | ||
## `inlineRouteRules` | ||
@@ -896,9 +608,3 @@ - **Type**: `boolean` | ||
> Allow defining `routeRules` directly within your `~/pages` directory using `defineRouteRules`. | ||
Rules are converted (based on the path) and applied for server requests. For example, a rule defined in `~/pages/foo/bar.vue` will be applied to `/foo/bar` requests. A rule in `~/pages/foo/[id].vue` will be applied to `/foo/**` requests. | ||
For more control, such as if you are using a custom `path` or `alias` set in the page's `definePageMeta`, you should set `routeRules` directly within your `nuxt.config`. | ||
## `defaults` | ||
@@ -931,9 +637,3 @@ | ||
> The routes to generate. | ||
If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes. | ||
It is preferred to use `nitro.prerender.routes`. | ||
## `exclude` | ||
@@ -943,5 +643,3 @@ - **Type**: `array` | ||
> This option is no longer used. Instead, use `nitro.prerender.ignore`. | ||
# `_majorVersion` | ||
@@ -1020,5 +718,3 @@ - **Type**: `number` | ||
> Global route options applied to matching server routes. | ||
# `serverHandlers` | ||
@@ -1028,8 +724,3 @@ - **Type**: `NitropackNitroEventHandler[]` | ||
> Nitro server handlers. | ||
Each handler accepts the following options: - handler: The path to the file defining the handler. - route: The route under which the handler is available. This follows the conventions of https://github.com/unjs/radix3. - method: The HTTP method of requests that should be handled. - middleware: Specifies whether it is a middleware handler. - lazy: Specifies whether to use lazy loading to import the handler. | ||
# `devServerHandlers` | ||
@@ -1039,5 +730,3 @@ - **Type**: `NitropackNitroDevEventHandler[]` | ||
> Nitro development-only server handlers. | ||
# `postcss` | ||
@@ -1051,5 +740,3 @@ | ||
> https://github.com/postcss/autoprefixer | ||
### `cssnano` | ||
@@ -1063,9 +750,3 @@ | ||
> Additional options passed to `vue-router`. | ||
Note: Only JSON serializable options should be passed by nuxt config. | ||
For more control, you can use `app/router.options.ts` file. | ||
# `typescript` | ||
@@ -1077,5 +758,3 @@ | ||
> TypeScript comes with certain checks to give you more safety and analysis of your program. Once you’ve converted your codebase to TypeScript, you can start enabling these checks for greater safety. [Read More](https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#getting-stricter-checks) | ||
## `builder` | ||
@@ -1085,9 +764,3 @@ - **Type**: `'vite' | 'webpack' | 'shared' | false | undefined` | ||
> Which builder types to include for your project. | ||
By default Nuxt infers this based on your `builder` option (defaulting to 'vite') but you can either turn off builder environment types (with `false`) to handle this fully yourself, or opt for a 'shared' option. | ||
The 'shared' option is advised for module authors, who will want to support multiple possible builders. | ||
## `includeWorkspace` | ||
@@ -1097,5 +770,3 @@ - **Type**: `boolean` | ||
> Include parent workspace in the Nuxt project. Mostly useful for themes and module authors. | ||
## `typeCheck` | ||
@@ -1105,8 +776,3 @@ - **Type**: `boolean | 'build'` | ||
> Enable build-time type checking. | ||
If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. Requires to install `typescript` and `vue-tsc` as dev dependencies. | ||
## `tsConfig` | ||
@@ -1118,8 +784,3 @@ | ||
> Generate a `*.vue` shim. | ||
We recommend instead either enabling [**Take Over Mode**](https://vuejs.org/guide/typescript/overview.html#volar-takeover-mode) or adding TypeScript Vue Plugin (Volar)** 👉 [[Download](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)]. | ||
# `vite` | ||
@@ -1234,8 +895,3 @@ | ||
> Enable the profiler in webpackbar. | ||
It is normally enabled by CLI argument `--profile`. | ||
## `extractCSS` | ||
@@ -1245,8 +901,3 @@ - **Type**: `boolean | MiniCssExtractPluginPluginOptions` | ||
> Enables Common CSS Extraction. | ||
Using [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) under the hood, your CSS will be extracted into separate files, usually one per component. This allows caching your CSS and JavaScript separately. | ||
## `cssSourceMap` | ||
@@ -1256,5 +907,3 @@ - **Type**: `boolean` | ||
> Enables CSS source map support (defaults to `true` in development). | ||
## `serverURLPolyfill` | ||
@@ -1264,8 +913,3 @@ - **Type**: `string` | ||
> The polyfill library to load to provide URL and URLSearchParams. | ||
Defaults to `'url'` ([see package](https://www.npmjs.com/package/url)). | ||
## `filenames` | ||
@@ -1333,5 +977,3 @@ | ||
> See https://github.com/esbuild-kit/esbuild-loader | ||
### `file` | ||
@@ -1372,5 +1014,3 @@ | ||
> See: https://pugjs.org/api/reference.html#options | ||
### `vue` | ||
@@ -1469,5 +1109,3 @@ | ||
> See: https://github.com/webpack-contrib/less-loader#options | ||
### `sass` | ||
@@ -1486,5 +1124,3 @@ | ||
> See: https://github.com/webpack-contrib/sass-loader#options | ||
### `stylus` | ||
@@ -1494,5 +1130,3 @@ - **Type**: `any` | ||
> See: https://github.com/webpack-contrib/stylus-loader#options | ||
### `vueStyle` | ||
@@ -1507,5 +1141,3 @@ - **Type**: `any` | ||
> Add webpack plugins. | ||
## `aggressiveCodeRemoval` | ||
@@ -1515,5 +1147,3 @@ - **Type**: `boolean` | ||
> Hard-replaces `typeof process`, `typeof window` and `typeof document` to tree-shake bundle. | ||
## `optimizeCSS` | ||
@@ -1523,8 +1153,3 @@ - **Type**: `false | CssMinimizerWebpackPluginBasePluginOptions & CssMinimizerWebpackPluginDefinedDefaultMinimizerAndOptions<any>` | ||
> OptimizeCSSAssets plugin options. | ||
Defaults to true when `extractCSS` is enabled. | ||
## `optimization` | ||
@@ -1541,5 +1166,3 @@ | ||
> Set minimize to `false` to disable all minimizers. (It is disabled in development by default). | ||
### `minimizer` | ||
@@ -1549,5 +1172,3 @@ - **Type**: `any` | ||
> You can set minimizer to a customized array of plugins. | ||
### `splitChunks` | ||
@@ -1592,5 +1213,3 @@ | ||
> See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options. | ||
## `friendlyErrors` | ||
@@ -1600,5 +1219,3 @@ - **Type**: `boolean` | ||
> Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://github.com/nuxt/friendly-errors-webpack-plugin). | ||
## `warningIgnoreFilters` | ||
@@ -1608,9 +1225,5 @@ - **Type**: `Array<(warn: WebpackWebpackError) => boolean>` | ||
> Filters to hide build warnings. | ||
## `experiments` | ||
- **Type**: `false | WebpackConfiguration['experiments']` | ||
- **Default**: `{}` | ||
> Configure [webpack experiments](https://webpack.js.org/configuration/experiments/) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
305236
7565