@nuxt/webpack-builder 3.20.2 → 3.21.1

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.
Files changed (33) hide show
  1. package/README.md +5 -3
  2. package/dist/THIRD-PARTY-LICENSES.md +3847 -0
  3. package/dist/_chunks/libs/@babel/parser.d.mts +1536 -0
  4. package/dist/_chunks/libs/@jridgewell/trace-mapping.d.mts +82 -0
  5. package/dist/_chunks/libs/@types/estree.d.mts +525 -0
  6. package/dist/_chunks/libs/@types/pug.d.mts +123 -0
  7. package/dist/_chunks/libs/@unhead/vue.d.mts +1096 -0
  8. package/dist/_chunks/libs/@vitejs/plugin-vue-jsx.d.mts +5297 -0
  9. package/dist/_chunks/libs/@vitejs/plugin-vue.d.mts +83 -0
  10. package/dist/_chunks/libs/@volar/language-core.d.mts +56 -0
  11. package/dist/_chunks/libs/@volar/source-map.d.mts +10 -0
  12. package/dist/_chunks/libs/@vue/compiler-core.d.mts +1213 -0
  13. package/dist/_chunks/libs/@vue/compiler-dom.d.mts +45 -0
  14. package/dist/_chunks/libs/@vue/language-core.d.mts +11387 -0
  15. package/dist/_chunks/libs/c12.d.mts +147 -0
  16. package/dist/_chunks/libs/compatx.d.mts +47 -0
  17. package/dist/_chunks/libs/h3.d.mts +45 -0
  18. package/dist/_chunks/libs/ofetch.d.mts +870 -0
  19. package/dist/_chunks/libs/open.d.mts +1 -0
  20. package/dist/_chunks/libs/oxc-transform.d.mts +422 -0
  21. package/dist/_chunks/libs/pkg-types.d.mts +23 -0
  22. package/dist/_chunks/libs/rollup-plugin-visualizer.d.mts +90 -0
  23. package/dist/_chunks/libs/scule.d.mts +15 -0
  24. package/dist/_chunks/libs/unctx.d.mts +28 -0
  25. package/dist/_chunks/libs/unimport.d.mts +386 -0
  26. package/dist/_chunks/libs/untyped.d.mts +44 -0
  27. package/dist/_chunks/libs/vue-router.d.mts +1413 -0
  28. package/dist/_chunks/rolldown-runtime.mjs +12 -0
  29. package/dist/index.d.mts +3150 -4
  30. package/dist/index.mjs +1310 -1155
  31. package/dist/loaders/vue-module-identifier.mjs +11 -0
  32. package/package.json +31 -27
  33. package/dist/index.d.ts +0 -5
package/dist/index.d.mts CHANGED
@@ -1,5 +1,3151 @@
1
- import { NuxtBuilder } from '@nuxt/schema';
1
+ import "./_chunks/rolldown-runtime.mjs";
2
+ import { a as TransformOptions, i as ViteDevServer, n as ServerOptions$1, r as UserConfig, t as Options$4 } from "./_chunks/libs/@vitejs/plugin-vue-jsx.mjs";
3
+ import { t as Options$5 } from "./_chunks/libs/@vitejs/plugin-vue.mjs";
4
+ import { n as SchemaDefinition, t as Schema } from "./_chunks/libs/untyped.mjs";
5
+ import { t as SnakeCase } from "./_chunks/libs/scule.mjs";
6
+ import { i as ChokidarOptions, n as ResolvedConfig, r as SourceOptions, t as DotenvOptions } from "./_chunks/libs/c12.mjs";
7
+ import { k as CompilerOptions } from "./_chunks/libs/@vue/compiler-core.mjs";
8
+ import { a as SerializableHead, i as RenderSSRHeadOptions, n as DataKeys, r as GlobalAttributes, t as AriaAttributes } from "./_chunks/libs/@unhead/vue.mjs";
9
+ import "./_chunks/libs/open.mjs";
10
+ import { t as PluginVisualizerOptions } from "./_chunks/libs/rollup-plugin-visualizer.mjs";
11
+ import { t as TransformerOptions } from "./_chunks/libs/unctx.mjs";
12
+ import { t as CompatibilityDateSpec } from "./_chunks/libs/compatx.mjs";
13
+ import { t as H3CorsOptions } from "./_chunks/libs/h3.mjs";
14
+ import { t as FetchOptions } from "./_chunks/libs/ofetch.mjs";
15
+ import { t as RawVueCompilerOptions } from "./_chunks/libs/@vue/language-core.mjs";
16
+ import { t as TSConfig } from "./_chunks/libs/pkg-types.mjs";
17
+ import "./_chunks/libs/@types/pug.mjs";
18
+ import { t as TransformOptions$1 } from "./_chunks/libs/oxc-transform.mjs";
19
+ import { i as RouterHistory, n as RouteLocationRaw, r as RouteRecordRaw, t as RouterOptions$1 } from "./_chunks/libs/vue-router.mjs";
20
+ import { i as UnimportOptions, n as InlinePreset, r as Unimport, t as Import } from "./_chunks/libs/unimport.mjs";
21
+ import { Options } from "webpack-dev-middleware";
22
+ import { ClientOptions, MiddlewareOptions } from "webpack-hot-middleware";
23
+ import { Defu } from "defu";
24
+ import { Compiler, Configuration, Stats, WebpackError } from "webpack";
25
+ import { PluginOptions } from "mini-css-extract-plugin";
26
+ import { AssetURLTagConfig } from "@vue/compiler-sfc";
27
+ import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
28
+ import { LoaderOptions } from "esbuild-loader";
29
+ import { BasePluginOptions, DefinedDefaultMinimizerAndOptions } from "css-minimizer-webpack-plugin";
30
+ import { Manifest } from "vue-bundle-renderer";
31
+ import { AppConfig, KeepAliveProps, TransitionProps } from "vue";
32
+ import { IncomingMessage, Server, ServerResponse } from "node:http";
33
+ import { Server as Server$1 } from "node:https";
34
+ import { ProcessOptions } from "postcss";
35
+ import { NuxtLinkOptions } from "nuxt/app";
36
+ import { Options as Options$1 } from "autoprefixer";
37
+ import { Options as Options$2 } from "cssnano";
38
+ import { VueLoaderOptions } from "vue-loader";
39
+ import { AsyncLocalStorage } from "node:async_hooks";
40
+ import { Hookable } from "hookable";
2
41
 
