@nuxt/docs-nightly 4.2.2-29404491.1c73525a → 4.2.2-29413365.2a912219

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,13 +41,13 @@ function addServerHandler (handler: NitroEventHandler): void
41
41
 
42
42
  **handler**: A handler object with the following properties:
43
43
 
44
- | Property | Type | Required | Description |
45
- | ----------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
46
- | `handler` | `string` | `true` | Path to event handler. |
47
- | `route` | `string` | `false` | Path prefix or route. If an empty string used, will be used as a middleware. |
48
- | `middleware`| `boolean` | `false` | Specifies this is a middleware handler. Middleware are called on every route and should normally return nothing to pass to the next handlers. |
49
- | `lazy` | `boolean` | `false` | Use lazy loading to import the handler. This is useful when you only want to load the handler on demand. |
50
- | `method` | `string` | `false` | Router method matcher. If handler name contains method name, it will be used as a default value. |
44
+ | Property | Type | Required | Description |
45
+ |--------------|-----------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------|
46
+ | `handler` | `string` | `true` | Path to event handler. |
47
+ | `route` | `string` | `false` | Path prefix or route. If an empty string used, will be used as a middleware. |
48
+ | `middleware` | `boolean` | `false` | Specifies this is a middleware handler. Middleware are called on every route and should normally return nothing to pass to the next handlers. |
49
+ | `lazy` | `boolean` | `false` | Use lazy loading to import the handler. This is useful when you only want to load the handler on demand. |
50
+ | `method` | `string` | `false` | Router method matcher. If handler name contains method name, it will be used as a default value. |
51
51
 
52
52
  ### Examples
53
53
 
@@ -126,10 +126,10 @@ function addDevServerHandler (handler: NitroDevEventHandler): void
126
126
 
127
127
  **handler**: A handler object with the following properties:
128
128
 
129
- | Property | Type | Required | Description |
130
- | ----------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
131
- | `handler` | `EventHandler` | `true` | Event handler. |
132
- | `route` | `string` | `false` | Path prefix or route. If an empty string used, will be used as a middleware. |
129
+ | Property | Type | Required | Description |
130
+ |-----------|----------------|----------|------------------------------------------------------------------------------|
131
+ | `handler` | `EventHandler` | `true` | Event handler. |
132
+ | `route` | `string` | `false` | Path prefix or route. If an empty string used, will be used as a middleware. |
133
133
 
134
134
  ### Examples
135
135
 
@@ -222,9 +222,9 @@ function addServerPlugin (plugin: string): void
222
222
 
223
223
  ### Parameters
224
224
 
225
- | Property | Type | Required | Description |
226
- | ----------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
227
- | `plugin` | `string` | `true` | Path to the plugin. The plugin must export a default function that accepts the Nitro instance as an argument. |
225
+ | Property | Type | Required | Description |
226
+ |----------|----------|----------|---------------------------------------------------------------------------------------------------------------|
227
+ | `plugin` | `string` | `true` | Path to the plugin. The plugin must export a default function that accepts the Nitro instance as an argument. |
228
228
 
229
229
  ### Examples
230
230
 
@@ -293,9 +293,9 @@ function addPrerenderRoutes (routes: string | string[]): void
293
293
 
294
294
  ### Parameters
295
295
 
296
- | Property | Type | Required | Description |
297
- | ----------- | ------------------------------- | -------- | ---------------------------------------------- |
298
- | `routes` | `string \| string[]`{lang="ts"} | `true` | A route or an array of routes to prerender. |
296
+ | Property | Type | Required | Description |
297
+ |----------|---------------------------------|----------|---------------------------------------------|
298
+ | `routes` | `string \| string[]`{lang="ts"} | `true` | A route or an array of routes to prerender. |
299
299
 
300
300
  ## `addServerImports`
301
301
 
@@ -333,16 +333,16 @@ function addServerImports (dirs: Import | Import[]): void
333
333
 
334
334
  `imports`: An object or an array of objects with the following properties:
335
335
 