3
- declare const bundle: NuxtBuilder['bundle'];
4
-
5
- export { bundle };
42
+ //#region ../schema/dist/index.d.ts
43
+ interface NuxtCompatibility {
44
+ /**
45
+ * Required nuxt version in semver format.
46
+ * @example `^2.14.0` or `>=3.0.0-27219851.6e49637`.
47
+ */
48
+ nuxt?: string;
49
+ /**
50
+ * Bridge constraint for Nuxt 2 support.
51
+ *
52
+ * - `true`: When using Nuxt 2, using bridge module is required.
53
+ * - `false`: When using Nuxt 2, using bridge module is not supported.
54
+ */
55
+ bridge?: boolean;
56
+ /**
57
+ * Mark a builder as incompatible, or require a particular version.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * export default defineNuxtModule({
62
+ * meta: {
63
+ * name: 'my-module',
64
+ * compatibility: {
65
+ * builder: {
66
+ * // marking as incompatible
67
+ * webpack: false,
68
+ * // you can require a (semver-compatible) version
69
+ * vite: '^5'
70
+ * }
71
+ * }
72
+ * }
73
+ * // ...
74
+ * })
75
+ * ```
76
+ */
77
+ builder?: Partial<Record<'vite' | 'webpack' | 'rspack' | (string & {}), false | string>>;
78
+ }
79
+ interface NuxtCompatibilityIssue {
80
+ name: string;
81
+ message: string;
82
+ }
83
+ interface NuxtCompatibilityIssues extends Array<NuxtCompatibilityIssue> {
84
+ /**
85
+ * Return formatted error message.
86
+ */
87
+ toString(): string;
88
+ }
89
+ interface ComponentMeta {
90
+ [key: string]: unknown;
91
+ }
92
+ interface Component$1 {
93
+ pascalName: string;
94
+ kebabName: string;
95
+ export: string;
96
+ filePath: string;
97
+ shortPath: string;
98
+ chunkName: string;
99
+ prefetch: boolean;
100
+ preload: boolean;
101
+ global?: boolean | 'sync';
102
+ island?: boolean;
103
+ meta?: ComponentMeta;
104
+ mode?: 'client' | 'server' | 'all';
105
+ /**
106
+ * This number allows configuring the behavior of overriding Nuxt components.
107
+ * If multiple components are provided with the same name, then higher priority
108
+ * components will be used instead of lower priority components.
109
+ */
110
+ priority?: number;
111
+ /**
112
+ * Path to component's declaration file
113
+ * Used for type generation when different from filePath
114
+ * @default filePath
115
+ */
116
+ declarationPath?: string;
117
+ /**
118
+ * Allow bypassing client/server transforms for internal Nuxt components like
119
+ * ServerPlaceholder and NuxtClientFallback.
120
+ *
121
+ * @internal
122
+ */
123
+ _raw?: boolean;
124
+ }
125
+ interface ScanDir {
126
+ /**
127
+ * Path (absolute or relative) to the directory containing your components.
128
+ * You can use Nuxt aliases (~ or @) to refer to directories inside project or directly use an npm package path similar to require.
129
+ */
130
+ path: string;
131
+ /**
132
+ * Accept Pattern that will be run against specified path.
133
+ */
134
+ pattern?: string | string[];
135
+ /**
136
+ * Ignore patterns that will be run against specified path.
137
+ */
138
+ ignore?: string[];
139
+ /**
140
+ * Prefix all matched components.
141
+ */
142
+ prefix?: string;
143
+ /**
144
+ * Prefix component name by its path.
145
+ */
146
+ pathPrefix?: boolean;
147
+ /**
148
+ * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments.
149
+ * Learn more on webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
150
+ */
151
+ prefetch?: boolean;
152
+ /**
153
+ * These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments.
154
+ * Learn more on webpack documentation: https://webpack.js.org/api/module-methods/#magic-comments
155
+ */
156
+ preload?: boolean;
157
+ /**
158
+ * This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not.
159
+ */
160
+ isAsync?: boolean;
161
+ extendComponent?: (component: Component$1) => Promise<Component$1 | void> | (Component$1 | void);
162
+ /**
163
+ * If enabled, registers components to be globally available.
164
+ *
165
+ */
166
+ global?: boolean;
167
+ /**
168
+ * If enabled, registers components as islands
169
+ */
170
+ island?: boolean;
171
+ }
172
+ interface ComponentsDir extends ScanDir {
173
+ /**
174
+ * Watch specified path for changes, including file additions and file deletions.
175
+ */
176
+ watch?: boolean;
177
+ /**
178
+ * Extensions supported by Nuxt builder.
179
+ */
180
+ extensions?: string[];
181
+ /**
182
+ * Transpile specified path using build.transpile.
183
+ * By default ('auto') it will set transpile: true if node_modules/ is in path.
184
+ */
185
+ transpile?: 'auto' | boolean;
186
+ /**
187
+ * This number allows configuring the behavior of overriding Nuxt components.
188
+ * It will be inherited by any components within the directory.
189
+ *
190
+ * If multiple components are provided with the same name, then higher priority
191
+ * components will be used instead of lower priority components.
192
+ */
193
+ priority?: number;
194
+ }
195
+ interface ComponentsOptions {
196
+ dirs: (string | ComponentsDir)[];
197
+ /**
198
+ * The default value for whether to globally register components.
199
+ *
200
+ * When components are registered globally, they will still be directly imported where used,
201
+ * but they can also be used dynamically, for example `<component :is="`icon-${myIcon}`">`.
202
+ *
203
+ * This can be overridden by an individual component directory entry.
204
+ * @default false
205
+ */
206
+ global?: boolean;
207
+ /**
208
+ * Whether to write metadata to the build directory with information about the components that
209
+ * are auto-registered in your app.
210
+ */
211
+ generateMetadata?: boolean;
212
+ loader?: boolean;
213
+ transform?: {
214
+ exclude?: RegExp[];
215
+ include?: RegExp[];
216
+ };
217
+ }
218
+ interface KeyedFunction {
219
+ /**
220
+ * The name of the function.
221
+ *
222
+ * Use 'default' to target a module's default export. In that case, the callable name
223
+ * is derived from the filename (camel-cased) for matching during analysis.
224
+ */
225
+ name: string;
226
+ /**
227
+ * The path to the file where the function is defined.
228
+ * You can use Nuxt aliases (~ or @) to refer to directories inside the project or directly use an npm package path similar to require.
229
+ */
230
+ source: string;
231
+ /**
232
+ * The maximum number of arguments the function can accept.
233
+ * In the case that the function is called with fewer arguments than this number,
234
+ * the compiler will inject an auto-generated key as an additional argument.
235
+ *
236
+ * The key is unique based on the location of the function being invoked within the file.
237
+ *
238
+ * @example `{ name: 'useKey', source: '~/composables/useKey', argumentLength: 2 }`
239
+ *
240
+ * ```ts
241
+ * useKey() // will be transformed to: useKey('\$KzLSZ0O59L')
242
+ * useKey('first') // will be transformed to: useKey('first', '\$KzLSZ0O59L')
243
+ * useKey('first', 'second') // will not be transformed
244
+ * ```
245
+ */
246
+ argumentLength: number;
247
+ }
248
+ type RouterOptions = Partial<Omit<RouterOptions$1, 'history' | 'routes'>> & {
249
+ history?: (baseURL?: string) => RouterHistory | null | undefined;
250
+ routes?: (_routes: RouterOptions$1['routes']) => RouterOptions$1['routes'] | Promise<RouterOptions$1['routes']>;
251
+ hashMode?: boolean;
252
+ scrollBehaviorType?: 'smooth' | 'auto';
253
+ };
254
+ type RouterConfig = RouterOptions;
255
+ /**
256
+ * Only JSON serializable router options are configurable from nuxt config
257
+ */
258
+ type RouterConfigSerializable = Pick<RouterConfig, 'linkActiveClass' | 'linkExactActiveClass' | 'end' | 'sensitive' | 'strict' | 'hashMode' | 'scrollBehaviorType'>;
259
+ interface ModuleMeta {
260
+ /** Module name. */
261
+ name?: string;
262
+ /** Module version. */
263
+ version?: string;
264
+ /**
265
+ * The configuration key used within `nuxt.config` for this module's options.
266
+ * For example, `@nuxtjs/axios` uses `axios`.
267
+ */
268
+ configKey?: string;
269
+ /**
270
+ * Constraints for the versions of Nuxt or features this module requires.
271
+ */
272
+ compatibility?: NuxtCompatibility;
273
+ /**
274
+ * Fully resolved path used internally by Nuxt. Do not depend on this value.
275
+ * @internal
276
+ */
277
+ rawPath?: string;
278
+ /**
279
+ * Whether the module has been disabled in the Nuxt configuration.
280
+ * @internal
281
+ */
282
+ disabled?: boolean;
283
+ [key: string]: unknown;
284
+ }
285
+ /** The options received. */
286
+ type ModuleOptions = Record<string, any>;
287
+ type ModuleSetupInstallResult = {
288
+ /**
289
+ * Timing information for the initial setup
290
+ */
291
+ timings?: {
292
+ /** Total time took for module setup in ms */setup?: number;
293
+ [key: string]: number | undefined;
294
+ };
295
+ };
296
+ type Awaitable<T> = T | Promise<T>;
297
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
298
+ type ModuleSetupReturn = Awaitable<false | void | ModuleSetupInstallResult>;
299
+ type ResolvedModuleOptions<TOptions extends ModuleOptions, TOptionsDefaults extends Partial<TOptions>> = Prettify<Defu<Partial<TOptions>, [Partial<TOptions>, TOptionsDefaults]>>;
300
+ interface ModuleDependencyMeta<T = Record<string, unknown>> {
301
+ version?: string;
302
+ overrides?: Partial<T>;
303
+ defaults?: Partial<T>;
304
+ optional?: boolean;
305
+ }
306
+ interface ModuleDependencies {
307
+ [key: string]: ModuleDependencyMeta<Record<string, unknown>>;
308
+ }
309
+ /** Module definition passed to 'defineNuxtModule(...)' or 'defineNuxtModule().with(...)'. */
310
+ interface NuxtModule<TOptions extends ModuleOptions = ModuleOptions, TOptionsDefaults extends Partial<TOptions> = Partial<TOptions>, TWith extends boolean = false> {
311
+ (this: void, resolvedOptions: TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions, nuxt: Nuxt): ModuleSetupReturn;
312
+ getOptions?: (inlineOptions?: Partial<TOptions>, nuxt?: Nuxt) => Promise<TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions>;
313
+ getModuleDependencies?: (nuxt: Nuxt) => Awaitable<ModuleDependencies> | undefined;
314
+ getMeta?: () => Promise<ModuleMeta>;
315
+ onInstall?: (nuxt: Nuxt) => Awaitable<void>;
316
+ onUpgrade?: (nuxt: Nuxt, options: TWith extends true ? ResolvedModuleOptions<TOptions, TOptionsDefaults> : TOptions, previousVersion: string) => Awaitable<void>;
317
+ }
318
+ interface NuxtDebugContext {
319
+ /**
320
+ * Module mutation records to the `nuxt` instance.
321
+ */
322
+ moduleMutationRecords?: NuxtDebugModuleMutationRecord[];
323
+ }
324
+ interface NuxtDebugModuleMutationRecord {
325
+ module: NuxtModule;
326
+ keys: (string | symbol)[];
327
+ target: 'nuxt.options';
328
+ value: any;
329
+ method?: string;
330
+ timestamp: number;
331
+ }
332
+ interface NuxtDebugOptions {
333
+ /** Debug for Nuxt templates */
334
+ templates?: boolean;
335
+ /** Debug for modules setup timings */
336
+ modules?: boolean;
337
+ /** Debug for file watchers */
338
+ watchers?: boolean;
339
+ /** Debug for production hydration mismatch */
340
+ hydration?: boolean;
341
+ /** Debug for Vue Router */
342
+ router?: boolean;
343
+ /** Debug for hooks, can be set to `true` or an object with `server` and `client` keys */
344
+ hooks?: boolean | {
345
+ server?: boolean;
346
+ client?: boolean;
347
+ };
348
+ }
349
+ interface NuxtPlugin {
350
+ /** @deprecated use mode */
351
+ ssr?: boolean;
352
+ src: string;
353
+ mode?: 'all' | 'server' | 'client';
354
+ /**
355
+ * This allows more granular control over plugin order and should only be used by advanced users.
356
+ * Lower numbers run first, and user plugins default to `0`.
357
+ *
358
+ * Default Nuxt priorities can be seen at [here](https://github.com/nuxt/nuxt/blob/9904849bc87c53dfbd3ea3528140a5684c63c8d8/packages/nuxt/src/core/plugins/plugin-metadata.ts#L15-L34).
359
+ */
360
+ order?: number;
361
+ /**
362
+ * @internal
363
+ */
364
+ name?: string;
365
+ }
366
+ type TemplateDefaultOptions = Record<string, any>;
367
+ interface NuxtTemplate<Options = TemplateDefaultOptions> {
368
+ /** resolved output file path (generated) */
369
+ dst?: string;
370
+ /** The target filename once the template is copied into the Nuxt buildDir */
371
+ filename?: string;
372
+ /** An options object that will be accessible within the template via `<% options %>` */
373
+ options?: Options;
374
+ /** The resolved path to the source file to be template */
375
+ src?: string;
376
+ /** Provided compile option instead of src */
377
+ getContents?: (data: {
378
+ nuxt: Nuxt;
379
+ app: NuxtApp;
380
+ options: Options;
381
+ }) => string | Promise<string>;
382
+ /** Write to filesystem */
383
+ write?: boolean;
384
+ /**
385
+ * The source path of the template (to try resolving dependencies from).
386
+ * @internal
387
+ */
388
+ _path?: string;
389
+ }
390
+ interface ResolvedNuxtTemplate<Options = TemplateDefaultOptions> extends NuxtTemplate<Options> {
391
+ filename: string;
392
+ dst: string;
393
+ modified?: boolean;
394
+ }
395
+ interface NuxtApp {
396
+ mainComponent?: string | null;
397
+ rootComponent?: string | null;
398
+ errorComponent?: string | null;
399
+ dir: string;
400
+ extensions: string[];
401
+ plugins: NuxtPlugin[];
402
+ components: Component$1[];
403
+ layouts: Record<string, NuxtLayout>;
404
+ middleware: NuxtMiddleware[];
405
+ templates: NuxtTemplate[];
406
+ configs: string[];
407
+ pages?: NuxtPage[];
408
+ }
409
+ interface Nuxt {
410
+ '__name': string;
411
+ '_version': string;
412
+ '_ignore'?: Ignore;
413
+ '_dependencies'?: Set<string>;
414
+ '~runtimeDependencies'?: string[];
415
+ '_debug'?: NuxtDebugContext;
416
+ /** Async local storage for current running Nuxt module instance. */
417
+ '_asyncLocalStorageModule'?: AsyncLocalStorage<NuxtModule>;
418
+ /**
419
+ * Module options functions collected from moduleDependencies.
420
+ * @internal
421
+ */
422
+ '_moduleOptionsFunctions'?: Map<string | NuxtModule, Array<() => {
423
+ defaults?: Record<string, unknown>;
424
+ overrides?: Record<string, unknown>;
425
+ }>>;
426
+ /** The resolved Nuxt configuration. */
427
+ 'options': NuxtOptions;
428
+ 'hooks': Hookable<NuxtHooks>;
429
+ 'hook': Nuxt['hooks']['hook'];
430
+ 'callHook': Nuxt['hooks']['callHook'];
431
+ 'addHooks': Nuxt['hooks']['addHooks'];
432
+ 'runWithContext': <T extends (...args: any[]) => any>(fn: T) => ReturnType<T>;
433
+ 'ready': () => Promise<void>;
434
+ 'close': () => Promise<void>;
435
+ /** The production or development server. */
436
+ 'server'?: any;
437
+ 'vfs': Record<string, string>;
438
+ 'apps': Record<string, NuxtApp>;
439
+ }
440
+ type HookResult = Promise<void> | void;
441
+ type TSReference = {
442
+ types: string;
443
+ } | {
444
+ path: string;
445
+ };
446
+ type WatchEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
447
+ type VueTSConfig = 0 extends 1 & RawVueCompilerOptions ? TSConfig : TSConfig & {
448
+ vueCompilerOptions?: RawVueCompilerOptions;
449
+ };
450
+ interface NuxtPage {
451
+ name?: string;
452
+ path: string;
453
+ props?: RouteRecordRaw['props'];
454
+ file?: string;
455
+ meta?: Record<string, any>;
456
+ alias?: string[] | string;
457
+ redirect?: RouteLocationRaw;
458
+ children?: NuxtPage[];
459
+ middleware?: string[] | string;
460
+ /**
461
+ * Set the render mode.
462
+ *
463
+ * `all` means the page will be rendered isomorphically - with JavaScript both on client and server.
464
+ *
465
+ * `server` means pages are automatically rendered with server components, so there will be no JavaScript to render the page in your client bundle.
466
+ *
467
+ * `client` means that page will render on the client-side only.
468
+ * @default 'all'
469
+ */
470
+ mode?: 'client' | 'server' | 'all';
471
+ /** @internal */
472
+ _sync?: boolean;
473
+ }
474
+ type NuxtMiddleware = {
475
+ name: string;
476
+ path: string;
477
+ global?: boolean;
478
+ };
479
+ type NuxtLayout = {
480
+ name: string;
481
+ file: string;
482
+ };
483
+ /**
484
+ * @deprecated Use {@link InlinePreset}
485
+ */
486
+ interface GenerateAppOptions {
487
+ filter?: (template: ResolvedNuxtTemplate<any>) => boolean;
488
+ }
489
+ interface NuxtAnalyzeMeta {
490
+ name: string;
491
+ slug: string;
492
+ startTime: number;
493
+ endTime: number;
494
+ analyzeDir: string;
495
+ buildDir: string;
496
+ outDir: string;
497
+ }
498
+ /**
499
+ * The listeners to Nuxt build time events
500
+ */
501
+ interface NuxtHooks {
502
+ /**
503
+ * Allows extending compatibility checks.
504
+ * @param compatibility Compatibility object
505
+ * @param issues Issues to be mapped
506
+ * @returns Promise
507
+ */
508
+ 'kit:compatibility': (compatibility: NuxtCompatibility, issues: NuxtCompatibilityIssues) => HookResult;
509
+ /**
510
+ * Called after Nuxt initialization, when the Nuxt instance is ready to work.
511
+ * @param nuxt The configured Nuxt object
512
+ * @returns Promise
513
+ */
514
+ 'ready': (nuxt: Nuxt) => HookResult;
515
+ /**
516
+ * Called when Nuxt instance is gracefully closing.
517
+ * @param nuxt The configured Nuxt object
518
+ * @returns Promise
519
+ */
520
+ 'close': (nuxt: Nuxt) => HookResult;
521
+ /**
522
+ * Called to restart the current Nuxt instance.
523
+ * @returns Promise
524
+ */
525
+ 'restart': (options?: {
526
+ /**
527
+ * Try to restart the whole process if supported
528
+ */
529
+ hard?: boolean;
530
+ }) => HookResult;
531
+ /**
532
+ * Called during Nuxt initialization, before installing user modules.
533
+ * @returns Promise
534
+ */
535
+ 'modules:before': () => HookResult;
536
+ /**
537
+ * Called during Nuxt initialization, after installing user modules.
538
+ * @returns Promise
539
+ */
540
+ 'modules:done': () => HookResult;
541
+ /**
542
+ * Called after resolving the `app` instance.
543
+ * @param app The resolved `NuxtApp` object
544
+ * @returns Promise
545
+ */
546
+ 'app:resolve': (app: NuxtApp) => HookResult;
547
+ /**
548
+ * Called during `NuxtApp` generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to `.nuxt`).
549
+ * @param app The configured `NuxtApp` object
550
+ * @returns Promise
551
+ */
552
+ 'app:templates': (app: NuxtApp) => HookResult;
553
+ /**
554
+ * Called after templates are compiled into the [virtual file system](https://nuxt.com/docs/3.x/directory-structure/nuxt) (vfs).
555
+ * @param app The configured `NuxtApp` object
556
+ * @returns Promise
557
+ */
558
+ 'app:templatesGenerated': (app: NuxtApp, templates: ResolvedNuxtTemplate[], options?: GenerateAppOptions) => HookResult;
559
+ /**
560
+ * Called before Nuxt bundle builder.
561
+ * @returns Promise
562
+ */
563
+ 'build:before': () => HookResult;
564
+ /**
565
+ * Called after Nuxt bundle builder is complete.
566
+ * @returns Promise
567
+ */
568
+ 'build:done': () => HookResult;
569
+ /**
570
+ * Called during the manifest build by Vite and Webpack. This allows customizing the manifest that Nitro will use to render `<script>` and `<link>` tags in the final HTML.
571
+ * @param manifest The manifest object to build
572
+ * @returns Promise
573
+ */
574
+ 'build:manifest': (manifest: Manifest) => HookResult;
575
+ /**
576
+ * Called when `nuxt analyze` is finished
577
+ * @param meta the analyze meta object, mutations will be saved to `meta.json`
578
+ * @returns Promise
579
+ */
580
+ 'build:analyze:done': (meta: NuxtAnalyzeMeta) => HookResult;
581
+ /**
582
+ * Called before generating the app.
583
+ * @param options GenerateAppOptions object
584
+ * @returns Promise
585
+ */
586
+ 'builder:generateApp': (options?: GenerateAppOptions) => HookResult;
587
+ /**
588
+ * Called at build time in development when the watcher spots a change to a file or directory in the project.
589
+ * @param event "add" | "addDir" | "change" | "unlink" | "unlinkDir"
590
+ * @param path the path to the watched file
591
+ * @returns Promise
592
+ */
593
+ 'builder:watch': (event: WatchEvent, path: string) => HookResult;
594
+ /**
595
+ * Called after page routes are scanned from the file system.
596
+ * @param pages Array containing scanned pages
597
+ * @returns Promise
598
+ */
599
+ 'pages:extend': (pages: NuxtPage[]) => HookResult;
600
+ /**
601
+ * Called after page routes have been augmented with scanned metadata.
602
+ * @param pages Array containing resolved pages
603
+ * @returns Promise
604
+ */
605
+ 'pages:resolved': (pages: NuxtPage[]) => HookResult;
606
+ /**
607
+ * Called when resolving `app/router.options` files. It allows modifying the detected router options files
608
+ * and adding new ones.
609
+ *
610
+ * Later items in the array override earlier ones.
611
+ *
612
+ * Adding a router options file will switch on page-based routing, unless `optional` is set, in which case
613
+ * it will only apply when page-based routing is already enabled.
614
+ * @param context An object with `files` containing an array of router options files.
615
+ * @returns Promise
616
+ */
617
+ 'pages:routerOptions': (context: {
618
+ files: Array<{
619
+ path: string;
620
+ optional?: boolean;
621
+ }>;
622
+ }) => HookResult;
623
+ /**
624
+ * Called at setup allowing modules to extend sources.
625
+ * @param presets Array containing presets objects
626
+ * @returns Promise
627
+ */
628
+ 'imports:sources': (presets: InlinePreset[]) => HookResult;
629
+ /**
630
+ * Called at setup allowing modules to extend imports.
631
+ * @param imports Array containing the imports to extend
632
+ * @returns Promise
633
+ */
634
+ 'imports:extend': (imports: Import[]) => HookResult;
635
+ /**
636
+ * Called when the [unimport](https://github.com/unjs/unimport) context is created.
637
+ * @param context The Unimport context
638
+ * @returns Promise
639
+ */
640
+ 'imports:context': (context: Unimport) => HookResult;
641
+ /**
642
+ * Allows extending import directories.
643
+ * @param dirs Array containing directories as string
644
+ * @returns Promise
645
+ */
646
+ 'imports:dirs': (dirs: string[]) => HookResult;
647
+ /**
648
+ * Called within `app:resolve` allowing to extend the directories that are scanned for auto-importable components.
649
+ * @param dirs The `dirs` option to push new items
650
+ * @returns Promise
651
+ */
652
+ 'components:dirs': (dirs: ComponentsOptions['dirs']) => HookResult;
653
+ /**
654
+ * Allows extending new components.
655
+ * @param components The `components` array to push new items
656
+ * @returns Promise
657
+ */
658
+ 'components:extend': (components: Component$1[]) => HookResult;
659
+ /**
660
+ * Allows extending the routes to be pre-rendered.
661
+ * @param ctx Nuxt context
662
+ * @returns Promise
663
+ */
664
+ 'prerender:routes': (ctx: {
665
+ routes: Set<string>;
666
+ }) => HookResult;
667
+ /**
668
+ * Called when an error occurs at build time.
669
+ * @param error Error object
670
+ * @returns Promise
671
+ */
672
+ 'build:error': (error: Error) => HookResult;
673
+ /**
674
+ * Called before @nuxt/cli writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json`
675
+ * @param options Objects containing `references`, `declarations`, `tsConfig`
676
+ * @returns Promise
677
+ */
678
+ 'prepare:types': (options: {
679
+ references: TSReference[];
680
+ declarations: string[];
681
+ tsConfig: VueTSConfig;
682
+ }) => HookResult;
683
+ /**
684
+ * Called when the dev server is loading.
685
+ * @param listenerServer The HTTP/HTTPS server object
686
+ * @param listener The server's listener object
687
+ * @returns Promise
688
+ */
689
+ 'listen': (listenerServer: Server | Server$1, listener: any) => HookResult;
690
+ /**
691
+ * Allows extending default schemas.
692
+ * @param schemas Schemas to be extend
693
+ * @returns void
694
+ */
695
+ 'schema:extend': (schemas: SchemaDefinition[]) => void;
696
+ /**
697
+ * Allows extending resolved schema.
698
+ * @param schema Schema object
699
+ * @returns void
700
+ */
701
+ 'schema:resolved': (schema: Schema) => void;
702
+ /**
703
+ * Called before writing the given schema.
704
+ * @param schema Schema object
705
+ * @returns void
706
+ */
707
+ 'schema:beforeWrite': (schema: Schema) => void;
708
+ /**
709
+ * Called after the schema is written.
710
+ * @returns void
711
+ */
712
+ 'schema:written': () => void;
713
+ /**
714
+ * Allows to extend Vite default context.
715
+ * @param viteBuildContext The vite build context object
716
+ * @returns Promise
717
+ */
718
+ 'vite:extend': (viteBuildContext: {
719
+ nuxt: Nuxt;
720
+ config: ViteConfig;
721
+ }) => HookResult;
722
+ /**
723
+ * Allows to extend Vite default config.
724
+ * @param viteInlineConfig The vite inline config object
725
+ * @param env Server or client
726
+ * @returns Promise
727
+ * @deprecated
728
+ */
729
+ 'vite:extendConfig': (viteInlineConfig: Readonly<ViteConfig>, env: {
730
+ isClient: boolean;
731
+ isServer: boolean;
732
+ }) => HookResult;
733
+ /**
734
+ * Allows to read the resolved Vite config.
735
+ * @param viteInlineConfig The vite inline config object
736
+ * @param env Server or client
737
+ * @returns Promise
738
+ * @deprecated
739
+ */
740
+ 'vite:configResolved': (viteInlineConfig: Readonly<ViteConfig>, env: {
741
+ isClient: boolean;
742
+ isServer: boolean;
743
+ }) => HookResult;
744
+ /**
745
+ * Called when the Vite server is created.
746
+ * @param viteServer Vite development server
747
+ * @param env Server or client
748
+ * @returns Promise
749
+ */
750
+ 'vite:serverCreated': (viteServer: ViteDevServer, env: {
751
+ isClient: boolean;
752
+ isServer: boolean;
753
+ }) => HookResult;
754
+ /**
755
+ * Called after Vite server is compiled.
756
+ * @returns Promise
757
+ */
758
+ 'vite:compiled': () => HookResult;
759
+ /**
760
+ * Called before configuring the webpack compiler.
761
+ * @param webpackConfigs Configs objects to be pushed to the compiler
762
+ * @returns Promise
763
+ */
764
+ 'webpack:config': (webpackConfigs: Configuration[]) => HookResult;
765
+ /**
766
+ * Allows to read the resolved webpack config
767
+ * @param webpackConfigs Configs objects to be pushed to the compiler
768
+ * @returns Promise
769
+ */
770
+ 'webpack:configResolved': (webpackConfigs: Readonly<Configuration>[]) => HookResult;
771
+ /**
772
+ * Called right before compilation.
773
+ * @param options The options to be added
774
+ * @returns Promise
775
+ */
776
+ 'webpack:compile': (options: {
777
+ name: string;
778
+ compiler: Compiler;
779
+ }) => HookResult;
780
+ /**
781
+ * Called after resources are loaded.
782
+ * @param options The compiler options
783
+ * @returns Promise
784
+ */
785
+ 'webpack:compiled': (options: {
786
+ name: string;
787
+ compiler: Compiler;
788
+ stats: Stats;
789
+ }) => HookResult;
790
+ /**
791
+ * Called on `change` on WebpackBar.
792
+ * @param shortPath the short path
793
+ * @returns void
794
+ */
795
+ 'webpack:change': (shortPath: string) => void;
796
+ /**
797
+ * Called on `done` if has errors on WebpackBar.
798
+ * @returns void
799
+ */
800
+ 'webpack:error': () => void;
801
+ /**
802
+ * Called on `allDone` on WebpackBar.
803
+ * @returns void
804
+ */
805
+ 'webpack:done': () => void;
806
+ /**
807
+ * Called on `progress` on WebpackBar.
808
+ * @param statesArray The array containing the states on progress
809
+ * @returns void
810
+ */
811
+ 'webpack:progress': (statesArray: any[]) => void;
812
+ /**
813
+ * Called before configuring the webpack compiler.
814
+ * @param webpackConfigs Configs objects to be pushed to the compiler
815
+ * @returns Promise
816
+ */
817
+ 'rspack:config': (webpackConfigs: Configuration[]) => HookResult;
818
+ /**
819
+ * Allows to read the resolved webpack config
820
+ * @param webpackConfigs Configs objects to be pushed to the compiler
821
+ * @returns Promise
822
+ */
823
+ 'rspack:configResolved': (webpackConfigs: Readonly<Configuration>[]) => HookResult;
824
+ /**
825
+ * Called right before compilation.
826
+ * @param options The options to be added
827
+ * @returns Promise
828
+ */
829
+ 'rspack:compile': (options: {
830
+ name: string;
831
+ compiler: Compiler;
832
+ }) => HookResult;
833
+ /**
834
+ * Called after resources are loaded.
835
+ * @param options The compiler options
836
+ * @returns Promise
837
+ */
838
+ 'rspack:compiled': (options: {
839
+ name: string;
840
+ compiler: Compiler;
841
+ stats: Stats;
842
+ }) => HookResult;
843
+ /**
844
+ * Called on `change` on WebpackBar.
845
+ * @param shortPath the short path
846
+ * @returns void
847
+ */
848
+ 'rspack:change': (shortPath: string) => void;
849
+ /**
850
+ * Called on `done` if has errors on WebpackBar.
851
+ * @returns void
852
+ */
853
+ 'rspack:error': () => void;
854
+ /**
855
+ * Called on `allDone` on WebpackBar.
856
+ * @returns void
857
+ */
858
+ 'rspack:done': () => void;
859
+ /**
860
+ * Called on `progress` on WebpackBar.
861
+ * @param statesArray The array containing the states on progress
862
+ * @returns void
863
+ */
864
+ 'rspack:progress': (statesArray: any[]) => void;
865
+ }
866
+ type MetaObjectRaw = SerializableHead;
867
+ type AppHeadMetaObject = MetaObjectRaw & {
868
+ /**
869
+ * The character encoding in which the document is encoded => `<meta charset="<value>" />`
870
+ * @default `'utf-8'`
871
+ */
872
+ charset?: string;
873
+ /**
874
+ * Configuration of the viewport (the area of the window in which web content can be seen),
875
+ * mapped to => `<meta name="viewport" content="<value>" />`
876
+ * @default `'width=device-width, initial-scale=1'`
877
+ */
878
+ viewport?: string;
879
+ };
880
+ type SerializableHtmlAttributes = GlobalAttributes & AriaAttributes & DataKeys;
881
+ interface ImportsOptions extends UnimportOptions {
882
+ /**
883
+ * Enable implicit auto import from Vue, Nuxt and module contributed utilities.
884
+ * Generate global TypeScript definitions.
885
+ * @default true
886
+ */
887
+ autoImport?: boolean;
888
+ /**
889
+ * Directories to scan for auto imports.
890
+ * @see https://nuxt.com/docs/guide/directory-structure/composables#how-files-are-scanned
891
+ * @default ['./composables', './utils']
892
+ */
893
+ dirs?: string[];
894
+ /**
895
+ * Enabled scan for local directories for auto imports.
896
+ * When this is disabled, `dirs` options will be ignored.
897
+ * @default true
898
+ */
899
+ scan?: boolean;
900
+ /**
901
+ * Assign auto imported utilities to `globalThis` instead of using built time transformation.
902
+ * @default false
903
+ */
904
+ global?: boolean;
905
+ transform?: {
906
+ exclude?: RegExp[];
907
+ include?: RegExp[];
908
+ };
909
+ /**
910
+ * Add polyfills for setInterval, requestIdleCallback, and others
911
+ * @default true
912
+ */
913
+ polyfills?: boolean;
914
+ }
915
+ interface ConfigSchema {
916
+ /**
917
+ * Configure Nuxt component auto-registration.
918
+ *
919
+ * Any components in the directories configured here can be used throughout your pages, layouts (and other components) without needing to explicitly import them.
920
+ *
921
+ * @see [`components/` directory documentation](https://nuxt.com/docs/guide/directory-structure/components)
922
+ */
923
+ components: boolean | ComponentsOptions | ComponentsOptions['dirs'];
924
+ /**
925
+ * Configure how Nuxt auto-imports composables into your application.
926
+ *
927
+ * @see [Nuxt documentation](https://nuxt.com/docs/guide/directory-structure/composables)
928
+ */
929
+ imports: ImportsOptions;
930
+ /**
931
+ * 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.
932
+ *
933
+ * Additionally, you can provide a glob pattern or an array of patterns to scan only certain files for pages.
934
+ *
935
+ * @example
936
+ * ```js
937
+ * pages: {
938
+ * pattern: ['**\/*\/*.vue', '!**\/*.spec.*'],
939
+ * }
940
+ * ```
941
+ */
942
+ pages: boolean | {
943
+ enabled?: boolean;
944
+ pattern?: string | string[];
945
+ };
946
+ /**
947
+ * Manually disable nuxt telemetry.
948
+ *
949
+ * @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information.
950
+ */
951
+ telemetry: boolean | Record<string, any>;
952
+ /**
953
+ * Enable Nuxt DevTools for development.
954
+ *
955
+ * Breaking changes for devtools might not reflect on the version of Nuxt.
956
+ *
957
+ * @see [Nuxt DevTools](https://devtools.nuxt.com/) for more information.
958
+ */
959
+ devtools: boolean | {
960
+ enabled: boolean;
961
+ [key: string]: any;
962
+ };
963
+ /**
964
+ * Vue.js config
965
+ */
966
+ vue: {
967
+ transformAssetUrls: AssetURLTagConfig;
968
+ /**
969
+ * Options for the Vue compiler that will be passed at build time.
970
+ *
971
+ * @see [Vue documentation](https://vuejs.org/api/application.html#app-config-compileroptions)
972
+ */
973
+ compilerOptions: CompilerOptions;
974
+ /**
975
+ * Include Vue compiler in runtime bundle.
976
+ *
977
+ * @default false
978
+ */
979
+ runtimeCompiler: boolean;
980
+ /**
981
+ * Enable reactive destructure for `defineProps`
982
+ *
983
+ * @default true
984
+ */
985
+ propsDestructure: boolean;
986
+ /**
987
+ * It is possible to pass configure the Vue app globally. Only serializable options may be set in your `nuxt.config`. All other options should be set at runtime in a Nuxt plugin..
988
+ *
989
+ * @see [Vue app config documentation](https://vuejs.org/api/application.html#app-config)
990
+ */
991
+ config: Serializable<AppConfig>;
992
+ };
993
+ /**
994
+ * Nuxt App configuration.
995
+ */
996
+ app: {
997
+ /**
998
+ * The base path of your Nuxt application.
999
+ *
1000
+ * For example:
1001
+ *
1002
+ * @default "/"
1003
+ *
1004
+ * @example
1005
+ * ```ts
1006
+ * export default defineNuxtConfig({
1007
+ * app: {
1008
+ * baseURL: '/prefix/'
1009
+ * }
1010
+ * })
1011
+ * ```
1012
+ *
1013
+ * This can also be set at runtime by setting the NUXT_APP_BASE_URL environment variable.
1014
+ *
1015
+ * @example
1016
+ * ```bash
1017
+ * NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs
1018
+ * ```
1019
+ */
1020
+ baseURL: string;
1021
+ /**
1022
+ * 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.
1023
+ *
1024
+ * @default "/_nuxt/"
1025
+ */
1026
+ buildAssetsDir: string;
1027
+ /**
1028
+ * An absolute URL to serve the public folder from (production-only).
1029
+ *
1030
+ * For example:
1031
+ *
1032
+ * @default ""
1033
+ *
1034
+ * @example
1035
+ * ```ts
1036
+ * export default defineNuxtConfig({
1037
+ * app: {
1038
+ * cdnURL: 'https://mycdn.org/'
1039
+ * }
1040
+ * })
1041
+ * ```
1042
+ *
1043
+ * This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable.
1044
+ *
1045
+ * @example
1046
+ * ```bash
1047
+ * NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs
1048
+ * ```
1049
+ */
1050
+ cdnURL: string;
1051
+ /**
1052
+ * Set default configuration for `<head>` on every page.
1053
+ *
1054
+ * @example
1055
+ * ```js
1056
+ * app: {
1057
+ * head: {
1058
+ * meta: [
1059
+ * // <meta name="viewport" content="width=device-width, initial-scale=1">
1060
+ * { name: 'viewport', content: 'width=device-width, initial-scale=1' }
1061
+ * ],
1062
+ * script: [
1063
+ * // <script src="https://myawesome-lib.js"></script>
1064
+ * { src: 'https://awesome-lib.js' }
1065
+ * ],
1066
+ * link: [
1067
+ * // <link rel="stylesheet" href="https://myawesome-lib.css">
1068
+ * { rel: 'stylesheet', href: 'https://awesome-lib.css' }
1069
+ * ],
1070
+ * // please note that this is an area that is likely to change
1071
+ * style: [
1072
+ * // <style>:root { color: red }</style>
1073
+ * { textContent: ':root { color: red }' }
1074
+ * ],
1075
+ * noscript: [
1076
+ * // <noscript>JavaScript is required</noscript>
1077
+ * { textContent: 'JavaScript is required' }
1078
+ * ]
1079
+ * }
1080
+ * }
1081
+ * ```
1082
+ */
1083
+ head: NuxtAppConfig['head'];
1084
+ /**
1085
+ * Default values for layout transitions.
1086
+ *
1087
+ * This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
1088
+ *
1089
+ * @default false
1090
+ *
1091
+ * @see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition)
1092
+ */
1093
+ layoutTransition: NuxtAppConfig['layoutTransition'];
1094
+ /**
1095
+ * Default values for page transitions.
1096
+ *
1097
+ * This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
1098
+ *
1099
+ * @default false
1100
+ *
1101
+ * @see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition)
1102
+ */
1103
+ pageTransition: NuxtAppConfig['pageTransition'];
1104
+ /**
1105
+ * Default values for view transitions.
1106
+ *
1107
+ * This only has an effect when **experimental** support for View Transitions is [enabled in your nuxt.config file](/docs/getting-started/transitions#view-transitions-api-experimental).
1108
+ * This can be overridden with `definePageMeta` on an individual page.
1109
+ *
1110
+ * @default false
1111
+ *
1112
+ * @see [Nuxt View Transition API docs](https://nuxt.com/docs/getting-started/transitions#view-transitions-api-experimental)
1113
+ */
1114
+ viewTransition: NuxtAppConfig['viewTransition'];
1115
+ /**
1116
+ * Default values for KeepAlive configuration between pages.
1117
+ *
1118
+ * This can be overridden with `definePageMeta` on an individual page. Only JSON-serializable values are allowed.
1119
+ *
1120
+ * @default false
1121
+ *
1122
+ * @see [Vue KeepAlive](https://vuejs.org/api/built-in-components.html#keepalive)
1123
+ */
1124
+ keepalive: NuxtAppConfig['keepalive'];
1125
+ /**
1126
+ * Customize Nuxt root element id.
1127
+ *
1128
+ * @default "__nuxt"
1129
+ *
1130
+ * @deprecated Prefer `rootAttrs.id` instead
1131
+ */
1132
+ rootId: string | false;
1133
+ /**
1134
+ * Customize Nuxt root element tag.
1135
+ *
1136
+ * @default "div"
1137
+ */
1138
+ rootTag: string;
1139
+ /**
1140
+ * Customize Nuxt root element id.
1141
+ *
1142
+ */
1143
+ rootAttrs: SerializableHtmlAttributes;
1144
+ /**
1145
+ * Customize Nuxt Teleport element tag.
1146
+ *
1147
+ * @default "div"
1148
+ */
1149
+ teleportTag: string;
1150
+ /**
1151
+ * Customize Nuxt Teleport element id.
1152
+ *
1153
+ * @default "teleports"
1154
+ *
1155
+ * @deprecated Prefer `teleportAttrs.id` instead
1156
+ */
1157
+ teleportId: string | false;
1158
+ /**
1159
+ * Customize Nuxt Teleport element attributes.
1160
+ *
1161
+ */
1162
+ teleportAttrs: SerializableHtmlAttributes;
1163
+ /**
1164
+ * Customize Nuxt SpaLoader element tag.
1165
+ *
1166
+ * @default "div"
1167
+ */
1168
+ spaLoaderTag: string;
1169
+ /**
1170
+ * Customize Nuxt SPA loading template element attributes.
1171
+ */
1172
+ spaLoaderAttrs: SerializableHtmlAttributes;
1173
+ };
1174
+ /**
1175
+ * Boolean or a path to an HTML file with the contents of which will be inserted into any HTML page rendered with `ssr: false`.
1176
+ *
1177
+ * - If it is unset, it will use `~/app/spa-loading-template.html` file in one of your layers, if it exists. - If it is false, no SPA loading indicator will be loaded. - If true, Nuxt will look for `~/app/spa-loading-template.html` file in one of your layers, or a
1178
+ * default Nuxt image will be used.
1179
+ * Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners).
1180
+ *
1181
+ * @example ~/app/spa-loading-template.html
1182
+ * ```html
1183
+ * <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md -->
1184
+ * <div class="loader"></div>
1185
+ * <style>
1186
+ * .loader {
1187
+ * display: block;
1188
+ * position: fixed;
1189
+ * z-index: 1031;
1190
+ * top: 50%;
1191
+ * left: 50%;
1192
+ * transform: translate(-50%, -50%);
1193
+ * width: 18px;
1194
+ * height: 18px;
1195
+ * box-sizing: border-box;
1196
+ * border: solid 2px transparent;
1197
+ * border-top-color: #000;
1198
+ * border-left-color: #000;
1199
+ * border-bottom-color: #efefef;
1200
+ * border-right-color: #efefef;
1201
+ * border-radius: 50%;
1202
+ * -webkit-animation: loader 400ms linear infinite;
1203
+ * animation: loader 400ms linear infinite;
1204
+ * }
1205
+ *
1206
+ * @-webkit-keyframes loader {
1207
+ * 0% {
1208
+ * -webkit-transform: translate(-50%, -50%) rotate(0deg);
1209
+ * }
1210
+ * 100% {
1211
+ * -webkit-transform: translate(-50%, -50%) rotate(360deg);
1212
+ * }
1213
+ * }
1214
+ * @keyframes loader {
1215
+ * 0% {
1216
+ * transform: translate(-50%, -50%) rotate(0deg);
1217
+ * }
1218
+ * 100% {
1219
+ * transform: translate(-50%, -50%) rotate(360deg);
1220
+ * }
1221
+ * }
1222
+ * </style>
1223
+ * ```
1224
+ */
1225
+ spaLoadingTemplate: string | boolean | undefined | null;
1226
+ /**
1227
+ * An array of nuxt app plugins.
1228
+ *
1229
+ * 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.
1230
+ * It can also be an object with `src` and `mode` keys.
1231
+ *
1232
+ * @note Plugins are also auto-registered from the `~/plugins` directory
1233
+ * and these plugins do not need to be listed in `nuxt.config` unless you
1234
+ * need to customize their order. All plugins are deduplicated by their src path.
1235
+ *
1236
+ * @see [`plugins/` directory documentation](https://nuxt.com/docs/guide/directory-structure/plugins)
1237
+ *
1238
+ * @example
1239
+ * ```js
1240
+ * plugins: [
1241
+ * '~/plugins/foo.client.js', // only in client side
1242
+ * '~/plugins/bar.server.js', // only in server side
1243
+ * '~/plugins/baz.js', // both client & server
1244
+ * { src: '~/plugins/both-sides.js' },
1245
+ * { src: '~/plugins/client-only.js', mode: 'client' }, // only on client side
1246
+ * { src: '~/plugins/server-only.js', mode: 'server' } // only on server side
1247
+ * ]
1248
+ * ```
1249
+ */
1250
+ plugins: (NuxtPlugin | string)[];
1251
+ /**
1252
+ * You can define the CSS files/modules/libraries you want to set globally (included in every page).
1253
+ *
1254
+ * 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.
1255
+ *
1256
+ * @example
1257
+ * ```js
1258
+ * css: [
1259
+ * // Load a Node.js module directly (here it's a Sass file).
1260
+ * 'bulma',
1261
+ * // CSS file in the project
1262
+ * '~/assets/css/main.css',
1263
+ * // SCSS file in the project
1264
+ * '~/assets/css/main.scss'
1265
+ * ]
1266
+ * ```
1267
+ */
1268
+ css: string[];
1269
+ /**
1270
+ * An object that allows us to configure the `unhead` nuxt module.
1271
+ */
1272
+ unhead: {
1273
+ /**
1274
+ * Enable the legacy compatibility mode for `unhead` module. This applies the following changes: - Disables Capo.js sorting - Adds the `DeprecationsPlugin`: supports `hid`, `vmid`, `children`, `body` - Adds the `PromisesPlugin`: supports promises as input
1275
+ *
1276
+ * @default false
1277
+ *
1278
+ * @see [`unhead` migration documentation](https://unhead.unjs.io/docs/typescript/head/guides/get-started/migration)
1279
+ *
1280
+ * @example
1281
+ * ```ts
1282
+ * export default defineNuxtConfig({
1283
+ * unhead: {
1284
+ * legacy: true
1285
+ * })
1286
+ * ```
1287
+ */
1288
+ legacy: boolean;
1289
+ /**
1290
+ * An object that will be passed to `renderSSRHead` to customize the output.
1291
+ *
1292
+ * @example
1293
+ * ```ts
1294
+ * export default defineNuxtConfig({
1295
+ * unhead: {
1296
+ * renderSSRHeadOptions: {
1297
+ * omitLineBreaks: true
1298
+ * }
1299
+ * })
1300
+ * ```
1301
+ */
1302
+ renderSSRHeadOptions: RenderSSRHeadOptions;
1303
+ };
1304
+ /**
1305
+ * The builder to use for bundling the Vue part of your application.
1306
+ *
1307
+ * @default "@nuxt/vite-builder"
1308
+ */
1309
+ builder: 'vite' | 'webpack' | 'rspack' | {
1310
+ bundle: (nuxt: Nuxt) => Promise<void>;
1311
+ };
1312
+ /**
1313
+ * Configures whether and how sourcemaps are generated for server and/or client bundles.
1314
+ *
1315
+ * If set to a single boolean, that value applies to both server and client. Additionally, the `'hidden'` option is also available for both server and client.
1316
+ * Available options for both client and server: - `true`: Generates sourcemaps and includes source references in the final bundle. - `false`: Does not generate any sourcemaps. - `'hidden'`: Generates sourcemaps but does not include references in the final bundle.
1317
+ */
1318
+ sourcemap: boolean | {
1319
+ server?: boolean | 'hidden';
1320
+ client?: boolean | 'hidden';
1321
+ };
1322
+ /**
1323
+ * Log level when building logs.
1324
+ *
1325
+ * 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
1326
+ *
1327
+ * @default "info"
1328
+ */
1329
+ logLevel: 'silent' | 'info' | 'verbose';
1330
+ /**
1331
+ * Shared build configuration.
1332
+ */
1333
+ build: {
1334
+ /**
1335
+ * 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.
1336
+ *
1337
+ * You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }).
1338
+ *
1339
+ * @example
1340
+ * ```js
1341
+ * transpile: [({ isLegacy }) => isLegacy && 'ky']
1342
+ * ```
1343
+ */
1344
+ transpile: Array<string | RegExp | ((ctx: {
1345
+ isClient?: boolean;
1346
+ isServer?: boolean;
1347
+ isDev: boolean;
1348
+ }) => string | RegExp | false)>;
1349
+ /**
1350
+ * It is recommended to use `addTemplate` from `@nuxt/kit` instead of this option.
1351
+ *
1352
+ * @example
1353
+ * ```js
1354
+ * templates: [
1355
+ * {
1356
+ * src: '~/modules/support/plugin.js', // `src` can be absolute or relative
1357
+ * dst: 'support.js', // `dst` is relative to project `.nuxt` dir
1358
+ * }
1359
+ * ]
1360
+ * ```
1361
+ */
1362
+ templates: NuxtTemplate<any>[];
1363
+ /**
1364
+ * Nuxt allows visualizing your bundles and how to optimize them.
1365
+ *
1366
+ * 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).
1367
+ *
1368
+ * @example
1369
+ * ```js
1370
+ * analyze: {
1371
+ * analyzerMode: 'static'
1372
+ * }
1373
+ * ```
1374
+ */
1375
+ analyze: boolean | {
1376
+ enabled?: boolean;
1377
+ } & ((0 extends 1 & BundleAnalyzerPlugin.Options ? Record<string, unknown> : BundleAnalyzerPlugin.Options) | PluginVisualizerOptions);
1378
+ };
1379
+ /**
1380
+ * Build time optimization configuration.
1381
+ */
1382
+ optimization: {
1383
+ /**
1384
+ * Functions to inject a key for.
1385
+ *
1386
+ * As long as the number of arguments passed to the function is lower 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.
1387
+ * The key will be unique based on the location of the function being invoked within the file.
1388
+ *
1389
+ */
1390
+ keyedComposables: KeyedFunction[];
1391
+ /**
1392
+ * Tree shake code from specific builds.
1393
+ *
1394
+ */
1395
+ treeShake: {
1396
+ /**
1397
+ * Tree shake composables from the server or client builds.
1398
+ *
1399
+ *
1400
+ * @example
1401
+ * ```js
1402
+ * treeShake: { client: { myPackage: ['useServerOnlyComposable'] } }
1403
+ * ```
1404
+ */
1405
+ composables: {
1406
+ server: Record<string, string[]>;
1407
+ client: Record<string, string[]>;
1408
+ };
1409
+ };
1410
+ /**
1411
+ * Options passed directly to the transformer from `unctx` that preserves async context after `await`.
1412
+ *
1413
+ */
1414
+ asyncTransforms: TransformerOptions;
1415
+ };
1416
+ /**
1417
+ * Extend project from multiple local or remote sources.
1418
+ *
1419
+ * Value should be either a string or array of strings pointing to source directories or config path relative to current config.
1420
+ * You can use `github:`, `gh:` `gitlab:` or `bitbucket:`
1421
+ *
1422
+ * @see [`c12` docs on extending config layers](https://github.com/unjs/c12#extending-config-layer-from-remote-sources)
1423
+ *
1424
+ * @see [`giget` documentation](https://github.com/unjs/giget)
1425
+ */
1426
+ extends: string | [string, SourceOptions?] | (string | [string, SourceOptions?])[];
1427
+ /**
1428
+ * Specify a compatibility date for your app.
1429
+ *
1430
+ * This is used to control the behavior of presets in Nitro, Nuxt Image and other modules that may change behavior without a major version bump.
1431
+ * We plan to improve the tooling around this feature in the future.
1432
+ */
1433
+ compatibilityDate: CompatibilityDateSpec;
1434
+ /**
1435
+ * Extend project from a local or remote source.
1436
+ *
1437
+ * Value should be a string pointing to source directory or config path relative to current config.
1438
+ * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
1439
+ */
1440
+ theme: string;
1441
+ /**
1442
+ * Define the root directory of your application.
1443
+ *
1444
+ * 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.
1445
+ * It is normally not needed to configure this option.
1446
+ *
1447
+ * @default "/<rootDir>"
1448
+ */
1449
+ rootDir: string;
1450
+ /**
1451
+ * Define the workspace directory of your application.
1452
+ *
1453
+ * Often this is used when in a monorepo setup. Nuxt will attempt to detect your workspace directory automatically, but you can override it here.
1454
+ * It is normally not needed to configure this option.
1455
+ *
1456
+ * @default "/<workspaceDir>"
1457
+ */
1458
+ workspaceDir: string;
1459
+ /**
1460
+ * Define the source directory of your Nuxt application.
1461
+ *
1462
+ * If a relative path is specified, it will be relative to the `rootDir`.
1463
+ *
1464
+ * @default "/<srcDir>"
1465
+ *
1466
+ * @example
1467
+ * ```js
1468
+ * export default {
1469
+ * srcDir: 'src/'
1470
+ * }
1471
+ * ```
1472
+ * This would work with the following folder structure:
1473
+ * ```bash
1474
+ * -| app/
1475
+ * ---| node_modules/
1476
+ * ---| nuxt.config.js
1477
+ * ---| package.json
1478
+ * ---| src/
1479
+ * ------| assets/
1480
+ * ------| components/
1481
+ * ------| layouts/
1482
+ * ------| middleware/
1483
+ * ------| pages/
1484
+ * ------| plugins/
1485
+ * ------| public/
1486
+ * ------| store/
1487
+ * ------| server/
1488
+ * ------| app.config.ts
1489
+ * ------| app.vue
1490
+ * ------| error.vue
1491
+ * ```
1492
+ */
1493
+ srcDir: string;
1494
+ /**
1495
+ * Define the server directory of your Nuxt application, where Nitro routes, middleware and plugins are kept.
1496
+ *
1497
+ * If a relative path is specified, it will be relative to your `rootDir`.
1498
+ *
1499
+ * @default "/<srcDir>/server"
1500
+ */
1501
+ serverDir: string;
1502
+ /**
1503
+ * Define the directory where your built Nuxt files will be placed.
1504
+ *
1505
+ * 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.
1506
+ *
1507
+ * @default "/<rootDir>/.nuxt"
1508
+ *
1509
+ * @example
1510
+ * ```js
1511
+ * export default {
1512
+ * buildDir: 'nuxt-build'
1513
+ * }
1514
+ * ```
1515
+ */
1516
+ buildDir: string;
1517
+ /**
1518
+ * For multi-app projects, the unique id of the Nuxt application.
1519
+ *
1520
+ * Defaults to `nuxt-app`.
1521
+ *
1522
+ * @default "nuxt-app"
1523
+ */
1524
+ appId: string;
1525
+ /**
1526
+ * A unique identifier matching the build. This may contain the hash of the current state of the project.
1527
+ *
1528
+ * @default "f9b9e91a-b239-45f5-b381-a81997def0c5"
1529
+ */
1530
+ buildId: string;
1531
+ /**
1532
+ * Used to set the modules directories for path resolving (for example, webpack's `resolveLoading`, `nodeExternals` and `postcss`).
1533
+ *
1534
+ * The configuration path is relative to `options.rootDir` (default is current working directory).
1535
+ * Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository.
1536
+ *
1537
+ * @default ["/<rootDir>/node_modules"]
1538
+ *
1539
+ * @example
1540
+ * ```js
1541
+ * export default {
1542
+ * modulesDir: ['../../node_modules']
1543
+ * }
1544
+ * ```
1545
+ */
1546
+ modulesDir: Array<string>;
1547
+ /**
1548
+ * The directory where Nuxt will store the generated files when running `nuxt analyze`.
1549
+ *
1550
+ * If a relative path is specified, it will be relative to your `rootDir`.
1551
+ *
1552
+ * @default "/<rootDir>/.nuxt/analyze"
1553
+ */
1554
+ analyzeDir: string;
1555
+ /**
1556
+ * Whether Nuxt is running in development mode.
1557
+ *
1558
+ * Normally, you should not need to set this.
1559
+ *
1560
+ * @default false
1561
+ */
1562
+ dev: boolean;
1563
+ /**
1564
+ * Whether your app is being unit tested.
1565
+ *
1566
+ * @default false
1567
+ */
1568
+ test: boolean;
1569
+ /**
1570
+ * Set to `true` to enable debug mode.
1571
+ *
1572
+ * At the moment, it prints out hook names and timings on the server, and logs hook arguments as well in the browser.
1573
+ * You can also set this to an object to enable specific debug options.
1574
+ *
1575
+ * @default false
1576
+ */
1577
+ debug: boolean | (NuxtDebugOptions) | undefined;
1578
+ /**
1579
+ * 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.
1580
+ *
1581
+ * @default true
1582
+ */
1583
+ ssr: boolean;
1584
+ /**
1585
+ * Modules are Nuxt extensions which can extend its core functionality and add endless integrations.
1586
+ *
1587
+ * 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.
1588
+ * 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.
1589
+ *
1590
+ * @note Modules are executed sequentially so the order is important. First, the modules defined in `nuxt.config.ts` are loaded. Then, modules found in the `modules/`
1591
+ * directory are executed, and they load in alphabetical order.
1592
+ *
1593
+ * @example
1594
+ * ```js
1595
+ * modules: [
1596
+ * // Using package name
1597
+ * '@nuxtjs/axios',
1598
+ * // Relative to your project srcDir
1599
+ * '~/modules/awesome.js',
1600
+ * // Providing options
1601
+ * ['@nuxtjs/google-analytics', { ua: 'X1234567' }],
1602
+ * // Inline definition
1603
+ * function () {}
1604
+ * ]
1605
+ * ```
1606
+ */
1607
+ modules: (NuxtModule<any> | string | [NuxtModule | string, Record<string, any>] | undefined | null | false)[];
1608
+ /**
1609
+ * Customize default directory structure used by Nuxt.
1610
+ *
1611
+ * It is better to stick with defaults unless needed.
1612
+ */
1613
+ dir: {
1614
+ /** @default "app" */app: string;
1615
+ /**
1616
+ * The assets directory (aliased as `~assets` in your build).
1617
+ *
1618
+ * @default "assets"
1619
+ */
1620
+ assets: string;
1621
+ /**
1622
+ * The layouts directory, each file of which will be auto-registered as a Nuxt layout.
1623
+ *
1624
+ * @default "layouts"
1625
+ */
1626
+ layouts: string;
1627
+ /**
1628
+ * The middleware directory, each file of which will be auto-registered as a Nuxt middleware.
1629
+ *
1630
+ * @default "middleware"
1631
+ */
1632
+ middleware: string;
1633
+ /**
1634
+ * The modules directory, each file in which will be auto-registered as a Nuxt module.
1635
+ *
1636
+ * @default "modules"
1637
+ */
1638
+ modules: string;
1639
+ /**
1640
+ * The directory which will be processed to auto-generate your application page routes.
1641
+ *
1642
+ * @default "pages"
1643
+ */
1644
+ pages: string;
1645
+ /**
1646
+ * The plugins directory, each file of which will be auto-registered as a Nuxt plugin.
1647
+ *
1648
+ * @default "plugins"
1649
+ */
1650
+ plugins: string;
1651
+ /**
1652
+ * The shared directory. This directory is shared between the app and the server.
1653
+ *
1654
+ * @default "shared"
1655
+ */
1656
+ shared: string;
1657
+ /**
1658
+ * 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.
1659
+ *
1660
+ * @default "public"
1661
+ */
1662
+ public: string;
1663
+ /**
1664
+ * @default "public"
1665
+ *
1666
+ * @deprecated use `dir.public` option instead
1667
+ */
1668
+ static: string;
1669
+ };
1670
+ /**
1671
+ * The extensions that should be resolved by the Nuxt resolver.
1672
+ *
1673
+ * @default [".js",".jsx",".mjs",".ts",".tsx",".vue"]
1674
+ */
1675
+ extensions: Array<string>;
1676
+ /**
1677
+ * You can improve your DX by defining additional aliases to access custom directories within your JavaScript and CSS.
1678
+ *
1679
+ * @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access
1680
+ * your alias by prefixing it with `~`.
1681
+ *
1682
+ * @note These aliases will be automatically added to the generated `.nuxt/tsconfig.json` so you can get full
1683
+ * type support and path auto-complete. In case you need to extend options provided by `./.nuxt/tsconfig.json`
1684
+ * further, make sure to add them here or within the `typescript.tsConfig` property in `nuxt.config`.
1685
+ *
1686
+ * @example
1687
+ * ```js
1688
+ * export default {
1689
+ * alias: {
1690
+ * 'images': fileURLToPath(new URL('./assets/images', import.meta.url)),
1691
+ * 'style': fileURLToPath(new URL('./assets/style', import.meta.url)),
1692
+ * 'data': fileURLToPath(new URL('./assets/other/data', import.meta.url))
1693
+ * }
1694
+ * }
1695
+ * ```
1696
+ *
1697
+ * ```html
1698
+ * <template>
1699
+ * <img src="~images/main-bg.jpg">
1700
+ * </template>
1701
+ *
1702
+ * <script>
1703
+ * import data from 'data/test.json'
1704
+ * </script>
1705
+ *
1706
+ * <style>
1707
+ * // Uncomment the below
1708
+ * //@import '~style/variables.scss';
1709
+ * //@import '~style/utils.scss';
1710
+ * //@import '~style/base.scss';
1711
+ * body {
1712
+ * background-image: url('~images/main-bg.jpg');
1713
+ * }
1714
+ * </style>
1715
+ * ```
1716
+ */
1717
+ alias: Record<string, string>;
1718
+ /**
1719
+ * Pass options directly to `node-ignore` (which is used by Nuxt to ignore files).
1720
+ *
1721
+ * @see [node-ignore](https://github.com/kaelzhang/node-ignore)
1722
+ *
1723
+ * @example
1724
+ * ```js
1725
+ * ignoreOptions: {
1726
+ * ignorecase: false
1727
+ * }
1728
+ * ```
1729
+ */
1730
+ ignoreOptions: Options$3;
1731
+ /**
1732
+ * Any file in `pages/`, `layouts/`, `middleware/`, and `public/` directories will be ignored during the build process if its filename starts with the prefix specified by `ignorePrefix`. This is intended to prevent certain files from being processed or served in the built application. By default, the `ignorePrefix` is set to '-', ignoring any files starting with '-'.
1733
+ *
1734
+ * @default "-"
1735
+ */
1736
+ ignorePrefix: string;
1737
+ /**
1738
+ * More customizable than `ignorePrefix`: all files matching glob patterns specified inside the `ignore` array will be ignored in building.
1739
+ *
1740
+ * @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}","**\/*.sock",".nuxt/analyze",".nuxt","**\/-*.*"]
1741
+ */
1742
+ ignore: Array<string>;
1743
+ /**
1744
+ * The watch property lets you define patterns that will restart the Nuxt dev server when changed.
1745
+ *
1746
+ * 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).
1747
+ */
1748
+ watch: Array<string | RegExp>;
1749
+ /**
1750
+ * The watchers property lets you overwrite watchers configuration in your `nuxt.config`.
1751
+ */
1752
+ watchers: {
1753
+ /**
1754
+ * An array of event types, which, when received, will cause the watcher to restart.
1755
+ */
1756
+ rewatchOnRawEvents: string[];
1757
+ /**
1758
+ * `watchOptions` to pass directly to webpack.
1759
+ *
1760
+ * @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions).
1761
+ */
1762
+ webpack: {
1763
+ /** @default 1000 */aggregateTimeout: number;
1764
+ };
1765
+ /**
1766
+ * Options to pass directly to `chokidar`.
1767
+ *
1768
+ * @see [chokidar](https://github.com/paulmillr/chokidar#api)
1769
+ */
1770
+ chokidar: ChokidarOptions;
1771
+ };
1772
+ /**
1773
+ * Hooks are listeners to Nuxt events that are typically used in modules, but are also available in `nuxt.config`.
1774
+ *
1775
+ * Internally, hooks follow a naming pattern using colons (e.g., build:done).
1776
+ * For ease of configuration, you can also structure them as an hierarchical object in `nuxt.config` (as below).
1777
+ *
1778
+ * @example
1779
+ * ```js
1780
+ * import fs from 'node:fs'
1781
+ * import path from 'node:path'
1782
+ * export default {
1783
+ * hooks: {
1784
+ * build: {
1785
+ * done(builder) {
1786
+ * const extraFilePath = path.join(
1787
+ * builder.nuxt.options.buildDir,
1788
+ * 'extra-file'
1789
+ * )
1790
+ * fs.writeFileSync(extraFilePath, 'Something extra')
1791
+ * }
1792
+ * }
1793
+ * }
1794
+ * }
1795
+ * ```
1796
+ */
1797
+ hooks: NuxtHooks;
1798
+ /**
1799
+ * Runtime config allows passing dynamic config and environment variables to the Nuxt app context.
1800
+ *
1801
+ * The value of this object is accessible from server only using `useRuntimeConfig`.
1802
+ * It mainly should hold _private_ configuration which is not exposed on the frontend. This could include a reference to your API secret tokens.
1803
+ * Anything under `public` and `app` will be exposed to the frontend as well.
1804
+ * 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.
1805
+ *
1806
+ * @example
1807
+ * ```js
1808
+ * export default {
1809
+ * runtimeConfig: {
1810
+ * apiKey: '', // Default to an empty string, automatically set at runtime using process.env.NUXT_API_KEY
1811
+ * public: {
1812
+ * baseURL: '' // Exposed to the frontend as well.
1813
+ * }
1814
+ * }
1815
+ * }
1816
+ * ```
1817
+ */
1818
+ runtimeConfig: RuntimeConfig;
1819
+ /**
1820
+ * Additional app configuration
1821
+ *
1822
+ * 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.
1823
+ */
1824
+ appConfig: AppConfig$1;
1825
+ devServer: {
1826
+ /**
1827
+ * Whether to enable HTTPS.
1828
+ *
1829
+ * @default false
1830
+ *
1831
+ * @example
1832
+ * ```ts
1833
+ * export default defineNuxtConfig({
1834
+ * devServer: {
1835
+ * https: {
1836
+ * key: './server.key',
1837
+ * cert: './server.crt'
1838
+ * }
1839
+ * }
1840
+ * })
1841
+ * ```
1842
+ */
1843
+ https: boolean | {
1844
+ key: string;
1845
+ cert: string;
1846
+ } | {
1847
+ pfx: string;
1848
+ passphrase: string;
1849
+ };
1850
+ /**
1851
+ * Dev server listening port
1852
+ *
1853
+ * @default 3000
1854
+ */
1855
+ port: number;
1856
+ /**
1857
+ * Dev server listening host
1858
+ *
1859
+ */
1860
+ host: string | undefined;
1861
+ /**
1862
+ * Listening dev server URL.
1863
+ *
1864
+ * 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).
1865
+ *
1866
+ * @default "http://localhost:3000"
1867
+ */
1868
+ url: string;
1869
+ /**
1870
+ * Template to show a loading screen
1871
+ *
1872
+ */
1873
+ loadingTemplate: (data: {
1874
+ loading?: string;
1875
+ }) => string;
1876
+ /**
1877
+ * Set CORS options for the dev server
1878
+ *
1879
+ */
1880
+ cors: 'origin' extends keyof H3CorsOptions ? 'origin' extends keyof CorsOptions ? CorsOptions | H3CorsOptions : H3CorsOptions : CorsOptions;
1881
+ };
1882
+ /**
1883
+ * `future` is for early opting-in to new features that will become default in a future (possibly major) version of the framework.
1884
+ */
1885
+ future: {
1886
+ /**
1887
+ * Enable early access to Nuxt v4 features or flags.
1888
+ *
1889
+ * Setting `compatibilityVersion` to `4` changes defaults throughout your Nuxt configuration, but you can granularly re-enable Nuxt v3 behaviour when testing (see example). Please file issues if so, so that we can address in Nuxt or in the ecosystem.
1890
+ *
1891
+ * @default 3
1892
+ *
1893
+ * @example
1894
+ * ```ts
1895
+ * export default defineNuxtConfig({
1896
+ * future: {
1897
+ * compatibilityVersion: 4,
1898
+ * },
1899
+ * // To re-enable _all_ Nuxt v3 behaviour, set the following options:
1900
+ * srcDir: '.',
1901
+ * dir: {
1902
+ * app: 'app'
1903
+ * },
1904
+ * experimental: {
1905
+ * compileTemplate: true,
1906
+ * templateUtils: true,
1907
+ * relativeWatchPaths: true,
1908
+ * resetAsyncDataToUndefined: true,
1909
+ * defaults: {
1910
+ * useAsyncData: {
1911
+ * deep: true
1912
+ * }
1913
+ * }
1914
+ * },
1915
+ * unhead: {
1916
+ * renderSSRHeadOptions: {
1917
+ * omitLineBreaks: false
1918
+ * }
1919
+ * }
1920
+ * })
1921
+ * ```
1922
+ */
1923
+ compatibilityVersion: 3 | 4;
1924
+ /**
1925
+ * This enables early access to the experimental multi-app support.
1926
+ *
1927
+ * @default false
1928
+ *
1929
+ * @see [Nuxt Issue #21635](https://github.com/nuxt/nuxt/issues/21635)
1930
+ */
1931
+ multiApp: boolean;
1932
+ /**
1933
+ * This enables 'Bundler' module resolution mode for TypeScript, which is the recommended setting for frameworks like Nuxt and Vite.
1934
+ *
1935
+ * It improves type support when using modern libraries with `exports`.
1936
+ * You can set it to false to use the legacy 'Node' mode, which is the default for TypeScript.
1937
+ *
1938
+ * @default true
1939
+ *
1940
+ * @see [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669)
1941
+ */
1942
+ typescriptBundlerResolution: boolean;
1943
+ };
1944
+ /**
1945
+ * Some features of Nuxt are available on an opt-in basis, or can be disabled based on your needs.
1946
+ */
1947
+ features: {
1948
+ /**
1949
+ * Inline styles when rendering HTML (currently vite only).
1950
+ *
1951
+ * 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.
1952
+ *
1953
+ * @default true
1954
+ */
1955
+ inlineStyles: boolean | ((id?: string) => boolean);
1956
+ /**
1957
+ * Stream server logs to the client as you are developing. These logs can be handled in the `dev:ssr-logs` hook.
1958
+ *
1959
+ * If set to `silent`, the logs will not be printed to the browser console.
1960
+ *
1961
+ * @default false
1962
+ */
1963
+ devLogs: boolean | 'silent';
1964
+ /**
1965
+ * Turn off rendering of Nuxt scripts and JS resource hints. You can also disable scripts more granularly within `routeRules`.
1966
+ *
1967
+ * If set to 'production' or `true`, JS will be disabled in production mode only.
1968
+ *
1969
+ * @default false
1970
+ */
1971
+ noScripts: 'production' | 'all' | boolean;
1972
+ };
1973
+ experimental: {
1974
+ /**
1975
+ * Enable to use experimental decorators in Nuxt and Nitro.
1976
+ *
1977
+ * @default false
1978
+ *
1979
+ * @see https://github.com/tc39/proposal-decorators
1980
+ */
1981
+ decorators: boolean;
1982
+ /**
1983
+ * Set to true to generate an async entry point for the Vue bundle (for module federation support).
1984
+ *
1985
+ * @default false
1986
+ */
1987
+ asyncEntry: boolean;
1988
+ /**
1989
+ * Externalize `vue`, `@vue/*` and `vue-router` when building.
1990
+ *
1991
+ * @default true
1992
+ *
1993
+ * @see [Nuxt Issue #13632](https://github.com/nuxt/nuxt/issues/13632)
1994
+ */
1995
+ externalVue: boolean;
1996
+ /**
1997
+ * Enable accessing `appConfig` from server routes.
1998
+ *
1999
+ * @default true
2000
+ * @deprecated This option is not recommended.
2001
+ */
2002
+ serverAppConfig: boolean;
2003
+ /**
2004
+ * Tree shakes contents of client-only components from server bundle.
2005
+ *
2006
+ * @default true
2007
+ *
2008
+ * @see [Nuxt PR #5750](https://github.com/nuxt/framework/pull/5750)
2009
+ *
2010
+ * @deprecated This option will no longer be configurable in Nuxt v4
2011
+ */
2012
+ treeshakeClientOnly: boolean;
2013
+ /**
2014
+ * Emit `app:chunkError` hook when there is an error loading vite/webpack chunks.
2015
+ *
2016
+ * By default, Nuxt will also perform a reload of the new route when a chunk fails to load when navigating to a new route (`automatic`).
2017
+ * Setting `automatic-immediate` will lead Nuxt to perform a reload of the current route right when a chunk fails to load (instead of waiting for navigation).
2018
+ * You can disable automatic handling by setting this to `false`, or handle chunk errors manually by setting it to `manual`.
2019
+ *
2020
+ * @default "automatic"
2021
+ *
2022
+ * @see [Nuxt PR #19038](https://github.com/nuxt/nuxt/pull/19038)
2023
+ */
2024
+ emitRouteChunkError: false | 'manual' | 'automatic' | 'automatic-immediate';
2025
+ /**
2026
+ * 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.
2027
+ *
2028
+ * By enabling this option a mixin will be injected to keep the `$route` template object in sync with Nuxt's managed `useRoute()`.
2029
+ *
2030
+ * @default true
2031
+ */
2032
+ templateRouteInjection: boolean;
2033
+ /**
2034
+ * Whether to restore Nuxt app state from `sessionStorage` when reloading the page after a chunk error or manual `reloadNuxtApp()` call.
2035
+ *
2036
+ * 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.
2037
+ * 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.
2038
+ *
2039
+ * @default false
2040
+ */
2041
+ restoreState: boolean;
2042
+ /**
2043
+ * Render JSON payloads with support for revivifying complex types.
2044
+ *
2045
+ * @default true
2046
+ */
2047
+ renderJsonPayloads: boolean;
2048
+ /**
2049
+ * Disable vue server renderer endpoint within nitro.
2050
+ *
2051
+ * @default false
2052
+ */
2053
+ noVueServer: boolean;
2054
+ /**
2055
+ * When this option is enabled (by default) payload of pages that are prerendered are extracted
2056
+ *
2057
+ * @default true
2058
+ */
2059
+ payloadExtraction: boolean | undefined;
2060
+ /**
2061
+ * Whether to enable the experimental `<NuxtClientFallback>` component for rendering content on the client if there's an error in SSR.
2062
+ *
2063
+ * @default false
2064
+ */
2065
+ clientFallback: boolean;
2066
+ /**
2067
+ * Enable cross-origin prefetch using the Speculation Rules API.
2068
+ *
2069
+ * @default false
2070
+ */
2071
+ crossOriginPrefetch: boolean;
2072
+ /**
2073
+ * Enable View Transition API integration with client-side router.
2074
+ *
2075
+ * @default false
2076
+ *
2077
+ * @see [View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions)
2078
+ */
2079
+ viewTransition: boolean | 'always';
2080
+ /**
2081
+ * Write early hints when using node server.
2082
+ *
2083
+ * @default false
2084
+ *
2085
+ * @note nginx does not support 103 Early hints in the current version.
2086
+ */
2087
+ writeEarlyHints: boolean;
2088
+ /**
2089
+ * Experimental component islands support with `<NuxtIsland>` and `.island.vue` files.
2090
+ *
2091
+ * By default it is set to 'auto', which means it will be enabled only when there are islands, server components or server pages in your app.
2092
+ *
2093
+ * @default "auto"
2094
+ */
2095
+ componentIslands: true | 'auto' | 'local' | 'local+remote' | Partial<{
2096
+ remoteIsland: boolean;
2097
+ selectiveClient: boolean | 'deep';
2098
+ }> | false;
2099
+ /**
2100
+ * Config schema support
2101
+ *
2102
+ * @default true
2103
+ *
2104
+ * @see [Nuxt Issue #15592](https://github.com/nuxt/nuxt/issues/15592)
2105
+ *
2106
+ * @deprecated This option will no longer be configurable in Nuxt v4
2107
+ */
2108
+ configSchema: boolean;
2109
+ /**
2110
+ * Whether or not to add a compatibility layer for modules, plugins or user code relying on the old `@vueuse/head` API.
2111
+ *
2112
+ * This is disabled to reduce the client-side bundle by ~0.5kb.
2113
+ *
2114
+ * @default false
2115
+ *
2116
+ * @deprecated This feature will be removed in Nuxt v4.
2117
+ */
2118
+ polyfillVueUseHead: boolean;
2119
+ /**
2120
+ * Allow disabling Nuxt SSR responses by setting the `x-nuxt-no-ssr` header.
2121
+ *
2122
+ * @default false
2123
+ *
2124
+ * @deprecated This feature will be removed in Nuxt v4.
2125
+ */
2126
+ respectNoSSRHeader: boolean;
2127
+ /**
2128
+ * Resolve `~`, `~~`, `@` and `@@` aliases located within layers with respect to their layer source and root directories.
2129
+ *
2130
+ * @default true
2131
+ */
2132
+ localLayerAliases: boolean;
2133
+ /**
2134
+ * Enable the new experimental typed router using [unplugin-vue-router](https://github.com/posva/unplugin-vue-router).
2135
+ *
2136
+ * @default false
2137
+ */
2138
+ typedPages: boolean;
2139
+ /**
2140
+ * Use app manifests to respect route rules on client-side.
2141
+ *
2142
+ * @default true
2143
+ */
2144
+ appManifest: boolean;
2145
+ /**
2146
+ * Set the time interval (in ms) to check for new builds. Disabled when `experimental.appManifest` is `false`.
2147
+ *
2148
+ * Set to `false` to disable.
2149
+ *
2150
+ * @default 3600000
2151
+ */
2152
+ checkOutdatedBuildInterval: number | false;
2153
+ /**
2154
+ * Set an alternative watcher that will be used as the watching service for Nuxt.
2155
+ *
2156
+ * Nuxt uses 'chokidar-granular' if your source directory is the same as your root directory . This will ignore top-level directories (like `node_modules` and `.git`) that are excluded from watching.
2157
+ * You can set this instead to `parcel` to use `@parcel/watcher`, which may improve performance in large projects or on Windows platforms.
2158
+ * You can also set this to `chokidar` to watch all files in your source directory.
2159
+ *
2160
+ * @default "chokidar"
2161
+ *
2162
+ * @see [chokidar](https://github.com/paulmillr/chokidar)
2163
+ *
2164
+ * @see [@parcel/watcher](https://github.com/parcel-bundler/watcher)
2165
+ */
2166
+ watcher: 'chokidar' | 'parcel' | 'chokidar-granular';
2167
+ /**
2168
+ * Enable native async context to be accessible for nested composables
2169
+ *
2170
+ * @default false
2171
+ *
2172
+ * @see [Nuxt PR #20918](https://github.com/nuxt/nuxt/pull/20918)
2173
+ */
2174
+ asyncContext: boolean;
2175
+ /**
2176
+ * Use new experimental head optimisations:
2177
+ *
2178
+ * - 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
2179
+ *
2180
+ * @default true
2181
+ *
2182
+ * @see [Nuxt Discussion #22632](https://github.com/nuxt/nuxt/discussions/22632)
2183
+ */
2184
+ headNext: boolean;
2185
+ /**
2186
+ * Allow defining `routeRules` directly within your `~/pages` directory using `defineRouteRules`.
2187
+ *
2188
+ * 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.
2189
+ * 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`.
2190
+ *
2191
+ * @default false
2192
+ */
2193
+ inlineRouteRules: boolean;
2194
+ /**
2195
+ * Allow exposing some route metadata defined in `definePageMeta` at build-time to modules (alias, name, path, redirect, props, middleware).
2196
+ *
2197
+ * This only works with static or strings/arrays rather than variables or conditional assignment.
2198
+ *
2199
+ * @default true
2200
+ *
2201
+ * @see [Nuxt Issues #24770](https://github.com/nuxt/nuxt/issues/24770)
2202
+ */
2203
+ scanPageMeta: boolean | 'after-resolve';
2204
+ /**
2205
+ * Configure additional keys to extract from the page metadata when using `scanPageMeta`.
2206
+ *
2207
+ * This allows modules to access additional metadata from the page metadata. It's recommended to augment the NuxtPage types with your keys.
2208
+ *
2209
+ */
2210
+ extraPageMetaExtractionKeys: string[];
2211
+ /**
2212
+ * Automatically share payload _data_ between pages that are prerendered. This can result in a significant performance improvement when prerendering sites that use `useAsyncData` or `useFetch` and fetch the same data in different pages.
2213
+ *
2214
+ * It is particularly important when enabling this feature to make sure that any unique key of your data is always resolvable to the same data. For example, if you are using `useAsyncData` to fetch data related to a particular page, you should provide a key that uniquely matches that data. (`useFetch` should do this automatically for you.)
2215
+ *
2216
+ * @default false
2217
+ *
2218
+ * @example
2219
+ * ```ts
2220
+ * // This would be unsafe in a dynamic page (e.g. `[slug].vue`) because the route slug makes a difference
2221
+ * // to the data fetched, but Nuxt can't know that because it's not reflected in the key.
2222
+ * const route = useRoute()
2223
+ * const { data } = await useAsyncData(async () => {
2224
+ * return await $fetch(`/api/my-page/${route.params.slug}`)
2225
+ * })
2226
+ * // Instead, you should use a key that uniquely identifies the data fetched.
2227
+ * const { data } = await useAsyncData(route.params.slug, async () => {
2228
+ * return await $fetch(`/api/my-page/${route.params.slug}`)
2229
+ * })
2230
+ * ```
2231
+ */
2232
+ sharedPrerenderData: boolean;
2233
+ /**
2234
+ * Enables CookieStore support to listen for cookie updates (if supported by the browser) and refresh `useCookie` ref values.
2235
+ *
2236
+ * @default true
2237
+ *
2238
+ * @see [CookieStore](https://developer.mozilla.org/en-US/docs/Web/API/CookieStore)
2239
+ */
2240
+ cookieStore: boolean;
2241
+ /**
2242
+ * Enable experimental Vite Environment API
2243
+ */
2244
+ viteEnvironmentApi: boolean;
2245
+ /**
2246
+ * This allows specifying the default options for core Nuxt components and composables.
2247
+ *
2248
+ * These options will likely be moved elsewhere in the future, such as into `app.config` or into the `app/` directory.
2249
+ *
2250
+ */
2251
+ defaults: {
2252
+ nuxtLink: NuxtLinkOptions;
2253
+ /**
2254
+ * Options that apply to `useAsyncData` (and also therefore `useFetch`)
2255
+ */
2256
+ useAsyncData: {
2257
+ /** @default "null" */value: 'undefined' | 'null'; /** @default "null" */
2258
+ errorValue: 'undefined' | 'null'; /** @default true */
2259
+ deep: boolean;
2260
+ };
2261
+ useFetch: Pick<FetchOptions, 'timeout' | 'retry' | 'retryDelay' | 'retryStatusCodes'>;
2262
+ };
2263
+ /**
2264
+ * Automatically polyfill Node.js imports in the client build using `unenv`.
2265
+ *
2266
+ * @default false
2267
+ *
2268
+ * @see [unenv](https://github.com/unjs/unenv)
2269
+ *
2270
+ * **Note:** To make globals like `Buffer` work in the browser, you need to manually inject them.
2271
+ *
2272
+ * ```ts
2273
+ * import { Buffer } from 'node:buffer'
2274
+ *
2275
+ * globalThis.Buffer = globalThis.Buffer || Buffer
2276
+ * ```
2277
+ */
2278
+ clientNodeCompat: boolean;
2279
+ /**
2280
+ * Whether to use `lodash.template` to compile Nuxt templates.
2281
+ *
2282
+ * This flag will be removed with the release of v4 and exists only for advance testing within Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel).
2283
+ *
2284
+ * @default true
2285
+ */
2286
+ compileTemplate: boolean;
2287
+ /**
2288
+ * Whether to provide a legacy `templateUtils` object (with `serialize`, `importName` and `importSources`) when compiling Nuxt templates.
2289
+ *
2290
+ * This flag will be removed with the release of v4 and exists only for advance testing within Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel).
2291
+ *
2292
+ * @default true
2293
+ */
2294
+ templateUtils: boolean;
2295
+ /**
2296
+ * Whether to provide relative paths in the `builder:watch` hook.
2297
+ *
2298
+ * This flag will be removed with the release of v4 and exists only for advance testing within Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel).
2299
+ *
2300
+ * @default true
2301
+ */
2302
+ relativeWatchPaths: boolean;
2303
+ /**
2304
+ * Whether `clear` and `clearNuxtData` should reset async data to its _default_ value or update it to `null`/`undefined`.
2305
+ *
2306
+ * @default true
2307
+ */
2308
+ resetAsyncDataToUndefined: boolean;
2309
+ /**
2310
+ * Wait for a single animation frame before navigation, which gives an opportunity for the browser to repaint, acknowledging user interaction.
2311
+ *
2312
+ * It can reduce INP when navigating on prerendered routes.
2313
+ *
2314
+ * @default true
2315
+ */
2316
+ navigationRepaint: boolean;
2317
+ /**
2318
+ * Cache Nuxt/Nitro build artifacts based on a hash of the configuration and source files.
2319
+ *
2320
+ * This only works for source files within `srcDir` and `serverDir` for the Vue/Nitro parts of your app.
2321
+ *
2322
+ * @default false
2323
+ */
2324
+ buildCache: boolean;
2325
+ /**
2326
+ * Ensure that auto-generated Vue component names match the full component name you would use to auto-import the component.
2327
+ *
2328
+ * @default false
2329
+ */
2330
+ normalizeComponentNames: boolean;
2331
+ /**
2332
+ * Keep showing the spa-loading-template until suspense:resolve
2333
+ *
2334
+ * @default "within"
2335
+ *
2336
+ * @see [Nuxt Issues #24770](https://github.com/nuxt/nuxt/issues/21721)
2337
+ */
2338
+ spaLoadingTemplateLocation: 'body' | 'within';
2339
+ /**
2340
+ * Enable timings for Nuxt application hooks in the performance panel of Chromium-based browsers.
2341
+ *
2342
+ * This feature adds performance markers for Nuxt hooks, allowing you to track their execution time in the browser's Performance tab. This is particularly useful for debugging performance issues.
2343
+ *
2344
+ * @default false
2345
+ *
2346
+ * @example
2347
+ * ```ts
2348
+ * // nuxt.config.ts
2349
+ * export default defineNuxtConfig({
2350
+ * experimental: {
2351
+ * // Enable performance markers for Nuxt hooks in browser devtools
2352
+ * browserDevtoolsTiming: true
2353
+ * }
2354
+ * })
2355
+ * ```
2356
+ *
2357
+ * @see [PR #29922](https://github.com/nuxt/nuxt/pull/29922)
2358
+ *
2359
+ * @see [Chrome DevTools Performance API](https://developer.chrome.com/docs/devtools/performance/extension#tracks)
2360
+ */
2361
+ browserDevtoolsTiming: boolean;
2362
+ /**
2363
+ * Enable integration with Chrome DevTools Workspaces
2364
+ * for Nuxt projects.
2365
+ *
2366
+ * @default true
2367
+ * @see [Chrome DevTools Project Settings](https://docs.google.com/document/d/1rfKPnxsNuXhnF7AiQZhu9kIwdiMS5hnAI05HBwFuBSM/edit)
2368
+ */
2369
+ chromeDevtoolsProjectSettings: boolean;
2370
+ /**
2371
+ * Record mutations to `nuxt.options` in module context, helping to debug configuration changes made by modules during the Nuxt initialization phase.
2372
+ *
2373
+ * When enabled, Nuxt will track which modules modify configuration options, making it easier to trace unexpected configuration changes.
2374
+ *
2375
+ * @default false
2376
+ *
2377
+ * @example
2378
+ * ```ts
2379
+ * // nuxt.config.ts
2380
+ * export default defineNuxtConfig({
2381
+ * experimental: {
2382
+ * // Enable tracking of config mutations by modules
2383
+ * debugModuleMutation: true
2384
+ * }
2385
+ * })
2386
+ * ```
2387
+ *
2388
+ * @see [PR #30555](https://github.com/nuxt/nuxt/pull/30555)
2389
+ */
2390
+ debugModuleMutation: boolean;
2391
+ /**
2392
+ * Enable automatic configuration of hydration strategies for `<Lazy>` components.
2393
+ *
2394
+ * This feature intelligently determines when to hydrate lazy components based on visibility, idle time, or other triggers, improving performance by deferring hydration of components until they're needed.
2395
+ *
2396
+ * @default true
2397
+ *
2398
+ * @example
2399
+ * ```ts
2400
+ * // nuxt.config.ts
2401
+ * export default defineNuxtConfig({
2402
+ * experimental: {
2403
+ * lazyHydration: true // Enable smart hydration strategies for Lazy components
2404
+ * }
2405
+ * })
2406
+ *
2407
+ * // In your Vue components
2408
+ * <template>
2409
+ * <Lazy>
2410
+ * <ExpensiveComponent />
2411
+ * </Lazy>
2412
+ * </template>
2413
+ * ```
2414
+ *
2415
+ * @see [PR #26468](https://github.com/nuxt/nuxt/pull/26468)
2416
+ */
2417
+ lazyHydration: boolean;
2418
+ /**
2419
+ * Disable resolving imports into Nuxt templates from the path of the module that added the template.
2420
+ *
2421
+ * By default, Nuxt attempts to resolve imports in templates relative to the module that added them. Setting this to `false` disables this behavior, which may be useful if you're experiencing resolution conflicts in certain environments.
2422
+ *
2423
+ * @default true
2424
+ *
2425
+ * @example
2426
+ * ```ts
2427
+ * // nuxt.config.ts
2428
+ * export default defineNuxtConfig({
2429
+ * experimental: {
2430
+ * // Disable template import resolution from module path
2431
+ * templateImportResolution: false
2432
+ * }
2433
+ * })
2434
+ * ```
2435
+ *
2436
+ * @see [PR #31175](https://github.com/nuxt/nuxt/pull/31175)
2437
+ */
2438
+ templateImportResolution: boolean;
2439
+ /**
2440
+ * Whether to clean up Nuxt static and asyncData caches on route navigation.
2441
+ *
2442
+ * Nuxt will automatically purge cached data from `useAsyncData` and `nuxtApp.static.data`. This helps prevent memory leaks and ensures fresh data is loaded when needed, but it is possible to disable it.
2443
+ *
2444
+ * @default true
2445
+ *
2446
+ * @example
2447
+ * ```ts
2448
+ * // nuxt.config.ts
2449
+ * export default defineNuxtConfig({
2450
+ * experimental: {
2451
+ * // Disable automatic cache cleanup (default is true)
2452
+ * purgeCachedData: false
2453
+ * }
2454
+ * })
2455
+ * ```
2456
+ *
2457
+ * @see [PR #31379](https://github.com/nuxt/nuxt/pull/31379)
2458
+ */
2459
+ purgeCachedData: boolean;
2460
+ /**
2461
+ * Whether to call and use the result from `getCachedData` on manual refresh for `useAsyncData` and `useFetch`.
2462
+ *
2463
+ * @default false
2464
+ */
2465
+ granularCachedData: boolean;
2466
+ /**
2467
+ * Whether to run `useFetch` when the key changes, even if it is set to `immediate: false` and it has not been triggered yet.
2468
+ *
2469
+ * `useFetch` and `useAsyncData` will always run when the key changes if `immediate: true` or if it has been already triggered.
2470
+ *
2471
+ * @default false
2472
+ */
2473
+ alwaysRunFetchOnKeyChange: boolean;
2474
+ /**
2475
+ * Whether to parse `error.data` when rendering a server error page.
2476
+ *
2477
+ * @default false
2478
+ */
2479
+ parseErrorData: boolean;
2480
+ /**
2481
+ * Whether Nuxt should stop if a Nuxt module is incompatible.
2482
+ *
2483
+ * @default false
2484
+ */
2485
+ enforceModuleCompatibility: boolean;
2486
+ /**
2487
+ * For `useAsyncData` and `useFetch`, whether `pending` should be `true` when data has not yet started to be fetched.
2488
+ *
2489
+ * @default true
2490
+ */
2491
+ pendingWhenIdle: boolean;
2492
+ /**
2493
+ * Whether to improve chunk stability by using an import map to resolve the entry chunk of the bundle.
2494
+ */
2495
+ entryImportMap: boolean;
2496
+ /**
2497
+ * Extract async data handler functions into separate chunks for better performance and caching.
2498
+ *
2499
+ * When enabled, handler functions passed to `useAsyncData` and `useLazyAsyncData` will be extracted
2500
+ * into separate chunks and dynamically imported, allowing for better code splitting and caching.
2501
+ *
2502
+ * @experimental This is an experimental feature and API may change in the future.
2503
+ */
2504
+ extractAsyncDataHandlers: boolean;
2505
+ /**
2506
+ * Whether to enable `@dxup/nuxt` module for better TypeScript DX.
2507
+ *
2508
+ * @see https://github.com/KazariEX/dxup
2509
+ */
2510
+ typescriptPlugin: boolean;
2511
+ /**
2512
+ * Whether to add a middleware to handle changes of base URL at runtime (has a performance overhead)
2513
+ *
2514
+ * This option only has effect when using Nitro v3+.
2515
+ */
2516
+ runtimeBaseURL: boolean;
2517
+ /**
2518
+ * Whether to enable a compatibility layer for Nitro auto imports.
2519
+ * We recommend migrating to direct imports instead.
2520
+ */
2521
+ nitroAutoImports: boolean;
2522
+ };
2523
+ generate: {
2524
+ /**
2525
+ * The routes to generate.
2526
+ *
2527
+ * If you are using the crawler, this will be only the starting point for route generation. This is often necessary when using dynamic routes.
2528
+ * It is preferred to use `nitro.prerender.routes`.
2529
+ *
2530
+ * @example
2531
+ * ```js
2532
+ * routes: ['/users/1', '/users/2', '/users/3']
2533
+ * ```
2534
+ */
2535
+ routes: string | string[];
2536
+ /**
2537
+ * This option is no longer used. Instead, use `nitro.prerender.ignore`.
2538
+ *
2539
+ * @deprecated
2540
+ */
2541
+ exclude: Array<any>;
2542
+ };
2543
+ /**
2544
+ * @default 3
2545
+ *
2546
+ * @private
2547
+ */
2548
+ _majorVersion: number;
2549
+ /**
2550
+ * @default false
2551
+ *
2552
+ * @private
2553
+ */
2554
+ _legacyGenerate: boolean;
2555
+ /**
2556
+ * @default false
2557
+ *
2558
+ * @private
2559
+ */
2560
+ _start: boolean;
2561
+ /**
2562
+ * @default false
2563
+ *
2564
+ * @private
2565
+ */
2566
+ _build: boolean;
2567
+ /**
2568
+ * @default false
2569
+ *
2570
+ * @private
2571
+ */
2572
+ _generate: boolean;
2573
+ /**
2574
+ * @default false
2575
+ *
2576
+ * @private
2577
+ */
2578
+ _prepare: boolean;
2579
+ /**
2580
+ * @default false
2581
+ *
2582
+ * @private
2583
+ */
2584
+ _cli: boolean;
2585
+ /**
2586
+ *
2587
+ * @private
2588
+ */
2589
+ _requiredModules: Record<string, boolean>;
2590
+ /**
2591
+ *
2592
+ * @private
2593
+ */
2594
+ _loadOptions: {
2595
+ dotenv?: boolean | DotenvOptions;
2596
+ };
2597
+ /**
2598
+ *
2599
+ * @private
2600
+ */
2601
+ _nuxtConfigFile: string;
2602
+ /**
2603
+ *
2604
+ * @private
2605
+ */
2606
+ _nuxtConfigFiles: Array<string>;
2607
+ /**
2608
+ * @default ""
2609
+ *
2610
+ * @private
2611
+ */
2612
+ appDir: string;
2613
+ /**
2614
+ *
2615
+ * @private
2616
+ */
2617
+ _installedModules: Array<{
2618
+ meta: ModuleMeta;
2619
+ module: NuxtModule;
2620
+ timings?: Record<string, number | undefined>;
2621
+ entryPath?: string;
2622
+ }>;
2623
+ /**
2624
+ *
2625
+ * @private
2626
+ */
2627
+ _modules: Array<any>;
2628
+ /**
2629
+ * Configuration for Nuxt's server builder.
2630
+ */
2631
+ server: {
2632
+ builder?: '@nuxt/nitro-server' | (string & {}) | {
2633
+ bundle: (nuxt: Nuxt) => Promise<void>;
2634
+ };
2635
+ };
2636
+ postcss: {
2637
+ /**
2638
+ * A strategy for ordering PostCSS plugins.
2639
+ */
2640
+ order: 'cssnanoLast' | 'autoprefixerLast' | 'autoprefixerAndCssnanoLast' | string[] | ((names: string[]) => string[]);
2641
+ /**
2642
+ * Options for configuring PostCSS plugins.
2643
+ *
2644
+ * @see [PostCSS docs](https://postcss.org/)
2645
+ */
2646
+ plugins: Record<string, unknown> & {
2647
+ autoprefixer?: false | Options$1;
2648
+ cssnano?: false | Options$2;
2649
+ };
2650
+ };
2651
+ router: {
2652
+ /**
2653
+ * Additional router options passed to `vue-router`. On top of the options for `vue-router`, Nuxt offers additional options to customize the router (see below).
2654
+ *
2655
+ * @note Only JSON serializable options should be passed by Nuxt config.
2656
+ * For more control, you can use `app/router.options.ts` file.
2657
+ *
2658
+ * @see [Vue Router documentation](https://router.vuejs.org/api/interfaces/routeroptions.html).
2659
+ */
2660
+ options: RouterConfigSerializable;
2661
+ };
2662
+ /**
2663
+ * Configuration for Nuxt's TypeScript integration.
2664
+ */
2665
+ typescript: {
2666
+ /**
2667
+ * 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)
2668
+ *
2669
+ * @default true
2670
+ */
2671
+ strict: boolean;
2672
+ /**
2673
+ * Which builder types to include for your project.
2674
+ *
2675
+ * 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.
2676
+ * The 'shared' option is advised for module authors, who will want to support multiple possible builders.
2677
+ *
2678
+ */
2679
+ builder: 'vite' | 'webpack' | 'rspack' | 'shared' | false | undefined | null;
2680
+ /**
2681
+ * Modules to generate deep aliases for within `compilerOptions.paths`. This does not yet support subpaths. It may be necessary when using Nuxt within a pnpm monorepo with `shamefully-hoist=false`.
2682
+ *
2683
+ * @default ["nitropack/types","nitropack/runtime","nitropack","defu","h3","consola","ofetch","@unhead/vue","@nuxt/devtools","vue","@vue/runtime-core","@vue/compiler-sfc","vue-router","vue-router/auto-routes","unplugin-vue-router/client","@nuxt/schema","nuxt"]
2684
+ */
2685
+ hoist: Array<string>;
2686
+ /**
2687
+ * Include parent workspace in the Nuxt project. Mostly useful for themes and module authors.
2688
+ *
2689
+ * @default false
2690
+ */
2691
+ includeWorkspace: boolean;
2692
+ /**
2693
+ * Enable build-time type checking.
2694
+ *
2695
+ * 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.
2696
+ *
2697
+ * @default false
2698
+ *
2699
+ * @see [Nuxt TypeScript docs](https://nuxt.com/docs/guide/concepts/typescript)
2700
+ */
2701
+ typeCheck: boolean | 'build';
2702
+ /**
2703
+ * You can extend generated `.nuxt/tsconfig.json` using this option.
2704
+ *
2705
+ */
2706
+ tsConfig: 0 extends 1 & RawVueCompilerOptions ? TSConfig : TSConfig & {
2707
+ vueCompilerOptions?: RawVueCompilerOptions;
2708
+ };
2709
+ /**
2710
+ * Generate a `*.vue` shim.
2711
+ *
2712
+ * We recommend instead letting the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar) generate accurate types for your components.
2713
+ * Note that you may wish to set this to `true` if you are using other libraries, such as ESLint, that are unable to understand the type of `.vue` files.
2714
+ *
2715
+ * @default false
2716
+ */
2717
+ shim: boolean;
2718
+ };
2719
+ esbuild: {
2720
+ /**
2721
+ * Configure shared esbuild options used within Nuxt and passed to other builders, such as Vite or Webpack.
2722
+ */
2723
+ options: TransformOptions;
2724
+ };
2725
+ oxc: {
2726
+ transform: {
2727
+ options: TransformOptions$1;
2728
+ };
2729
+ };
2730
+ /**
2731
+ * Configuration that will be passed directly to Vite.
2732
+ *
2733
+ * @see [Vite configuration docs](https://vite.dev/config) for more information.
2734
+ * Please note that not all vite options are supported in Nuxt.
2735
+ */
2736
+ vite: ViteOptions;
2737
+ webpack: {
2738
+ /**
2739
+ * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
2740
+ *
2741
+ * 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).
2742
+ *
2743
+ * @example
2744
+ * ```js
2745
+ * analyze: {
2746
+ * analyzerMode: 'static'
2747
+ * }
2748
+ * ```
2749
+ */
2750
+ analyze: boolean | {
2751
+ enabled?: boolean;
2752
+ } & BundleAnalyzerPlugin.Options;
2753
+ /**
2754
+ * Enable the profiler in webpackbar.
2755
+ *
2756
+ * It is normally enabled by CLI argument `--profile`.
2757
+ *
2758
+ * @default false
2759
+ *
2760
+ * @see [webpackbar](https://github.com/unjs/webpackbar#profile).
2761
+ */
2762
+ profile: boolean;
2763
+ /**
2764
+ * Enables Common CSS Extraction.
2765
+ *
2766
+ * 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.
2767
+ *
2768
+ * @default true
2769
+ *
2770
+ * @example
2771
+ * ```js
2772
+ * export default {
2773
+ * webpack: {
2774
+ * extractCSS: true,
2775
+ * // or
2776
+ * extractCSS: {
2777
+ * ignoreOrder: true
2778
+ * }
2779
+ * }
2780
+ * }
2781
+ * ```
2782
+ *
2783
+ * If you want to extract all your CSS to a single file, there is a workaround for this.
2784
+ * However, note that it is not recommended to extract everything into a single file.
2785
+ * Extracting into multiple CSS files is better for caching and preload isolation. It
2786
+ * can also improve page performance by downloading and resolving only those resources
2787
+ * that are needed.
2788
+ *
2789
+ * @example
2790
+ * ```js
2791
+ * export default {
2792
+ * webpack: {
2793
+ * extractCSS: true,
2794
+ * optimization: {
2795
+ * splitChunks: {
2796
+ * cacheGroups: {
2797
+ * styles: {
2798
+ * name: 'styles',
2799
+ * test: /\.(css|vue)$/,
2800
+ * chunks: 'all',
2801
+ * enforce: true
2802
+ * }
2803
+ * }
2804
+ * }
2805
+ * }
2806
+ * }
2807
+ * }
2808
+ * ```
2809
+ */
2810
+ extractCSS: boolean | PluginOptions;
2811
+ /**
2812
+ * Enables CSS source map support (defaults to `true` in development).
2813
+ *
2814
+ * @default false
2815
+ */
2816
+ cssSourceMap: boolean;
2817
+ /**
2818
+ * The polyfill library to load to provide URL and URLSearchParams.
2819
+ *
2820
+ * Defaults to `'url'` ([see package](https://www.npmjs.com/package/url)).
2821
+ *
2822
+ * @default "url"
2823
+ */
2824
+ serverURLPolyfill: string;
2825
+ /**
2826
+ * Customize bundle filenames.
2827
+ *
2828
+ * To understand a bit more about the use of manifests, take a look at [webpack documentation](https://webpack.js.org/guides/code-splitting/).
2829
+ *
2830
+ * @note Be careful when using non-hashed based filenames in production
2831
+ * as most browsers will cache the asset and not detect the changes on first load.
2832
+ *
2833
+ * This example changes fancy chunk names to numerical ids:
2834
+ *
2835
+ * @example
2836
+ * ```js
2837
+ * filenames: {
2838
+ * chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js')
2839
+ * }
2840
+ * ```
2841
+ */
2842
+ filenames: Record<string, string | ((ctx: {
2843
+ nuxt: Nuxt;
2844
+ options: NuxtOptions;
2845
+ name: string;
2846
+ isDev: boolean;
2847
+ isServer: boolean;
2848
+ isClient: boolean;
2849
+ alias: {
2850
+ [index: string]: string | false | string[];
2851
+ };
2852
+ transpile: RegExp[];
2853
+ }) => string)>;
2854
+ /**
2855
+ * Customize the options of Nuxt's integrated webpack loaders.
2856
+ *
2857
+ */
2858
+ loaders: {
2859
+ /**
2860
+ * @see [esbuild loader](https://github.com/esbuild-kit/esbuild-loader)
2861
+ */
2862
+ esbuild: Omit<LoaderOptions, 'loader'>;
2863
+ /**
2864
+ * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options)
2865
+ *
2866
+ * @default
2867
+ * ```ts
2868
+ * { esModule: false }
2869
+ * ```
2870
+ */
2871
+ file: {
2872
+ /** @default false */esModule: boolean; /** @default 1000 */
2873
+ limit: number;
2874
+ };
2875
+ /**
2876
+ * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options)
2877
+ *
2878
+ * @default
2879
+ * ```ts
2880
+ * { esModule: false }
2881
+ * ```
2882
+ */
2883
+ fontUrl: {
2884
+ /** @default false */esModule: boolean; /** @default 1000 */
2885
+ limit: number;
2886
+ };
2887
+ /**
2888
+ * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options)
2889
+ *
2890
+ * @default
2891
+ * ```ts
2892
+ * { esModule: false }
2893
+ * ```
2894
+ */
2895
+ imgUrl: {
2896
+ /** @default false */esModule: boolean; /** @default 1000 */
2897
+ limit: number;
2898
+ };
2899
+ /**
2900
+ * @see [`pug` options](https://pugjs.org/api/reference.html#options)
2901
+ */
2902
+ pugPlain: Options$3$1;
2903
+ /**
2904
+ * See [vue-loader](https://github.com/vuejs/vue-loader) for available options.
2905
+ */
2906
+ vue: Partial<VueLoaderOptions>;
2907
+ /**
2908
+ * See [css-loader](https://github.com/webpack-contrib/css-loader) for available options.
2909
+ */
2910
+ css: {
2911
+ /** @default 0 */importLoaders: number;
2912
+ url: boolean | {
2913
+ filter: (url: string, resourcePath: string) => boolean;
2914
+ }; /** @default false */
2915
+ esModule: boolean;
2916
+ };
2917
+ /**
2918
+ * See [css-loader](https://github.com/webpack-contrib/css-loader) for available options.
2919
+ */
2920
+ cssModules: {
2921
+ /** @default 0 */importLoaders: number;
2922
+ url: boolean | {
2923
+ filter: (url: string, resourcePath: string) => boolean;
2924
+ }; /** @default false */
2925
+ esModule: boolean;
2926
+ modules: {
2927
+ /** @default "[local]_[hash:base64:5]" */localIdentName: string;
2928
+ };
2929
+ };
2930
+ /**
2931
+ * @see [`less-loader` Options](https://github.com/webpack-contrib/less-loader#options)
2932
+ */
2933
+ less: any;
2934
+ /**
2935
+ * @see [`sass-loader` Options](https://github.com/webpack-contrib/sass-loader#options)
2936
+ *
2937
+ * @default
2938
+ * ```ts
2939
+ * {
2940
+ * sassOptions: {
2941
+ * indentedSyntax: true
2942
+ * }
2943
+ * }
2944
+ * ```
2945
+ */
2946
+ sass: {
2947
+ sassOptions: {
2948
+ /** @default true */indentedSyntax: boolean;
2949
+ };
2950
+ };
2951
+ /**
2952
+ * @see [`sass-loader` Options](https://github.com/webpack-contrib/sass-loader#options)
2953
+ */
2954
+ scss: any;
2955
+ /**
2956
+ * @see [`stylus-loader` Options](https://github.com/webpack-contrib/stylus-loader#options)
2957
+ */
2958
+ stylus: any;
2959
+ vueStyle: any;
2960
+ };
2961
+ /**
2962
+ * Add webpack plugins.
2963
+ *
2964
+ * @example
2965
+ * ```js
2966
+ * import webpack from 'webpack'
2967
+ * import { version } from './package.json.ts'
2968
+ * // ...
2969
+ * plugins: [
2970
+ * new webpack.DefinePlugin({
2971
+ * 'process.VERSION': version
2972
+ * })
2973
+ * ]
2974
+ * ```
2975
+ */
2976
+ plugins: Array<any>;
2977
+ /**
2978
+ * Hard-replaces `typeof process`, `typeof window` and `typeof document` to tree-shake bundle.
2979
+ *
2980
+ * @default false
2981
+ */
2982
+ aggressiveCodeRemoval: boolean;
2983
+ /**
2984
+ * OptimizeCSSAssets plugin options.
2985
+ *
2986
+ * Defaults to true when `extractCSS` is enabled.
2987
+ *
2988
+ * @default false
2989
+ *
2990
+ * @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin).
2991
+ */
2992
+ optimizeCSS: false | BasePluginOptions & DefinedDefaultMinimizerAndOptions<{}>;
2993
+ /**
2994
+ * Configure [webpack optimization](https://webpack.js.org/configuration/optimization/).
2995
+ *
2996
+ */
2997
+ optimization: false | Configuration['optimization'];
2998
+ /**
2999
+ * Customize PostCSS Loader. same options as [`postcss-loader` options](https://github.com/webpack-contrib/postcss-loader#options)
3000
+ *
3001
+ */
3002
+ postcss: {
3003
+ execute?: boolean;
3004
+ postcssOptions: ProcessOptions & {
3005
+ plugins: Record<string, unknown> & {
3006
+ autoprefixer?: Options$1;
3007
+ cssnano?: Options$2;
3008
+ };
3009
+ };
3010
+ sourceMap?: boolean;
3011
+ implementation?: any;
3012
+ };
3013
+ /**
3014
+ * See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options.
3015
+ *
3016
+ */
3017
+ devMiddleware: Options<IncomingMessage, ServerResponse>;
3018
+ /**
3019
+ * See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options.
3020
+ *
3021
+ */
3022
+ hotMiddleware: MiddlewareOptions & {
3023
+ client?: ClientOptions;
3024
+ };
3025
+ /**
3026
+ * Set to `false` to disable the overlay provided by [FriendlyErrorsWebpackPlugin](https://github.com/nuxt/friendly-errors-webpack-plugin).
3027
+ *
3028
+ * @default true
3029
+ */
3030
+ friendlyErrors: boolean;
3031
+ /**
3032
+ * Filters to hide build warnings.
3033
+ *
3034
+ */
3035
+ warningIgnoreFilters: Array<(warn: WebpackError | Error) => boolean>;
3036
+ /**
3037
+ * Configure [webpack experiments](https://webpack.js.org/configuration/experiments/)
3038
+ *
3039
+ */
3040
+ experiments: false | Configuration['experiments'];
3041
+ };
3042
+ }
3043
+ type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
3044
+ type UpperSnakeCase<S extends string> = Uppercase<SnakeCase<S>>;
3045
+ type RuntimeValue<T, B extends string> = (T & {}) | T;
3046
+ type Overrideable<T extends Record<string, any>, Path extends string = ''> = { [K in keyof T]?: K extends string ? unknown extends T[K] ? unknown : T[K] extends Record<string, unknown> ? RuntimeValue<Overrideable<T[K], `${Path}_${UpperSnakeCase<K>}`>, `You can override this value at runtime with NUXT${Path}_${UpperSnakeCase<K>}`> : RuntimeValue<T[K], `You can override this value at runtime with NUXT${Path}_${UpperSnakeCase<K>}`> : K extends number ? T[K] : never };
3047
+ type RuntimeConfigNamespace = Record<string, unknown>;
3048
+ interface PublicRuntimeConfig extends RuntimeConfigNamespace {}
3049
+ interface RuntimeConfig extends RuntimeConfigNamespace {
3050
+ public: PublicRuntimeConfig;
3051
+ }
3052
+ /**
3053
+ * User configuration in `nuxt.config` file
3054
+ */
3055
+ interface NuxtConfig extends DeepPartial<Omit<ConfigSchema, 'components' | 'vue' | 'vite' | 'runtimeConfig' | 'webpack' | 'nitro'>> {
3056
+ components?: ConfigSchema['components'];
3057
+ vue?: Omit<DeepPartial<ConfigSchema['vue']>, 'config'> & {
3058
+ config?: Partial<Filter<AppConfig, string | boolean>>;
3059
+ };
3060
+ vite?: ConfigSchema['vite'];
3061
+ runtimeConfig?: Overrideable<RuntimeConfig>;
3062
+ webpack?: DeepPartial<ConfigSchema['webpack']> & {
3063
+ $client?: DeepPartial<ConfigSchema['webpack']>;
3064
+ $server?: DeepPartial<ConfigSchema['webpack']>;
3065
+ };
3066
+ /**
3067
+ * Experimental custom config schema
3068
+ * @see [Nuxt Issue #15592](https://github.com/nuxt/nuxt/issues/15592)
3069
+ */
3070
+ $schema?: SchemaDefinition;
3071
+ }
3072
+ type NuxtConfigLayer = ResolvedConfig<NuxtConfig & {
3073
+ srcDir: ConfigSchema['srcDir'];
3074
+ rootDir: ConfigSchema['rootDir'];
3075
+ }> & {
3076
+ cwd: string;
3077
+ configFile: string;
3078
+ };
3079
+ interface NuxtBuilder {
3080
+ bundle: (nuxt: Nuxt) => Promise<void>;
3081
+ }
3082
+ interface NuxtOptions extends Omit<ConfigSchema, 'vue' | 'sourcemap' | 'debug' | 'builder' | 'postcss' | 'webpack'> {
3083
+ vue: Omit<ConfigSchema['vue'], 'config'> & {
3084
+ config?: Partial<Filter<AppConfig, string | boolean>>;
3085
+ };
3086
+ sourcemap: Required<Exclude<ConfigSchema['sourcemap'], boolean>>;
3087
+ debug: Required<Exclude<ConfigSchema['debug'], true>>;
3088
+ builder: '@nuxt/vite-builder' | '@nuxt/webpack-builder' | '@nuxt/rspack-builder' | NuxtBuilder;
3089
+ postcss: Omit<ConfigSchema['postcss'], 'order'> & {
3090
+ order: Exclude<ConfigSchema['postcss']['order'], string>;
3091
+ };
3092
+ webpack: ConfigSchema['webpack'] & {
3093
+ $client: ConfigSchema['webpack'];
3094
+ $server: ConfigSchema['webpack'];
3095
+ };
3096
+ _layers: readonly NuxtConfigLayer[];
3097
+ $schema: SchemaDefinition;
3098
+ }
3099
+ interface ViteConfig extends Omit<UserConfig, 'publicDir'> {
3100
+ /** The path to the entrypoint for the Vite build. */
3101
+ entry?: string;
3102
+ /**
3103
+ * Options passed to @vitejs/plugin-vue.
3104
+ * @see [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue)
3105
+ */
3106
+ vue?: Options$5;
3107
+ /**
3108
+ * Options passed to @vitejs/plugin-vue-jsx.
3109
+ * @see [@vitejs/plugin-vue-jsx.](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)
3110
+ */
3111
+ vueJsx?: Options$4;
3112
+ /**
3113
+ * Bundler for dev time server-side rendering.
3114
+ * @default 'vite-node'
3115
+ */
3116
+ devBundler?: 'vite-node' | 'legacy';
3117
+ /**
3118
+ * Warmup vite entrypoint caches on dev startup.
3119
+ */
3120
+ warmupEntry?: boolean;
3121
+ /**
3122
+ * Use environment variables or top level `server` options to configure Nuxt server.
3123
+ */
3124
+ server?: Omit<ServerOptions$1, 'port' | 'host'>;
3125
+ /**
3126
+ * Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`.
3127
+ *
3128
+ * You can read more in <https://nuxt.com/docs/api/nuxt-config#public>.
3129
+ * @deprecated
3130
+ */
3131
+ publicDir?: never;
3132
+ }
3133
+ interface ViteOptions extends ViteConfig {}
3134
+ type Serializable<T> = T extends Function ? never : T extends Promise<infer U> ? Serializable<U> : T extends string & {} ? T : T extends Record<string, any> ? { [K in keyof T]: Serializable<T[K]> } : T;
3135
+ type ValueOf<T> = T[keyof T];
3136
+ type Filter<T extends Record<string, any>, V> = Pick<T, ValueOf<{ [K in keyof T]: NonNullable<T[K]> extends V ? K : never }>>;
3137
+ interface NuxtAppConfig {
3138
+ head: Serializable<AppHeadMetaObject>;
3139
+ layoutTransition: boolean | Serializable<TransitionProps>;
3140
+ pageTransition: boolean | Serializable<TransitionProps>;
3141
+ viewTransition?: boolean | 'always';
3142
+ keepalive: boolean | Serializable<KeepAliveProps>;
3143
+ }
3144
+ interface AppConfig$1 {
3145
+ [key: string]: unknown;
3146
+ }
3147
+ //#endregion
3148
+ //#region src/webpack.d.ts
3149
+ declare const bundle: NuxtBuilder["bundle"];
3150
+ //#endregion
3151
+ export { bundle };