336
- | Property | Type | Required | Description |
337
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
338
- | `name` | `string` | `true` | Import name to be detected. |
339
- | `from` | `string` | `true` | Module specifier to import from. |
340
- | `priority` | `number` | `false` | Priority of the import; if multiple imports have the same name, the one with the highest priority will be used. |
341
- | `disabled` | `boolean` | `false` | If this import is disabled. |
342
- | `meta` | `Record<string, any>` | `false` | Metadata of the import. |
343
- | `type` | `boolean` | `false` | If this import is a pure type import. |
344
- | `typeFrom` | `string` | `false` | Use this as the `from` value when generating type declarations. |
345
- | `as` | `string` | `false` | Import as this name. |
336
+ | Property | Type | Required | Description |
337
+ |------------|-----------------------|----------|-----------------------------------------------------------------------------------------------------------------|
338
+ | `name` | `string` | `true` | Import name to be detected. |
339
+ | `from` | `string` | `true` | Module specifier to import from. |
340
+ | `priority` | `number` | `false` | Priority of the import; if multiple imports have the same name, the one with the highest priority will be used. |
341
+ | `disabled` | `boolean` | `false` | If this import is disabled. |
342
+ | `meta` | `Record<string, any>` | `false` | Metadata of the import. |
343
+ | `type` | `boolean` | `false` | If this import is a pure type import. |
344
+ | `typeFrom` | `string` | `false` | Use this as the `from` value when generating type declarations. |
345
+ | `as` | `string` | `false` | Import as this name. |
346
346
 
347
347
  ## `addServerImportsDir`
348
348
 
@@ -373,10 +373,10 @@ function addServerImportsDir (dirs: string | string[], opts: { prepend?: boolean
373
373
 
374
374
  ### Parameters
375
375
 
376
- | Property | Type | Required | Description |
377
- | ----------- | ------------------------------- | -------- | ---------------------------------------------- |
378
- | `dirs` | `string \| string[]`{lang="ts"} | `true` | A directory or an array of directories to register to be scanned by Nitro. |
379
- | `opts` | `{ prepend?: boolean }` | `false` | Options for the import directory. If `prepend` is `true`, the directory is added to the beginning of the scan list. |
376
+ | Property | Type | Required | Description |
377
+ |----------|---------------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
378
+ | `dirs` | `string \| string[]`{lang="ts"} | `true` | A directory or an array of directories to register to be scanned by Nitro. |
379
+ | `opts` | `{ prepend?: boolean }` | `false` | Options for the import directory. If `prepend` is `true`, the directory is added to the beginning of the scan list. |
380
380
 
381
381
  ### Examples
382
382
 
@@ -453,10 +453,10 @@ function addServerScanDir (dirs: string | string[], opts: { prepend?: boolean })
453
453
 
454
454
  ### Parameters
455
455
 
456
- | Property | Type | Required | Description |
457
- | ----------- | ------------------------------- | -------- | ---------------------------------------------- |
458
- | `dirs` | `string \| string[]`{lang="ts"} | `true` | A directory or an array of directories to register to be scanned for by Nitro as server dirs. |
459
- | `opts` | `{ prepend?: boolean }` | `false` | Options for the import directory. If `prepend` is `true`, the directory is added to the beginning of the scan list. |
456
+ | Property | Type | Required | Description |
457
+ |----------|---------------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
458
+ | `dirs` | `string \| string[]`{lang="ts"} | `true` | A directory or an array of directories to register to be scanned for by Nitro as server dirs. |
459
+ | `opts` | `{ prepend?: boolean }` | `false` | Options for the import directory. If `prepend` is `true`, the directory is added to the beginning of the scan list. |
460
460
 
461
461
  ### Examples
462
462
 
@@ -93,13 +93,13 @@ Check out the Vite website for more information about its configuration.
93
93
 
94
94
  **`options`**: Options to pass to the callback function. This object can have the following properties:
95
95
 
96
- | Property | Type | Required | Description |
97
- | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------ |
98
- | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
99
- | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
96
+ | Property | Type | Required | Description |
97
+ |-----------|-----------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
98
+ | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
99
+ | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
100
100
  | `server` | `boolean` | `false` | If set to `true`, the callback function will be called when building the server bundle. **Deprecated in Nuxt 5+.** Use `addVitePlugin()` with `applyToEnvironment()` instead. |
101
101
  | `client` | `boolean` | `false` | If set to `true`, the callback function will be called when building the client bundle. **Deprecated in Nuxt 5+.** Use `addVitePlugin()` with `applyToEnvironment()` instead. |
102
- | `prepend` | `boolean` | `false` | If set to `true`, the callback function will be prepended to the array with `unshift()` instead of `push()`. |
102
+ | `prepend` | `boolean` | `false` | If set to `true`, the callback function will be prepended to the array with `unshift()` instead of `push()`. |
103
103
 
104
104
  ## `extendWebpackConfig`
105
105
 
@@ -143,7 +143,7 @@ Check out webpack website for more information about its configuration.
143
143
  **`options`**: Options to pass to the callback function. This object can have the following properties:
144
144
 
145
145
  | Property | Type | Required | Description |
146
- | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------ |
146
+ |-----------|-----------|----------|--------------------------------------------------------------------------------------------------------------|
147
147
  | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
148
148
  | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
149
149
  | `server` | `boolean` | `false` | If set to `true`, the callback function will be called when building the server bundle. |
@@ -211,13 +211,13 @@ See [Vite website](https://vite.dev/guide/api-plugin) for more information about
211
211
 
212
212
  **`options`**: Options to pass to the callback function. This object can have the following properties:
213
213
 
214
- | Property | Type | Required | Description |
215
- | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------ |
216
- | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
217
- | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
214
+ | Property | Type | Required | Description |
215
+ |-----------|-----------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
216
+ | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
217
+ | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
218
218
  | `server` | `boolean` | `false` | If set to `true`, the callback function will be called when building the server bundle. **Deprecated in Nuxt 5+.** Use `applyToEnvironment()` instead. |
219
219
  | `client` | `boolean` | `false` | If set to `true`, the callback function will be called when building the client bundle. **Deprecated in Nuxt 5+.** Use `applyToEnvironment()` instead. |
220
- | `prepend` | `boolean` | `false` | If set to `true`, the callback function will be prepended to the array with `unshift()` instead of `push()`. |
220
+ | `prepend` | `boolean` | `false` | If set to `true`, the callback function will be prepended to the array with `unshift()` instead of `push()`. |
221
221
 
222
222
  ## `addWebpackPlugin`
223
223
 
@@ -270,8 +270,8 @@ See [webpack website](https://webpack.js.org/concepts/plugins/) for more informa
270
270
 
271
271
  **`options`**: Options to pass to the callback function. This object can have the following properties:
272
272
 
273
- | Property | Type | Required | Description |
274
- | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------ |
273
+ | Property | Type | Required | Description |
274
+ |-----------|-----------|----------|--------------------------------------------------------------------------------------------------------------|
275
275
  | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
276
276
  | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
277
277
  | `server` | `boolean` | `false` | If set to `true`, the callback function will be called when building the server bundle. |
@@ -306,8 +306,8 @@ function addBuildPlugin (pluginFactory: AddBuildPluginFactory, options?: ExtendC
306
306
 
307
307
  **`options`**: Options to pass to the callback function. This object can have the following properties:
308
308
 
309
- | Property | Type | Required | Description |
310
- | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------ |
309
+ | Property | Type | Required | Description |
310
+ |-----------|-----------|----------|--------------------------------------------------------------------------------------------------------------|
311
311
  | `dev` | `boolean` | `false` | If set to `true`, the callback function will be called when building in development mode. |
312
312
  | `build` | `boolean` | `false` | If set to `true`, the callback function will be called when building in production mode. |
313
313
  | `server` | `boolean` | `false` | If set to `true`, the callback function will be called when building the server bundle. |
@@ -85,18 +85,18 @@ This ordering matches Nuxt's layer resolution system, where user-defined configu
85
85
 
86
86
  **`LayerDirectories`**: An object containing the resolved directory paths for a layer.
87
87
 
88
- | Property | Type | Description |
89
- | --------------- | -------- | ------------------------------------------------------------------------------ |
90
- | `root` | `string` | The root directory of the layer (equivalent to `rootDir`) |
91
- | `server` | `string` | The server directory for Nitro server-side code |
92
- | `modules` | `string` | The local modules directory |
93
- | `shared` | `string` | The shared directory for code used by both client and server |
94
- | `app` | `string` | The source directory of the layer (equivalent to `srcDir`) |
95
- | `public` | `string` | The public directory for static assets |
96
- | `appLayouts` | `string` | The layouts directory for Vue layout components |
97
- | `appMiddleware` | `string` | The middleware directory for route middleware |
98
- | `appPages` | `string` | The pages directory for file-based routing |
99
- | `appPlugins` | `string` | The plugins directory for Nuxt plugins |
88
+ | Property | Type | Description |
89
+ |-----------------|----------|--------------------------------------------------------------|
90
+ | `root` | `string` | The root directory of the layer (equivalent to `rootDir`) |
91
+ | `server` | `string` | The server directory for Nitro server-side code |
92
+ | `modules` | `string` | The local modules directory |
93
+ | `shared` | `string` | The shared directory for code used by both client and server |
94
+ | `app` | `string` | The source directory of the layer (equivalent to `srcDir`) |
95
+ | `public` | `string` | The public directory for static assets |
96
+ | `appLayouts` | `string` | The layouts directory for Vue layout components |
97
+ | `appMiddleware` | `string` | The middleware directory for route middleware |
98
+ | `appPages` | `string` | The pages directory for file-based routing |
99
+ | `appPlugins` | `string` | The plugins directory for Nuxt plugins |
100
100
 
101
101
  ### Examples
102
102
 
@@ -58,16 +58,16 @@ function addImports (imports: Import | Import[]): void
58
58
 
59
59
  `imports`: An object or an array of objects with the following properties:
60
60
 
61
- | Property | Type | Required | Description |
62
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
63
- | `name` | `string` | `true` | Import name to be detected. |
64
- | `from` | `string` | `true` | Module specifier to import from. |
65
- | `priority` | `number` | `false` | Priority of the import; if multiple imports have the same name, the one with the highest priority will be used. |
66
- | `disabled` | `boolean` | `false` | If this import is disabled. |
67
- | `meta` | `Record<string, any>` | `false` | Metadata of the import. |
68
- | `type` | `boolean` | `false` | If this import is a pure type import. |
69
- | `typeFrom` | `string` | `false` | Use this as the `from` value when generating type declarations. |
70
- | `as` | `string` | `false` | Import as this name. |
61
+ | Property | Type | Required | Description |
62
+ |------------|-----------------------|----------|-----------------------------------------------------------------------------------------------------------------|
63
+ | `name` | `string` | `true` | Import name to be detected. |
64
+ | `from` | `string` | `true` | Module specifier to import from. |
65
+ | `priority` | `number` | `false` | Priority of the import; if multiple imports have the same name, the one with the highest priority will be used. |
66
+ | `disabled` | `boolean` | `false` | If this import is disabled. |
67
+ | `meta` | `Record<string, any>` | `false` | Metadata of the import. |
68
+ | `type` | `boolean` | `false` | If this import is a pure type import. |
69
+ | `typeFrom` | `string` | `false` | Use this as the `from` value when generating type declarations. |
70
+ | `as` | `string` | `false` | Import as this name. |
71
71
 
72
72
  ## `addImportsDir`
73
73
 
@@ -98,10 +98,10 @@ function addImportsDir (dirs: string | string[], options?: { prepend?: boolean }
98
98
 
99
99
  ### Parameters
100
100
 
101
- | Property | Type | Required | Description |
102
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
103
- | `dirs` | `string \| string[]`{lang="ts"} | `true` | A string or an array of strings with the path to the directory to import from. |
104
- | `options` | `{ prepend?: boolean }`{lang="ts"} | `false` | Options to pass to the import. If `prepend` is set to `true`, the imports will be prepended to the list of imports. |
101
+ | Property | Type | Required | Description |
102
+ |-----------|------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
103
+ | `dirs` | `string \| string[]`{lang="ts"} | `true` | A string or an array of strings with the path to the directory to import from. |
104
+ | `options` | `{ prepend?: boolean }`{lang="ts"} | `false` | Options to pass to the import. If `prepend` is set to `true`, the imports will be prepended to the list of imports. |
105
105
 
106
106
  ## `addImportsSources`
107
107
 
@@ -138,7 +138,7 @@ function addImportsSources (importSources: ImportSource | ImportSource[]): void
138
138
 
139
139
  **importSources**: An object or an array of objects with the following properties:
140
140
 
141
- | Property | Type | Required | Description |
142
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
143
- | `from` | `string` | `true` | Module specifier to import from. |
144
- | `imports` | `PresetImport \| ImportSource[]`{lang="ts"} | `true` | An object or an array of objects, which can be import names, import objects or import sources. |
141
+ | Property | Type | Required | Description |
142
+ |-----------|---------------------------------------------|----------|------------------------------------------------------------------------------------------------|
143
+ | `from` | `string` | `true` | Module specifier to import from. |
144
+ | `imports` | `PresetImport \| ImportSource[]`{lang="ts"} | `true` | An object or an array of objects, which can be import names, import objects or import sources. |
@@ -46,28 +46,28 @@ function addComponentsDir (dir: ComponentsDir, opts: { prepend?: boolean } = {})
46
46
 
47
47
  `dir` An object with the following properties:
48
48
 
49
- | Property | Type | Required | Description |
50
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
51
- | `path` | `string` | `true` | Path (absolute or relative) to the directory containing your components. You can use Nuxt aliases (~ or @) to refer to directories inside project or directly use an npm package path similar to require. |
52
- | `pattern` | `string \| string[]`{lang="ts"} | `false` | Accept Pattern that will be run against specified path. |
53
- | `ignore` | `string[]` | `false` | Ignore patterns that will be run against specified path. |
54
- | `prefix` | `string` | `false` | Prefix all matched components with this string. |
55
- | `pathPrefix` | `boolean` | `false` | Prefix component name by its path. |
56
- | `prefetch` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
57
- | `preload` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
58
- | `isAsync` | `boolean` | `false` | This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not. |
59
- | `extendComponent` | `(component: Component) => Promise<Component \| void> \| (Component \| void)`{lang="ts"} | `false` | A function that will be called for each component found in the directory. It accepts a component object and should return a component object or a promise that resolves to a component object. |
60
- | `global` | `boolean` | `false` | If enabled, registers components to be globally available. |
61
- | `island` | `boolean` | `false` | If enabled, registers components as islands. You can read more about islands in [`<NuxtIsland/>`](/docs/4.x/api/components/nuxt-island) component description. |
62
- | `watch` | `boolean` | `false` | Watch specified path for changes, including file additions and file deletions. |
63
- | `extensions` | `string[]` | `false` | Extensions supported by Nuxt builder. |
64
- | `transpile` | `'auto' \| boolean`{lang="ts"} | `false` | Transpile specified path using build.transpile. If set to `'auto'`, it will set `transpile: true` if `node_modules/` is in path. |
49
+ | Property | Type | Required | Description |
50
+ |-------------------|------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
51
+ | `path` | `string` | `true` | Path (absolute or relative) to the directory containing your components. You can use Nuxt aliases (~ or @) to refer to directories inside project or directly use an npm package path similar to require. |
52
+ | `pattern` | `string \| string[]`{lang="ts"} | `false` | Accept Pattern that will be run against specified path. |
53
+ | `ignore` | `string[]` | `false` | Ignore patterns that will be run against specified path. |
54
+ | `prefix` | `string` | `false` | Prefix all matched components with this string. |
55
+ | `pathPrefix` | `boolean` | `false` | Prefix component name by its path. |
56
+ | `prefetch` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
57
+ | `preload` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
58
+ | `isAsync` | `boolean` | `false` | This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not. |
59
+ | `extendComponent` | `(component: Component) => Promise<Component \| void> \| (Component \| void)`{lang="ts"} | `false` | A function that will be called for each component found in the directory. It accepts a component object and should return a component object or a promise that resolves to a component object. |
60
+ | `global` | `boolean` | `false` | If enabled, registers components to be globally available. |
61
+ | `island` | `boolean` | `false` | If enabled, registers components as islands. You can read more about islands in [`<NuxtIsland/>`](/docs/4.x/api/components/nuxt-island) component description. |
62
+ | `watch` | `boolean` | `false` | Watch specified path for changes, including file additions and file deletions. |
63
+ | `extensions` | `string[]` | `false` | Extensions supported by Nuxt builder. |
64
+ | `transpile` | `'auto' \| boolean`{lang="ts"} | `false` | Transpile specified path using build.transpile. If set to `'auto'`, it will set `transpile: true` if `node_modules/` is in path. |
65
65
 
66
66
  `opts`
67
67
 
68
- | Property | Type | Required | Description |
69
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
70
- | `prepend` | `boolean` | `false` | If set to `true`, the directory will be prepended to the array with `unshift()` instead of `push()`. |
68
+ | Property | Type | Required | Description |
69
+ |-----------|-----------|----------|------------------------------------------------------------------------------------------------------|
70
+ | `prepend` | `boolean` | `false` | If set to `true`, the directory will be prepended to the array with `unshift()` instead of `push()`. |
71
71
 
72
72
  ## `addComponent`
73
73
 
@@ -109,22 +109,22 @@ function addComponent (options: AddComponentOptions): void
109
109
 
110
110
  `options`: An object with the following properties:
111
111
 
112
- | Property | Type | Required | Description |
113
- | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
114
- | `name` | `string` | `true` | Component name. |
115
- | `filePath` | `string` | `true` | Path to the component. |
116
- | `declarationPath` | `string` | `false` | Path to component's declaration file. It is used to generate components' [type templates](/docs/4.x/api/kit/templates#addtypetemplate); if not provided, `filePath` is used instead. |
117
- | `pascalName` | `string` | `false` | Pascal case component name. If not provided, it will be generated from the component name. |
118
- | `kebabName` | `string` | `false` | Kebab case component name. If not provided, it will be generated from the component name. |
119
- | `export` | `string` | `false` | Specify named or default export. If not provided, it will be set to `'default'`. |
120
- | `shortPath` | `string` | `false` | Short path to the component. If not provided, it will be generated from the component path. |
121
- | `chunkName` | `string` | `false` | Chunk name for the component. If not provided, it will be generated from the component name. |
122
- | `prefetch` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
123
- | `preload` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
124
- | `global` | `boolean` | `false` | If enabled, registers component to be globally available. |
125
- | `island` | `boolean` | `false` | If enabled, registers component as island. You can read more about islands in [`<NuxtIsland/>`](/docs/4.x/api/components/nuxt-island) component description. |
126
- | `mode` | `'client' \| 'server' \| 'all'`{lang="ts"} | `false` | This options indicates if component should render on client, server or both. By default, it will render on both client and server. |
127
- | `priority` | `number` | `false` | Priority of the component, if multiple components have the same name, the one with the highest priority will be used. |
112
+ | Property | Type | Required | Description |
113
+ |-------------------|--------------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
114
+ | `name` | `string` | `true` | Component name. |
115
+ | `filePath` | `string` | `true` | Path to the component. |
116
+ | `declarationPath` | `string` | `false` | Path to component's declaration file. It is used to generate components' [type templates](/docs/4.x/api/kit/templates#addtypetemplate); if not provided, `filePath` is used instead. |
117
+ | `pascalName` | `string` | `false` | Pascal case component name. If not provided, it will be generated from the component name. |
118
+ | `kebabName` | `string` | `false` | Kebab case component name. If not provided, it will be generated from the component name. |
119
+ | `export` | `string` | `false` | Specify named or default export. If not provided, it will be set to `'default'`. |
120
+ | `shortPath` | `string` | `false` | Short path to the component. If not provided, it will be generated from the component path. |
121
+ | `chunkName` | `string` | `false` | Chunk name for the component. If not provided, it will be generated from the component name. |
122
+ | `prefetch` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
123
+ | `preload` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
124
+ | `global` | `boolean` | `false` | If enabled, registers component to be globally available. |
125
+ | `island` | `boolean` | `false` | If enabled, registers component as island. You can read more about islands in [`<NuxtIsland/>`](/docs/4.x/api/components/nuxt-island) component description. |
126
+ | `mode` | `'client' \| 'server' \| 'all'`{lang="ts"} | `false` | This options indicates if component should render on client, server or both. By default, it will render on both client and server. |
127
+ | `priority` | `number` | `false` | Priority of the component, if multiple components have the same name, the one with the highest priority will be used. |
128
128
 
129
129
  ### Examples
130
130