vite 8.0.0-beta.7 → 8.0.0-beta.9

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.
@@ -36,10 +36,10 @@ interface Alias {
36
36
  find: string | RegExp;
37
37
  replacement: string;
38
38
  /**
39
- * Instructs the plugin to use an alternative resolving algorithm,
40
- * rather than the Rollup's resolver.
41
- * @default null
42
- */
39
+ * Instructs the plugin to use an alternative resolving algorithm,
40
+ * rather than the Rollup's resolver.
41
+ * @default null
42
+ */
43
43
  customResolver?: ResolverFunction | ResolverObject | null;
44
44
  }
45
45
  type MapToFunction<T> = T extends Function ? T : never;
@@ -69,183 +69,158 @@ type AnymatchMatcher = AnymatchPattern | AnymatchPattern[];
69
69
  //#region src/types/chokidar.d.ts
70
70
  declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
71
71
  options: WatchOptions;
72
-
73
72
  /**
74
- * Constructs a new FSWatcher instance with optional WatchOptions parameter.
75
- */
73
+ * Constructs a new FSWatcher instance with optional WatchOptions parameter.
74
+ */
76
75
  constructor(options?: WatchOptions);
77
-
78
76
  /**
79
- * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
80
- * Calling watcher.ref() multiple times will have no effect.
81
- */
77
+ * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
78
+ * Calling watcher.ref() multiple times will have no effect.
79
+ */
82
80
  ref(): this;
83
-
84
81
  /**
85
- * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
86
- * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
87
- * Calling watcher.unref() multiple times will have no effect.
88
- */
82
+ * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
83
+ * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
84
+ * Calling watcher.unref() multiple times will have no effect.
85
+ */
89
86
  unref(): this;
90
-
91
87
  /**
92
- * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
93
- * string.
94
- */
88
+ * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
89
+ * string.
90
+ */
95
91
  add(paths: string | ReadonlyArray<string>): this;
96
-
97
92
  /**
98
- * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
99
- * string.
100
- */
93
+ * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
94
+ * string.
95
+ */
101
96
  unwatch(paths: string | ReadonlyArray<string>): this;
102
-
103
97
  /**
104
- * Returns an object representing all the paths on the file system being watched by this
105
- * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
106
- * the `cwd` option was used), and the values are arrays of the names of the items contained in
107
- * each directory.
108
- */
98
+ * Returns an object representing all the paths on the file system being watched by this
99
+ * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
100
+ * the `cwd` option was used), and the values are arrays of the names of the items contained in
101
+ * each directory.
102
+ */
109
103
  getWatched(): {
110
104
  [directory: string]: string[];
111
105
  };
112
-
113
106
  /**
114
- * Removes all listeners from watched files.
115
- */
107
+ * Removes all listeners from watched files.
108
+ */
116
109
  close(): Promise<void>;
117
110
  on(event: 'add' | 'addDir' | 'change', listener: (path: string, stats?: fs.Stats) => void): this;
118
111
  on(event: 'all', listener: (eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void): this;
119
-
120
112
  /**
121
- * Error occurred
122
- */
113
+ * Error occurred
114
+ */
123
115
  on(event: 'error', listener: (error: Error) => void): this;
124
-
125
116
  /**
126
- * Exposes the native Node `fs.FSWatcher events`
127
- */
117
+ * Exposes the native Node `fs.FSWatcher events`
118
+ */
128
119
  on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
129
-
130
120
  /**
131
- * Fires when the initial scan is complete
132
- */
121
+ * Fires when the initial scan is complete
122
+ */
133
123
  on(event: 'ready', listener: () => void): this;
134
124
  on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this;
135
125
  on(event: string, listener: (...args: any[]) => void): this;
136
126
  }
137
127
  interface WatchOptions {
138
128
  /**
139
- * Indicates whether the process should continue to run as long as files are being watched. If
140
- * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
141
- * even if the process continues to run.
142
- */
129
+ * Indicates whether the process should continue to run as long as files are being watched. If
130
+ * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
131
+ * even if the process continues to run.
132
+ */
143
133
  persistent?: boolean;
144
-
145
134
  /**
146
- * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
147
- * be ignored. The whole relative or absolute path is tested, not just filename. If a function
148
- * with two arguments is provided, it gets called twice per path - once with a single argument
149
- * (the path), second time with two arguments (the path and the
150
- * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
151
- */
135
+ * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
136
+ * be ignored. The whole relative or absolute path is tested, not just filename. If a function
137
+ * with two arguments is provided, it gets called twice per path - once with a single argument
138
+ * (the path), second time with two arguments (the path and the
139
+ * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
140
+ */
152
141
  ignored?: AnymatchMatcher;
153
-
154
142
  /**
155
- * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
156
- * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
157
- */
143
+ * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
144
+ * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
145
+ */
158
146
  ignoreInitial?: boolean;
159
-
160
147
  /**
161
- * When `false`, only the symlinks themselves will be watched for changes instead of following
162
- * the link references and bubbling events through the link's path.
163
- */
148
+ * When `false`, only the symlinks themselves will be watched for changes instead of following
149
+ * the link references and bubbling events through the link's path.
150
+ */
164
151
  followSymlinks?: boolean;
165
-
166
152
  /**
167
- * The base directory from which watch `paths` are to be derived. Paths emitted with events will
168
- * be relative to this.
169
- */
153
+ * The base directory from which watch `paths` are to be derived. Paths emitted with events will
154
+ * be relative to this.
155
+ */
170
156
  cwd?: string;
171
-
172
157
  /**
173
- * If set to true then the strings passed to .watch() and .add() are treated as literal path
174
- * names, even if they look like globs.
175
- *
176
- * @default false
177
- */
158
+ * If set to true then the strings passed to .watch() and .add() are treated as literal path
159
+ * names, even if they look like globs.
160
+ *
161
+ * @default false
162
+ */
178
163
  disableGlobbing?: boolean;
179
-
180
164
  /**
181
- * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
182
- * utilization, consider setting this to `false`. It is typically necessary to **set this to
183
- * `true` to successfully watch files over a network**, and it may be necessary to successfully
184
- * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
185
- * the `useFsEvents` default.
186
- */
165
+ * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
166
+ * utilization, consider setting this to `false`. It is typically necessary to **set this to
167
+ * `true` to successfully watch files over a network**, and it may be necessary to successfully
168
+ * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
169
+ * the `useFsEvents` default.
170
+ */
187
171
  usePolling?: boolean;
188
-
189
172
  /**
190
- * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
191
- * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
192
- * OS X, `usePolling: true` becomes the default.
193
- */
173
+ * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
174
+ * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
175
+ * OS X, `usePolling: true` becomes the default.
176
+ */
194
177
  useFsEvents?: boolean;
195
-
196
178
  /**
197
- * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
198
- * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
199
- * provided even in cases where it wasn't already available from the underlying watch events.
200
- */
179
+ * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
180
+ * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
181
+ * provided even in cases where it wasn't already available from the underlying watch events.
182
+ */
201
183
  alwaysStat?: boolean;
202
-
203
184
  /**
204
- * If set, limits how many levels of subdirectories will be traversed.
205
- */
185
+ * If set, limits how many levels of subdirectories will be traversed.
186
+ */
206
187
  depth?: number;
207
-
208
188
  /**
209
- * Interval of file system polling.
210
- */
189
+ * Interval of file system polling.
190
+ */
211
191
  interval?: number;
212
-
213
192
  /**
214
- * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
215
- * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
216
- */
193
+ * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
194
+ * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
195
+ */
217
196
  binaryInterval?: number;
218
-
219
197
  /**
220
- * Indicates whether to watch files that don't have read permissions if possible. If watching
221
- * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
222
- * silently.
223
- */
198
+ * Indicates whether to watch files that don't have read permissions if possible. If watching
199
+ * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
200
+ * silently.
201
+ */
224
202
  ignorePermissionErrors?: boolean;
225
-
226
203
  /**
227
- * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
228
- * that occur when using editors that use "atomic writes" instead of writing directly to the
229
- * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
230
- * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
231
- * you can override it by setting `atomic` to a custom value, in milliseconds.
232
- */
204
+ * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
205
+ * that occur when using editors that use "atomic writes" instead of writing directly to the
206
+ * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
207
+ * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
208
+ * you can override it by setting `atomic` to a custom value, in milliseconds.
209
+ */
233
210
  atomic?: boolean | number;
234
-
235
211
  /**
236
- * can be set to an object in order to adjust timing params:
237
- */
212
+ * can be set to an object in order to adjust timing params:
213
+ */
238
214
  awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
239
215
  }
240
216
  interface AwaitWriteFinishOptions {
241
217
  /**
242
- * Amount of time in milliseconds for a file size to remain constant before emitting its event.
243
- */
218
+ * Amount of time in milliseconds for a file size to remain constant before emitting its event.
219
+ */
244
220
  stabilityThreshold?: number;
245
-
246
221
  /**
247
- * File size polling interval.
248
- */
222
+ * File size polling interval.
223
+ */
249
224
  pollInterval?: number;
250
225
  }
251
226
  //#endregion
@@ -268,51 +243,48 @@ declare namespace Connect {
268
243
  (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
269
244
  route: string;
270
245
  stack: ServerStackItem[];
271
-
272
246
  /**
273
- * Utilize the given middleware `handle` to the given `route`,
274
- * defaulting to _/_. This "route" is the mount-point for the
275
- * middleware, when given a value other than _/_ the middleware
276
- * is only effective when that segment is present in the request's
277
- * pathname.
278
- *
279
- * For example if we were to mount a function at _/admin_, it would
280
- * be invoked on _/admin_, and _/admin/settings_, however it would
281
- * not be invoked for _/_, or _/posts_.
282
- */
247
+ * Utilize the given middleware `handle` to the given `route`,
248
+ * defaulting to _/_. This "route" is the mount-point for the
249
+ * middleware, when given a value other than _/_ the middleware
250
+ * is only effective when that segment is present in the request's
251
+ * pathname.
252
+ *
253
+ * For example if we were to mount a function at _/admin_, it would
254
+ * be invoked on _/admin_, and _/admin/settings_, however it would
255
+ * not be invoked for _/_, or _/posts_.
256
+ */
283
257
  use(fn: NextHandleFunction): Server;
284
258
  use(fn: HandleFunction): Server;
285
259
  use(route: string, fn: NextHandleFunction): Server;
286
260
  use(route: string, fn: HandleFunction): Server;
287
-
288
261
  /**
289
- * Handle server requests, punting them down
290
- * the middleware stack.
291
- */
262
+ * Handle server requests, punting them down
263
+ * the middleware stack.
264
+ */
292
265
  handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
293
-
294
266
  /**
295
- * Listen for connections.
296
- *
297
- * This method takes the same arguments
298
- * as node's `http.Server#listen()`.
299
- *
300
- * HTTP and HTTPS:
301
- *
302
- * If you run your application both as HTTP
303
- * and HTTPS you may wrap them individually,
304
- * since your Connect "server" is really just
305
- * a JavaScript `Function`.
306
- *
307
- * var connect = require('connect')
308
- * , http = require('http')
309
- * , https = require('https');
310
- *
311
- * var app = connect();
312
- *
313
- * http.createServer(app).listen(80);
314
- * https.createServer(options, app).listen(443);
315
- */
267
+ * Listen for connections.
268
+ *
269
+ * This method takes the same arguments
270
+ * as node's `http.Server#listen()`.
271
+ *
272
+ * HTTP and HTTPS:
273
+ *
274
+ * If you run your application both as HTTP
275
+ * and HTTPS you may wrap them individually,
276
+ * since your Connect "server" is really just
277
+ * a JavaScript `Function`.
278
+ *
279
+ * var connect = require('connect')
280
+ * , http = require('http')
281
+ * , https = require('https');
282
+ *
283
+ * var app = connect();
284
+ *
285
+ * http.createServer(app).listen(80);
286
+ * https.createServer(options, app).listen(443);
287
+ */
316
288
  listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
317
289
  listen(port: number, hostname?: string, callback?: Function): http.Server;
318
290
  listen(path: string, callback?: Function): http.Server;
@@ -403,17 +375,17 @@ interface ServerOptions$3 {
403
375
  /** Explicitly set the method type of the ProxyReq */
404
376
  method?: string;
405
377
  /**
406
- * Optionally override the trusted CA certificates.
407
- * This is passed to https.request.
408
- */
378
+ * Optionally override the trusted CA certificates.
379
+ * This is passed to https.request.
380
+ */
409
381
  ca?: string;
410
382
  /** Optional fetch implementation to use instead of global fetch, use this to activate fetch-based proxying,
411
- * for example to proxy HTTP/2 requests
412
- */
383
+ * for example to proxy HTTP/2 requests
384
+ */
413
385
  fetch?: typeof fetch;
414
386
  /** Optional configuration object for fetch-based proxy requests.
415
- * Use this to customize fetch request and response handling.
416
- * For custom fetch implementations, use the `fetch` property.*/
387
+ * Use this to customize fetch request and response handling.
388
+ * For custom fetch implementations, use the `fetch` property.*/
417
389
  fetchOptions?: FetchOptions;
418
390
  }
419
391
  interface FetchOptions {
@@ -450,59 +422,59 @@ type PassFunctions<TIncomingMessage extends typeof http.IncomingMessage = typeof
450
422
  };
451
423
  declare class ProxyServer<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> extends EventEmitter<ProxyServerEventMap<TIncomingMessage, TServerResponse, TError>> {
452
424
  /**
453
- * Used for proxying WS(S) requests
454
- * @param req - Client request.
455
- * @param socket - Client socket.
456
- * @param head - Client head.
457
- * @param options - Additional options.
458
- */
425
+ * Used for proxying WS(S) requests
426
+ * @param req - Client request.
427
+ * @param socket - Client socket.
428
+ * @param head - Client head.
429
+ * @param options - Additional options.
430
+ */
459
431
  readonly ws: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["ws"]) => void;
460
432
  /**
461
- * Used for proxying regular HTTP(S) requests
462
- * @param req - Client request.
463
- * @param res - Client response.
464
- * @param options - Additional options.
465
- */
433
+ * Used for proxying regular HTTP(S) requests
434
+ * @param req - Client request.
435
+ * @param res - Client response.
436
+ * @param options - Additional options.
437
+ */
466
438
  readonly web: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["web"]) => void;
467
439
  private options;
468
440
  private webPasses;
469
441
  private wsPasses;
470
442
  private _server?;
471
443
  /**
472
- * Creates the proxy server with specified options.
473
- * @param options - Config object passed to the proxy
474
- */
444
+ * Creates the proxy server with specified options.
445
+ * @param options - Config object passed to the proxy
446
+ */
475
447
  constructor(options?: ServerOptions$3);
476
448
  /**
477
- * Creates the proxy server with specified options.
478
- * @param options Config object passed to the proxy
479
- * @returns Proxy object with handlers for `ws` and `web` requests
480
- */
449
+ * Creates the proxy server with specified options.
450
+ * @param options Config object passed to the proxy
451
+ * @returns Proxy object with handlers for `ws` and `web` requests
452
+ */
481
453
  static createProxyServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
482
454
  /**
483
- * Creates the proxy server with specified options.
484
- * @param options Config object passed to the proxy
485
- * @returns Proxy object with handlers for `ws` and `web` requests
486
- */
455
+ * Creates the proxy server with specified options.
456
+ * @param options Config object passed to the proxy
457
+ * @returns Proxy object with handlers for `ws` and `web` requests
458
+ */
487
459
  static createServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
488
460
  /**
489
- * Creates the proxy server with specified options.
490
- * @param options Config object passed to the proxy
491
- * @returns Proxy object with handlers for `ws` and `web` requests
492
- */
461
+ * Creates the proxy server with specified options.
462
+ * @param options Config object passed to the proxy
463
+ * @returns Proxy object with handlers for `ws` and `web` requests
464
+ */
493
465
  static createProxy<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
494
466
  createRightProxy: <PT extends ProxyType>(type: PT) => Function;
495
467
  onError: (err: TError) => void;
496
468
  /**
497
- * A function that wraps the object in a webserver, for your convenience
498
- * @param port - Port to listen on
499
- * @param hostname - The hostname to listen on
500
- */
469
+ * A function that wraps the object in a webserver, for your convenience
470
+ * @param port - Port to listen on
471
+ * @param hostname - The hostname to listen on
472
+ */
501
473
  listen: (port: number, hostname?: string) => this;
502
474
  address: () => string | net.AddressInfo | null | undefined;
503
475
  /**
504
- * A function that closes the inner webserver and stops listening on given port
505
- */
476
+ * A function that closes the inner webserver and stops listening on given port
477
+ */
506
478
  close: (cb?: Function) => void;
507
479
  before: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
508
480
  after: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
@@ -532,22 +504,22 @@ declare function createProxyServer<TIncomingMessage extends typeof http.Incoming
532
504
  //#region src/node/server/middlewares/proxy.d.ts
533
505
  interface ProxyOptions extends ServerOptions$3 {
534
506
  /**
535
- * rewrite path
536
- */
507
+ * rewrite path
508
+ */
537
509
  rewrite?: (path: string) => string;
538
510
  /**
539
- * configure the proxy server (e.g. listen to events)
540
- */
511
+ * configure the proxy server (e.g. listen to events)
512
+ */
541
513
  configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
542
514
  /**
543
- * webpack-dev-server style bypass function
544
- */
515
+ * webpack-dev-server style bypass function
516
+ */
545
517
  bypass?: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
546
518
  /**
547
- * rewrite the Origin header of a WebSocket request to match the target
548
- *
549
- * **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
550
- */
519
+ * rewrite the Origin header of a WebSocket request to match the target
520
+ *
521
+ * **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
522
+ */
551
523
  rewriteWsOrigin?: boolean | undefined;
552
524
  }
553
525
  //#endregion
@@ -582,80 +554,80 @@ declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger
582
554
  //#region src/node/http.d.ts
583
555
  interface CommonServerOptions {
584
556
  /**
585
- * Specify server port. Note if the port is already being used, Vite will
586
- * automatically try the next available port so this may not be the actual
587
- * port the server ends up listening on.
588
- */
557
+ * Specify server port. Note if the port is already being used, Vite will
558
+ * automatically try the next available port so this may not be the actual
559
+ * port the server ends up listening on.
560
+ */
589
561
  port?: number;
590
562
  /**
591
- * If enabled, vite will exit if specified port is already in use
592
- */
563
+ * If enabled, vite will exit if specified port is already in use
564
+ */
593
565
  strictPort?: boolean;
594
566
  /**
595
- * Specify which IP addresses the server should listen on.
596
- * Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
597
- */
567
+ * Specify which IP addresses the server should listen on.
568
+ * Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
569
+ */
598
570
  host?: string | boolean;
599
571
  /**
600
- * The hostnames that Vite is allowed to respond to.
601
- * `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
602
- * When using HTTPS, this check is skipped.
603
- *
604
- * If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
605
- * For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
606
- *
607
- * If set to `true`, the server is allowed to respond to requests for any hosts.
608
- * This is not recommended as it will be vulnerable to DNS rebinding attacks.
609
- */
572
+ * The hostnames that Vite is allowed to respond to.
573
+ * `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
574
+ * When using HTTPS, this check is skipped.
575
+ *
576
+ * If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
577
+ * For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
578
+ *
579
+ * If set to `true`, the server is allowed to respond to requests for any hosts.
580
+ * This is not recommended as it will be vulnerable to DNS rebinding attacks.
581
+ */
610
582
  allowedHosts?: string[] | true;
611
583
  /**
612
- * Enable TLS + HTTP/2.
613
- * Note: this downgrades to TLS only when the proxy option is also used.
614
- */
584
+ * Enable TLS + HTTP/2.
585
+ * Note: this downgrades to TLS only when the proxy option is also used.
586
+ */
615
587
  https?: HttpsServerOptions;
616
588
  /**
617
- * Open browser window on startup
618
- */
589
+ * Open browser window on startup
590
+ */
619
591
  open?: boolean | string;
620
592
  /**
621
- * Configure custom proxy rules for the dev server. Expects an object
622
- * of `{ key: options }` pairs.
623
- * Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
624
- * Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
625
- *
626
- * Example `vite.config.js`:
627
- * ``` js
628
- * module.exports = {
629
- * proxy: {
630
- * // string shorthand: /foo -> http://localhost:4567/foo
631
- * '/foo': 'http://localhost:4567',
632
- * // with options
633
- * '/api': {
634
- * target: 'http://jsonplaceholder.typicode.com',
635
- * changeOrigin: true,
636
- * rewrite: path => path.replace(/^\/api/, '')
637
- * }
638
- * }
639
- * }
640
- * ```
641
- */
593
+ * Configure custom proxy rules for the dev server. Expects an object
594
+ * of `{ key: options }` pairs.
595
+ * Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
596
+ * Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
597
+ *
598
+ * Example `vite.config.js`:
599
+ * ``` js
600
+ * module.exports = {
601
+ * proxy: {
602
+ * // string shorthand: /foo -> http://localhost:4567/foo
603
+ * '/foo': 'http://localhost:4567',
604
+ * // with options
605
+ * '/api': {
606
+ * target: 'http://jsonplaceholder.typicode.com',
607
+ * changeOrigin: true,
608
+ * rewrite: path => path.replace(/^\/api/, '')
609
+ * }
610
+ * }
611
+ * }
612
+ * ```
613
+ */
642
614
  proxy?: Record<string, string | ProxyOptions>;
643
615
  /**
644
- * Configure CORS for the dev server.
645
- * Uses https://github.com/expressjs/cors.
646
- *
647
- * When enabling this option, **we recommend setting a specific value
648
- * rather than `true`** to avoid exposing the source code to untrusted origins.
649
- *
650
- * Set to `true` to allow all methods from any origin, or configure separately
651
- * using an object.
652
- *
653
- * @default false
654
- */
616
+ * Configure CORS for the dev server.
617
+ * Uses https://github.com/expressjs/cors.
618
+ *
619
+ * When enabling this option, **we recommend setting a specific value
620
+ * rather than `true`** to avoid exposing the source code to untrusted origins.
621
+ *
622
+ * Set to `true` to allow all methods from any origin, or configure separately
623
+ * using an object.
624
+ *
625
+ * @default false
626
+ */
655
627
  cors?: CorsOptions | boolean;
656
628
  /**
657
- * Specify server response headers.
658
- */
629
+ * Specify server response headers.
630
+ */
659
631
  headers?: OutgoingHttpHeaders;
660
632
  }
661
633
  /**
@@ -663,11 +635,11 @@ interface CommonServerOptions {
663
635
  */
664
636
  interface CorsOptions {
665
637
  /**
666
- * Configures the Access-Control-Allow-Origin CORS header.
667
- *
668
- * **We recommend setting a specific value rather than
669
- * `true`** to avoid exposing the source code to untrusted origins.
670
- */
638
+ * Configures the Access-Control-Allow-Origin CORS header.
639
+ *
640
+ * **We recommend setting a specific value rather than
641
+ * `true`** to avoid exposing the source code to untrusted origins.
642
+ */
671
643
  origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
672
644
  methods?: string | string[];
673
645
  allowedHeaders?: string | string[];
@@ -680,45 +652,45 @@ interface CorsOptions {
680
652
  type CorsOrigin = boolean | string | RegExp | (string | RegExp)[];
681
653
  //#endregion
682
654
  //#region src/node/typeUtils.d.ts
683
- type RequiredExceptFor<T, K$1 extends keyof T> = Pick<T, K$1> & Required<Omit<T, K$1>>;
655
+ type RequiredExceptFor<T, K extends keyof T> = Pick<T, K> & Required<Omit<T, K>>;
684
656
  //#endregion
685
657
  //#region src/node/preview.d.ts
686
658
  interface PreviewOptions extends CommonServerOptions {}
687
659
  interface ResolvedPreviewOptions extends RequiredExceptFor<PreviewOptions, "host" | "https" | "proxy"> {}
688
660
  interface PreviewServer {
689
661
  /**
690
- * The resolved vite config object
691
- */
662
+ * The resolved vite config object
663
+ */
692
664
  config: ResolvedConfig;
693
665
  /**
694
- * Stop the server.
695
- */
666
+ * Stop the server.
667
+ */
696
668
  close(): Promise<void>;
697
669
  /**
698
- * A connect app instance.
699
- * - Can be used to attach custom middlewares to the preview server.
700
- * - Can also be used as the handler function of a custom http server
701
- * or as a middleware in any connect-style Node.js frameworks
702
- *
703
- * https://github.com/senchalabs/connect#use-middleware
704
- */
670
+ * A connect app instance.
671
+ * - Can be used to attach custom middlewares to the preview server.
672
+ * - Can also be used as the handler function of a custom http server
673
+ * or as a middleware in any connect-style Node.js frameworks
674
+ *
675
+ * https://github.com/senchalabs/connect#use-middleware
676
+ */
705
677
  middlewares: Connect.Server;
706
678
  /**
707
- * native Node http server instance
708
- */
679
+ * native Node http server instance
680
+ */
709
681
  httpServer: HttpServer;
710
682
  /**
711
- * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
712
- * if the server is not listening on any port.
713
- */
683
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
684
+ * if the server is not listening on any port.
685
+ */
714
686
  resolvedUrls: ResolvedServerUrls | null;
715
687
  /**
716
- * Print server urls
717
- */
688
+ * Print server urls
689
+ */
718
690
  printUrls(): void;
719
691
  /**
720
- * Bind CLI shortcuts
721
- */
692
+ * Bind CLI shortcuts
693
+ */
722
694
  bindCLIShortcuts(options?: BindCLIShortcutsOptions<PreviewServer>): void;
723
695
  }
724
696
  type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>;
@@ -728,22 +700,22 @@ type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server:
728
700
  declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
729
701
  //#endregion
730
702
  //#region src/node/shortcuts.d.ts
731
- type BindCLIShortcutsOptions<Server$3 = ViteDevServer | PreviewServer> = {
703
+ type BindCLIShortcutsOptions<Server = ViteDevServer | PreviewServer> = {
732
704
  /**
733
- * Print a one-line shortcuts "help" hint to the terminal
734
- */
705
+ * Print a one-line shortcuts "help" hint to the terminal
706
+ */
735
707
  print?: boolean;
736
708
  /**
737
- * Custom shortcuts to run when a key is pressed. These shortcuts take priority
738
- * over the default shortcuts if they have the same keys (except the `h` key).
739
- * To disable a default shortcut, define the same key but with `action: undefined`.
740
- */
741
- customShortcuts?: CLIShortcut<Server$3>[];
709
+ * Custom shortcuts to run when a key is pressed. These shortcuts take priority
710
+ * over the default shortcuts if they have the same keys (except the `h` key).
711
+ * To disable a default shortcut, define the same key but with `action: undefined`.
712
+ */
713
+ customShortcuts?: CLIShortcut<Server>[];
742
714
  };
743
- type CLIShortcut<Server$3 = ViteDevServer | PreviewServer> = {
715
+ type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
744
716
  key: string;
745
717
  description: string;
746
- action?(server: Server$3): void | Promise<void>;
718
+ action?(server: Server): void | Promise<void>;
747
719
  };
748
720
  //#endregion
749
721
  //#region src/node/baseEnvironment.d.ts
@@ -801,115 +773,115 @@ interface DepsOptimizer {
801
773
  }
802
774
  interface DepOptimizationConfig {
803
775
  /**
804
- * Force optimize listed dependencies (must be resolvable import paths,
805
- * cannot be globs).
806
- */
776
+ * Force optimize listed dependencies (must be resolvable import paths,
777
+ * cannot be globs).
778
+ */
807
779
  include?: string[];
808
780
  /**
809
- * Do not optimize these dependencies (must be resolvable import paths,
810
- * cannot be globs).
811
- */
781
+ * Do not optimize these dependencies (must be resolvable import paths,
782
+ * cannot be globs).
783
+ */
812
784
  exclude?: string[];
813
785
  /**
814
- * Forces ESM interop when importing these dependencies. Some legacy
815
- * packages advertise themselves as ESM but use `require` internally
816
- * @experimental
817
- */
786
+ * Forces ESM interop when importing these dependencies. Some legacy
787
+ * packages advertise themselves as ESM but use `require` internally
788
+ * @experimental
789
+ */
818
790
  needsInterop?: string[];
819
791
  /**
820
- * Options to pass to esbuild during the dep scanning and optimization
821
- *
822
- * Certain options are omitted since changing them would not be compatible
823
- * with Vite's dep optimization.
824
- *
825
- * - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
826
- * - `plugins` are merged with Vite's dep plugin
827
- *
828
- * https://esbuild.github.io/api
829
- *
830
- * @deprecated Use `rolldownOptions` instead.
831
- */
792
+ * Options to pass to esbuild during the dep scanning and optimization
793
+ *
794
+ * Certain options are omitted since changing them would not be compatible
795
+ * with Vite's dep optimization.
796
+ *
797
+ * - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
798
+ * - `plugins` are merged with Vite's dep plugin
799
+ *
800
+ * https://esbuild.github.io/api
801
+ *
802
+ * @deprecated Use `rolldownOptions` instead.
803
+ */
832
804
  esbuildOptions?: DepsOptimizerEsbuildOptions;
833
805
  /**
834
- * @deprecated Use `rolldownOptions` instead.
835
- */
806
+ * @deprecated Use `rolldownOptions` instead.
807
+ */
836
808
  rollupOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
837
809
  output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
838
810
  };
839
811
  /**
840
- * Options to pass to rolldown during the dep scanning and optimization
841
- *
842
- * Certain options are omitted since changing them would not be compatible
843
- * with Vite's dep optimization.
844
- *
845
- * - `plugins` are merged with Vite's dep plugin
846
- */
812
+ * Options to pass to rolldown during the dep scanning and optimization
813
+ *
814
+ * Certain options are omitted since changing them would not be compatible
815
+ * with Vite's dep optimization.
816
+ *
817
+ * - `plugins` are merged with Vite's dep plugin
818
+ */
847
819
  rolldownOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
848
820
  output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
849
821
  };
850
822
  /**
851
- * List of file extensions that can be optimized. A corresponding esbuild
852
- * plugin must exist to handle the specific extension.
853
- *
854
- * By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
855
- * allows specifying additional extensions.
856
- *
857
- * @experimental
858
- */
823
+ * List of file extensions that can be optimized. A corresponding esbuild
824
+ * plugin must exist to handle the specific extension.
825
+ *
826
+ * By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
827
+ * allows specifying additional extensions.
828
+ *
829
+ * @experimental
830
+ */
859
831
  extensions?: string[];
860
832
  /**
861
- * Deps optimization during build was removed in Vite 5.1. This option is
862
- * now redundant and will be removed in a future version. Switch to using
863
- * `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
864
- * true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
865
- * @default 'build'
866
- * @deprecated
867
- * @experimental
868
- */
833
+ * Deps optimization during build was removed in Vite 5.1. This option is
834
+ * now redundant and will be removed in a future version. Switch to using
835
+ * `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
836
+ * true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
837
+ * @default 'build'
838
+ * @deprecated
839
+ * @experimental
840
+ */
869
841
  disabled?: boolean | "build" | "dev";
870
842
  /**
871
- * Automatic dependency discovery. When `noDiscovery` is true, only dependencies
872
- * listed in `include` will be optimized. The scanner isn't run for cold start
873
- * in this case. CJS-only dependencies must be present in `include` during dev.
874
- * @default false
875
- */
843
+ * Automatic dependency discovery. When `noDiscovery` is true, only dependencies
844
+ * listed in `include` will be optimized. The scanner isn't run for cold start
845
+ * in this case. CJS-only dependencies must be present in `include` during dev.
846
+ * @default false
847
+ */
876
848
  noDiscovery?: boolean;
877
849
  /**
878
- * When enabled, it will hold the first optimized deps results until all static
879
- * imports are crawled on cold start. This avoids the need for full-page reloads
880
- * when new dependencies are discovered and they trigger the generation of new
881
- * common chunks. If all dependencies are found by the scanner plus the explicitly
882
- * defined ones in `include`, it is better to disable this option to let the
883
- * browser process more requests in parallel.
884
- * @default true
885
- * @experimental
886
- */
850
+ * When enabled, it will hold the first optimized deps results until all static
851
+ * imports are crawled on cold start. This avoids the need for full-page reloads
852
+ * when new dependencies are discovered and they trigger the generation of new
853
+ * common chunks. If all dependencies are found by the scanner plus the explicitly
854
+ * defined ones in `include`, it is better to disable this option to let the
855
+ * browser process more requests in parallel.
856
+ * @default true
857
+ * @experimental
858
+ */
887
859
  holdUntilCrawlEnd?: boolean;
888
860
  /**
889
- * When enabled, Vite will not throw an error when an outdated optimized
890
- * dependency is requested. Enabling this option may cause a single module
891
- * to have a multiple reference.
892
- * @default false
893
- * @experimental
894
- */
861
+ * When enabled, Vite will not throw an error when an outdated optimized
862
+ * dependency is requested. Enabling this option may cause a single module
863
+ * to have a multiple reference.
864
+ * @default false
865
+ * @experimental
866
+ */
895
867
  ignoreOutdatedRequests?: boolean;
896
868
  }
897
869
  type DepOptimizationOptions = DepOptimizationConfig & {
898
870
  /**
899
- * By default, Vite will crawl your `index.html` to detect dependencies that
900
- * need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
901
- * will crawl those entry points instead.
902
- *
903
- * If neither of these fit your needs, you can specify custom entries using
904
- * this option - the value should be a tinyglobby pattern or array of patterns
905
- * (https://github.com/SuperchupuDev/tinyglobby) that are relative from
906
- * vite project root. This will overwrite default entries inference.
907
- */
871
+ * By default, Vite will crawl your `index.html` to detect dependencies that
872
+ * need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
873
+ * will crawl those entry points instead.
874
+ *
875
+ * If neither of these fit your needs, you can specify custom entries using
876
+ * this option - the value should be a tinyglobby pattern or array of patterns
877
+ * (https://github.com/SuperchupuDev/tinyglobby) that are relative from
878
+ * vite project root. This will overwrite default entries inference.
879
+ */
908
880
  entries?: string | string[];
909
881
  /**
910
- * Force dep pre-optimization regardless of whether deps have changed.
911
- * @experimental
912
- */
882
+ * Force dep pre-optimization regardless of whether deps have changed.
883
+ * @experimental
884
+ */
913
885
  force?: boolean;
914
886
  };
915
887
  interface OptimizedDepInfo {
@@ -920,54 +892,54 @@ interface OptimizedDepInfo {
920
892
  browserHash?: string;
921
893
  fileHash?: string;
922
894
  /**
923
- * During optimization, ids can still be resolved to their final location
924
- * but the bundles may not yet be saved to disk
925
- */
895
+ * During optimization, ids can still be resolved to their final location
896
+ * but the bundles may not yet be saved to disk
897
+ */
926
898
  processing?: Promise<void>;
927
899
  /**
928
- * ExportData cache, discovered deps will parse the src entry to get exports
929
- * data used both to define if interop is needed and when pre-bundling
930
- */
900
+ * ExportData cache, discovered deps will parse the src entry to get exports
901
+ * data used both to define if interop is needed and when pre-bundling
902
+ */
931
903
  exportsData?: Promise<ExportsData>;
932
904
  isDynamicEntry?: boolean;
933
905
  }
934
906
  interface DepOptimizationMetadata {
935
907
  /**
936
- * The main hash is determined by user config and dependency lockfiles.
937
- * This is checked on server startup to avoid unnecessary re-bundles.
938
- */
908
+ * The main hash is determined by user config and dependency lockfiles.
909
+ * This is checked on server startup to avoid unnecessary re-bundles.
910
+ */
939
911
  hash: string;
940
912
  /**
941
- * This hash is determined by dependency lockfiles.
942
- * This is checked on server startup to avoid unnecessary re-bundles.
943
- */
913
+ * This hash is determined by dependency lockfiles.
914
+ * This is checked on server startup to avoid unnecessary re-bundles.
915
+ */
944
916
  lockfileHash: string;
945
917
  /**
946
- * This hash is determined by user config.
947
- * This is checked on server startup to avoid unnecessary re-bundles.
948
- */
918
+ * This hash is determined by user config.
919
+ * This is checked on server startup to avoid unnecessary re-bundles.
920
+ */
949
921
  configHash: string;
950
922
  /**
951
- * The browser hash is determined by the main hash plus additional dependencies
952
- * discovered at runtime. This is used to invalidate browser requests to
953
- * optimized deps.
954
- */
923
+ * The browser hash is determined by the main hash plus additional dependencies
924
+ * discovered at runtime. This is used to invalidate browser requests to
925
+ * optimized deps.
926
+ */
955
927
  browserHash: string;
956
928
  /**
957
- * Metadata for each already optimized dependency
958
- */
929
+ * Metadata for each already optimized dependency
930
+ */
959
931
  optimized: Record<string, OptimizedDepInfo>;
960
932
  /**
961
- * Metadata for non-entry optimized chunks and dynamic imports
962
- */
933
+ * Metadata for non-entry optimized chunks and dynamic imports
934
+ */
963
935
  chunks: Record<string, OptimizedDepInfo>;
964
936
  /**
965
- * Metadata for each newly discovered dependency after processing
966
- */
937
+ * Metadata for each newly discovered dependency after processing
938
+ */
967
939
  discovered: Record<string, OptimizedDepInfo>;
968
940
  /**
969
- * OptimizedDepInfo list
970
- */
941
+ * OptimizedDepInfo list
942
+ */
971
943
  depInfoList: OptimizedDepInfo[];
972
944
  }
973
945
  /**
@@ -991,8 +963,8 @@ interface TransformResult {
991
963
  }
992
964
  interface TransformOptions {
993
965
  /**
994
- * @deprecated inferred from environment
995
- */
966
+ * @deprecated inferred from environment
967
+ */
996
968
  ssr?: boolean;
997
969
  }
998
970
  interface TransformOptionsInternal {}
@@ -1001,12 +973,12 @@ interface TransformOptionsInternal {}
1001
973
  declare class EnvironmentModuleNode {
1002
974
  environment: string;
1003
975
  /**
1004
- * Public served url path, starts with /
1005
- */
976
+ * Public served url path, starts with /
977
+ */
1006
978
  url: string;
1007
979
  /**
1008
- * Resolved file system path + query
1009
- */
980
+ * Resolved file system path + query
981
+ */
1010
982
  id: string | null;
1011
983
  file: string | null;
1012
984
  type: "js" | "css" | "asset";
@@ -1024,8 +996,8 @@ declare class EnvironmentModuleNode {
1024
996
  lastHMRTimestamp: number;
1025
997
  lastInvalidationTimestamp: number;
1026
998
  /**
1027
- * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
1028
- */
999
+ * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
1000
+ */
1029
1001
  constructor(url: string, environment: string, setIsSelfAccepting?: boolean);
1030
1002
  }
1031
1003
  type ResolvedUrl = [url: string, resolvedId: string, meta: object | null | undefined];
@@ -1044,13 +1016,13 @@ declare class EnvironmentModuleGraph {
1044
1016
  invalidateModule(mod: EnvironmentModuleNode, seen?: Set<EnvironmentModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1045
1017
  invalidateAll(): void;
1046
1018
  /**
1047
- * Update the module graph based on a module's updated imports information
1048
- * If there are dependencies that no longer have any importers, they are
1049
- * returned as a Set.
1050
- *
1051
- * @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
1052
- * This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
1053
- */
1019
+ * Update the module graph based on a module's updated imports information
1020
+ * If there are dependencies that no longer have any importers, they are
1021
+ * returned as a Set.
1022
+ *
1023
+ * @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
1024
+ * This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
1025
+ */
1054
1026
  updateModuleInfo(mod: EnvironmentModuleNode, importedModules: Set<string | EnvironmentModuleNode>, importedBindings: Map<string, Set<string>> | null, acceptedModules: Set<string | EnvironmentModuleNode>, acceptedExports: Set<string> | null, isSelfAccepting: boolean, staticImportedUrls?: Set<string>): Promise<Set<EnvironmentModuleNode> | undefined>;
1055
1027
  ensureEntryFromUrl(rawUrl: string, setIsSelfAccepting?: boolean): Promise<EnvironmentModuleNode>;
1056
1028
  createFileOnlyEntry(file: string): EnvironmentModuleNode;
@@ -1161,58 +1133,58 @@ interface HotChannelClient {
1161
1133
  type HotChannelListener<T extends string = string> = (data: InferCustomEventPayload<T>, client: HotChannelClient) => void;
1162
1134
  interface HotChannel<Api = any> {
1163
1135
  /**
1164
- * Broadcast events to all clients
1165
- */
1136
+ * Broadcast events to all clients
1137
+ */
1166
1138
  send?(payload: hmrPayload_HotPayload): void;
1167
1139
  /**
1168
- * Handle custom event emitted by `import.meta.hot.send`
1169
- */
1140
+ * Handle custom event emitted by `import.meta.hot.send`
1141
+ */
1170
1142
  on?<T extends string>(event: T, listener: HotChannelListener<T>): void;
1171
1143
  on?(event: "connection", listener: () => void): void;
1172
1144
  /**
1173
- * Unregister event listener
1174
- */
1145
+ * Unregister event listener
1146
+ */
1175
1147
  off?(event: string, listener: Function): void;
1176
1148
  /**
1177
- * Start listening for messages
1178
- */
1149
+ * Start listening for messages
1150
+ */
1179
1151
  listen?(): void;
1180
1152
  /**
1181
- * Disconnect all clients, called when server is closed or restarted.
1182
- */
1153
+ * Disconnect all clients, called when server is closed or restarted.
1154
+ */
1183
1155
  close?(): Promise<unknown> | void;
1184
1156
  api?: Api;
1185
1157
  }
1186
1158
  interface NormalizedHotChannelClient {
1187
1159
  /**
1188
- * Send event to the client
1189
- */
1160
+ * Send event to the client
1161
+ */
1190
1162
  send(payload: hmrPayload_HotPayload): void;
1191
1163
  /**
1192
- * Send custom event
1193
- */
1164
+ * Send custom event
1165
+ */
1194
1166
  send(event: string, payload?: hmrPayload_CustomPayload["data"]): void;
1195
1167
  }
1196
1168
  interface NormalizedHotChannel<Api = any> {
1197
1169
  /**
1198
- * Broadcast events to all clients
1199
- */
1170
+ * Broadcast events to all clients
1171
+ */
1200
1172
  send(payload: hmrPayload_HotPayload): void;
1201
1173
  /**
1202
- * Send custom event
1203
- */
1174
+ * Send custom event
1175
+ */
1204
1176
  send<T extends string>(event: T, payload?: InferCustomEventPayload<T>): void;
1205
1177
  /**
1206
- * Handle custom event emitted by `import.meta.hot.send`
1207
- */
1178
+ * Handle custom event emitted by `import.meta.hot.send`
1179
+ */
1208
1180
  on<T extends string>(event: T, listener: (data: InferCustomEventPayload<T>, client: NormalizedHotChannelClient) => void): void;
1209
1181
  /**
1210
- * @deprecated use `vite:client:connect` event instead
1211
- */
1182
+ * @deprecated use `vite:client:connect` event instead
1183
+ */
1212
1184
  on(event: "connection", listener: () => void): void;
1213
1185
  /**
1214
- * Unregister event listener
1215
- */
1186
+ * Unregister event listener
1187
+ */
1216
1188
  off(event: string, listener: Function): void;
1217
1189
  handleInvoke(payload: hmrPayload_HotPayload): Promise<{
1218
1190
  result: any;
@@ -1220,12 +1192,12 @@ interface NormalizedHotChannel<Api = any> {
1220
1192
  error: any;
1221
1193
  }>;
1222
1194
  /**
1223
- * Start listening for messages
1224
- */
1195
+ * Start listening for messages
1196
+ */
1225
1197
  listen(): void;
1226
1198
  /**
1227
- * Disconnect all clients, called when server is closed or restarted.
1228
- */
1199
+ * Disconnect all clients, called when server is closed or restarted.
1200
+ */
1229
1201
  close(): Promise<unknown> | void;
1230
1202
  api?: Api;
1231
1203
  }
@@ -1257,7 +1229,6 @@ declare class WebSocket extends EventEmitter {
1257
1229
  /** The current state of the connection */
1258
1230
  readonly readyState: typeof WebSocket.CONNECTING | typeof WebSocket.OPEN | typeof WebSocket.CLOSING | typeof WebSocket.CLOSED;
1259
1231
  readonly url: string;
1260
-
1261
1232
  /** The connection is not yet open. */
1262
1233
  readonly CONNECTING: 0;
1263
1234
  /** The connection is open and ready to communicate. */
@@ -1284,20 +1255,17 @@ declare class WebSocket extends EventEmitter {
1284
1255
  fin?: boolean | undefined;
1285
1256
  }, cb?: (err?: Error) => void): void;
1286
1257
  terminate(): void;
1287
-
1288
1258
  /**
1289
- * Pause the websocket causing it to stop emitting events. Some events can still be
1290
- * emitted after this is called, until all buffered data is consumed. This method
1291
- * is a noop if the ready state is `CONNECTING` or `CLOSED`.
1292
- */
1259
+ * Pause the websocket causing it to stop emitting events. Some events can still be
1260
+ * emitted after this is called, until all buffered data is consumed. This method
1261
+ * is a noop if the ready state is `CONNECTING` or `CLOSED`.
1262
+ */
1293
1263
  pause(): void;
1294
1264
  /**
1295
- * Make a paused socket resume emitting events. This method is a noop if the ready
1296
- * state is `CONNECTING` or `CLOSED`.
1297
- */
1298
- resume(): void;
1299
-
1300
- // HTML5 WebSocket events
1265
+ * Make a paused socket resume emitting events. This method is a noop if the ready
1266
+ * state is `CONNECTING` or `CLOSED`.
1267
+ */
1268
+ resume(): void; // HTML5 WebSocket events
1301
1269
  addEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void, options?: WebSocket.EventListenerOptions): void;
1302
1270
  addEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void, options?: WebSocket.EventListenerOptions): void;
1303
1271
  addEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void, options?: WebSocket.EventListenerOptions): void;
@@ -1305,9 +1273,7 @@ declare class WebSocket extends EventEmitter {
1305
1273
  removeEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void): void;
1306
1274
  removeEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void): void;
1307
1275
  removeEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void): void;
1308
- removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void;
1309
-
1310
- // Events
1276
+ removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void; // Events
1311
1277
  on(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1312
1278
  on(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1313
1279
  on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
@@ -1353,36 +1319,32 @@ declare const WebSocketAlias: typeof WebSocket;
1353
1319
  interface WebSocketAlias extends WebSocket {}
1354
1320
  declare namespace WebSocket {
1355
1321
  /**
1356
- * Data represents the raw message payload received over the WebSocket.
1357
- */
1322
+ * Data represents the raw message payload received over the WebSocket.
1323
+ */
1358
1324
  type RawData = Buffer | ArrayBuffer | Buffer[];
1359
-
1360
1325
  /**
1361
- * Data represents the message payload received over the WebSocket.
1362
- */
1326
+ * Data represents the message payload received over the WebSocket.
1327
+ */
1363
1328
  type Data = string | Buffer | ArrayBuffer | Buffer[];
1364
-
1365
1329
  /**
1366
- * CertMeta represents the accepted types for certificate & key data.
1367
- */
1330
+ * CertMeta represents the accepted types for certificate & key data.
1331
+ */
1368
1332
  type CertMeta = string | string[] | Buffer | Buffer[];
1369
-
1370
1333
  /**
1371
- * VerifyClientCallbackSync is a synchronous callback used to inspect the
1372
- * incoming message. The return value (boolean) of the function determines
1373
- * whether or not to accept the handshake.
1374
- */
1334
+ * VerifyClientCallbackSync is a synchronous callback used to inspect the
1335
+ * incoming message. The return value (boolean) of the function determines
1336
+ * whether or not to accept the handshake.
1337
+ */
1375
1338
  type VerifyClientCallbackSync = (info: {
1376
1339
  origin: string;
1377
1340
  secure: boolean;
1378
1341
  req: http.IncomingMessage;
1379
1342
  }) => boolean;
1380
-
1381
1343
  /**
1382
- * VerifyClientCallbackAsync is an asynchronous callback used to inspect the
1383
- * incoming message. The return value (boolean) of the function determines
1384
- * whether or not to accept the handshake.
1385
- */
1344
+ * VerifyClientCallbackAsync is an asynchronous callback used to inspect the
1345
+ * incoming message. The return value (boolean) of the function determines
1346
+ * whether or not to accept the handshake.
1347
+ */
1386
1348
  type VerifyClientCallbackAsync = (info: {
1387
1349
  origin: string;
1388
1350
  secure: boolean;
@@ -1473,9 +1435,7 @@ declare namespace WebSocket {
1473
1435
  address: string;
1474
1436
  family: string;
1475
1437
  port: number;
1476
- }
1477
-
1478
- // WebSocket Server
1438
+ } // WebSocket Server
1479
1439
  class Server<T extends WebSocket = WebSocket> extends EventEmitter {
1480
1440
  options: ServerOptions;
1481
1441
  path: string;
@@ -1484,9 +1444,7 @@ declare namespace WebSocket {
1484
1444
  address(): AddressInfo | string;
1485
1445
  close(cb?: (err?: Error) => void): void;
1486
1446
  handleUpgrade(request: http.IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback: (client: T, request: http.IncomingMessage) => void): void;
1487
- shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>;
1488
-
1489
- // Events
1447
+ shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>; // Events
1490
1448
  on(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1491
1449
  on(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1492
1450
  on(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
@@ -1516,49 +1474,45 @@ declare namespace WebSocket {
1516
1474
  const WebSocketServer: typeof Server;
1517
1475
  interface WebSocketServer extends Server {}
1518
1476
  const WebSocket: typeof WebSocketAlias;
1519
- interface WebSocket extends WebSocketAlias {}
1520
-
1521
- // WebSocket stream
1477
+ interface WebSocket extends WebSocketAlias {} // WebSocket stream
1522
1478
  function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
1523
- }
1524
-
1525
- // export = WebSocket
1479
+ } // export = WebSocket
1526
1480
  //#endregion
1527
1481
  //#region src/node/server/ws.d.ts
1528
1482
  type WebSocketCustomListener<T> = (data: T, client: WebSocketClient) => void;
1529
1483
  declare const isWebSocketServer: unique symbol;
1530
1484
  interface WebSocketServer extends NormalizedHotChannel {
1531
1485
  /**
1532
- * Handle custom event emitted by `import.meta.hot.send`
1533
- */
1486
+ * Handle custom event emitted by `import.meta.hot.send`
1487
+ */
1534
1488
  on: WebSocket.Server["on"] & {
1535
1489
  <T extends string>(event: T, listener: WebSocketCustomListener<hmrPayload_InferCustomEventPayload<T>>): void;
1536
1490
  };
1537
1491
  /**
1538
- * Unregister event listener.
1539
- */
1492
+ * Unregister event listener.
1493
+ */
1540
1494
  off: WebSocket.Server["off"] & {
1541
1495
  (event: string, listener: Function): void;
1542
1496
  };
1543
1497
  /**
1544
- * Listen on port and host
1545
- */
1498
+ * Listen on port and host
1499
+ */
1546
1500
  listen(): void;
1547
1501
  /**
1548
- * Disconnect all clients and terminate the server.
1549
- */
1502
+ * Disconnect all clients and terminate the server.
1503
+ */
1550
1504
  close(): Promise<void>;
1551
1505
  [isWebSocketServer]: true;
1552
1506
  /**
1553
- * Get all connected clients.
1554
- */
1507
+ * Get all connected clients.
1508
+ */
1555
1509
  clients: Set<WebSocketClient>;
1556
1510
  }
1557
1511
  interface WebSocketClient extends NormalizedHotChannelClient {
1558
1512
  /**
1559
- * The raw WebSocket instance
1560
- * @advanced
1561
- */
1513
+ * The raw WebSocket instance
1514
+ * @advanced
1515
+ */
1562
1516
  socket: WebSocket;
1563
1517
  }
1564
1518
  //#endregion
@@ -1578,29 +1532,29 @@ declare class DevEnvironment extends BaseEnvironment {
1578
1532
  depsOptimizer?: DepsOptimizer;
1579
1533
  get pluginContainer(): EnvironmentPluginContainer<DevEnvironment>;
1580
1534
  /**
1581
- * Hot channel for this environment. If not provided or disabled,
1582
- * it will be a noop channel that does nothing.
1583
- *
1584
- * @example
1585
- * environment.hot.send({ type: 'full-reload' })
1586
- */
1535
+ * Hot channel for this environment. If not provided or disabled,
1536
+ * it will be a noop channel that does nothing.
1537
+ *
1538
+ * @example
1539
+ * environment.hot.send({ type: 'full-reload' })
1540
+ */
1587
1541
  hot: NormalizedHotChannel;
1588
1542
  constructor(name: string, config: ResolvedConfig, context: DevEnvironmentContext);
1589
1543
  init(options?: {
1590
1544
  watcher?: FSWatcher;
1591
1545
  /**
1592
- * the previous instance used for the environment with the same name
1593
- *
1594
- * when using, the consumer should check if it's an instance generated from the same class or factory function
1595
- */
1546
+ * the previous instance used for the environment with the same name
1547
+ *
1548
+ * when using, the consumer should check if it's an instance generated from the same class or factory function
1549
+ */
1596
1550
  previousInstance?: DevEnvironment;
1597
1551
  }): Promise<void>;
1598
1552
  /**
1599
- * When the dev server is restarted, the methods are called in the following order:
1600
- * - new instance `init`
1601
- * - previous instance `close`
1602
- * - new instance `listen`
1603
- */
1553
+ * When the dev server is restarted, the methods are called in the following order:
1554
+ * - new instance `init`
1555
+ * - previous instance `close`
1556
+ * - new instance `listen`
1557
+ */
1604
1558
  listen(server: ViteDevServer): Promise<void>;
1605
1559
  fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
1606
1560
  reloadModule(module: EnvironmentModuleNode): Promise<void>;
@@ -1613,13 +1567,13 @@ declare class DevEnvironment extends BaseEnvironment {
1613
1567
  }, _client: NormalizedHotChannelClient): void;
1614
1568
  close(): Promise<void>;
1615
1569
  /**
1616
- * Calling `await environment.waitForRequestsIdle(id)` will wait until all static imports
1617
- * are processed after the first transformRequest call. If called from a load or transform
1618
- * plugin hook, the id needs to be passed as a parameter to avoid deadlocks.
1619
- * Calling this function after the first static imports section of the module graph has been
1620
- * processed will resolve immediately.
1621
- * @experimental
1622
- */
1570
+ * Calling `await environment.waitForRequestsIdle(id)` will wait until all static imports
1571
+ * are processed after the first transformRequest call. If called from a load or transform
1572
+ * plugin hook, the id needs to be passed as a parameter to avoid deadlocks.
1573
+ * Calling this function after the first static imports section of the module graph has been
1574
+ * processed will resolve immediately.
1575
+ * @experimental
1576
+ */
1623
1577
  waitForRequestsIdle(ignoredId?: string): Promise<void>;
1624
1578
  }
1625
1579
  //#endregion
@@ -1627,292 +1581,291 @@ declare class DevEnvironment extends BaseEnvironment {
1627
1581
 
1628
1582
  interface RollupCommonJSOptions {
1629
1583
  /**
1630
- * A minimatch pattern, or array of patterns, which specifies the files in
1631
- * the build the plugin should operate on. By default, all files with
1632
- * extension `".cjs"` or those in `extensions` are included, but you can
1633
- * narrow this list by only including specific files. These files will be
1634
- * analyzed and transpiled if either the analysis does not find ES module
1635
- * specific statements or `transformMixedEsModules` is `true`.
1636
- * @default undefined
1637
- */
1584
+ * A minimatch pattern, or array of patterns, which specifies the files in
1585
+ * the build the plugin should operate on. By default, all files with
1586
+ * extension `".cjs"` or those in `extensions` are included, but you can
1587
+ * narrow this list by only including specific files. These files will be
1588
+ * analyzed and transpiled if either the analysis does not find ES module
1589
+ * specific statements or `transformMixedEsModules` is `true`.
1590
+ * @default undefined
1591
+ */
1638
1592
  include?: string | RegExp | readonly (string | RegExp)[];
1639
1593
  /**
1640
- * A minimatch pattern, or array of patterns, which specifies the files in
1641
- * the build the plugin should _ignore_. By default, all files with
1642
- * extensions other than those in `extensions` or `".cjs"` are ignored, but you
1643
- * can exclude additional files. See also the `include` option.
1644
- * @default undefined
1645
- */
1594
+ * A minimatch pattern, or array of patterns, which specifies the files in
1595
+ * the build the plugin should _ignore_. By default, all files with
1596
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
1597
+ * can exclude additional files. See also the `include` option.
1598
+ * @default undefined
1599
+ */
1646
1600
  exclude?: string | RegExp | readonly (string | RegExp)[];
1647
1601
  /**
1648
- * For extensionless imports, search for extensions other than .js in the
1649
- * order specified. Note that you need to make sure that non-JavaScript files
1650
- * are transpiled by another plugin first.
1651
- * @default [ '.js' ]
1652
- */
1602
+ * For extensionless imports, search for extensions other than .js in the
1603
+ * order specified. Note that you need to make sure that non-JavaScript files
1604
+ * are transpiled by another plugin first.
1605
+ * @default [ '.js' ]
1606
+ */
1653
1607
  extensions?: ReadonlyArray<string>;
1654
1608
  /**
1655
- * If true then uses of `global` won't be dealt with by this plugin
1656
- * @default false
1657
- */
1609
+ * If true then uses of `global` won't be dealt with by this plugin
1610
+ * @default false
1611
+ */
1658
1612
  ignoreGlobal?: boolean;
1659
1613
  /**
1660
- * If false, skips source map generation for CommonJS modules. This will
1661
- * improve performance.
1662
- * @default true
1663
- */
1614
+ * If false, skips source map generation for CommonJS modules. This will
1615
+ * improve performance.
1616
+ * @default true
1617
+ */
1664
1618
  sourceMap?: boolean;
1665
1619
  /**
1666
- * Some `require` calls cannot be resolved statically to be translated to
1667
- * imports.
1668
- * When this option is set to `false`, the generated code will either
1669
- * directly throw an error when such a call is encountered or, when
1670
- * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
1671
- * configured dynamic require target.
1672
- * Setting this option to `true` will instead leave the `require` call in the
1673
- * code or use it as a fallback for `dynamicRequireTargets`.
1674
- * @default false
1675
- */
1620
+ * Some `require` calls cannot be resolved statically to be translated to
1621
+ * imports.
1622
+ * When this option is set to `false`, the generated code will either
1623
+ * directly throw an error when such a call is encountered or, when
1624
+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
1625
+ * configured dynamic require target.
1626
+ * Setting this option to `true` will instead leave the `require` call in the
1627
+ * code or use it as a fallback for `dynamicRequireTargets`.
1628
+ * @default false
1629
+ */
1676
1630
  ignoreDynamicRequires?: boolean;
1677
1631
  /**
1678
- * Instructs the plugin whether to enable mixed module transformations. This
1679
- * is useful in scenarios with modules that contain a mix of ES `import`
1680
- * statements and CommonJS `require` expressions. Set to `true` if `require`
1681
- * calls should be transformed to imports in mixed modules, or `false` if the
1682
- * `require` expressions should survive the transformation. The latter can be
1683
- * important if the code contains environment detection, or you are coding
1684
- * for an environment with special treatment for `require` calls such as
1685
- * ElectronJS. See also the `ignore` option.
1686
- * @default false
1687
- */
1632
+ * Instructs the plugin whether to enable mixed module transformations. This
1633
+ * is useful in scenarios with modules that contain a mix of ES `import`
1634
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
1635
+ * calls should be transformed to imports in mixed modules, or `false` if the
1636
+ * `require` expressions should survive the transformation. The latter can be
1637
+ * important if the code contains environment detection, or you are coding
1638
+ * for an environment with special treatment for `require` calls such as
1639
+ * ElectronJS. See also the `ignore` option.
1640
+ * @default false
1641
+ */
1688
1642
  transformMixedEsModules?: boolean;
1689
1643
  /**
1690
- * By default, this plugin will try to hoist `require` statements as imports
1691
- * to the top of each file. While this works well for many code bases and
1692
- * allows for very efficient ESM output, it does not perfectly capture
1693
- * CommonJS semantics as the order of side effects like log statements may
1694
- * change. But it is especially problematic when there are circular `require`
1695
- * calls between CommonJS modules as those often rely on the lazy execution of
1696
- * nested `require` calls.
1697
- *
1698
- * Setting this option to `true` will wrap all CommonJS files in functions
1699
- * which are executed when they are required for the first time, preserving
1700
- * NodeJS semantics. Note that this can have an impact on the size and
1701
- * performance of the generated code.
1702
- *
1703
- * The default value of `"auto"` will only wrap CommonJS files when they are
1704
- * part of a CommonJS dependency cycle, e.g. an index file that is required by
1705
- * many of its dependencies. All other CommonJS files are hoisted. This is the
1706
- * recommended setting for most code bases.
1707
- *
1708
- * `false` will entirely prevent wrapping and hoist all files. This may still
1709
- * work depending on the nature of cyclic dependencies but will often cause
1710
- * problems.
1711
- *
1712
- * You can also provide a minimatch pattern, or array of patterns, to only
1713
- * specify a subset of files which should be wrapped in functions for proper
1714
- * `require` semantics.
1715
- *
1716
- * `"debug"` works like `"auto"` but after bundling, it will display a warning
1717
- * containing a list of ids that have been wrapped which can be used as
1718
- * minimatch pattern for fine-tuning.
1719
- * @default "auto"
1720
- */
1644
+ * By default, this plugin will try to hoist `require` statements as imports
1645
+ * to the top of each file. While this works well for many code bases and
1646
+ * allows for very efficient ESM output, it does not perfectly capture
1647
+ * CommonJS semantics as the order of side effects like log statements may
1648
+ * change. But it is especially problematic when there are circular `require`
1649
+ * calls between CommonJS modules as those often rely on the lazy execution of
1650
+ * nested `require` calls.
1651
+ *
1652
+ * Setting this option to `true` will wrap all CommonJS files in functions
1653
+ * which are executed when they are required for the first time, preserving
1654
+ * NodeJS semantics. Note that this can have an impact on the size and
1655
+ * performance of the generated code.
1656
+ *
1657
+ * The default value of `"auto"` will only wrap CommonJS files when they are
1658
+ * part of a CommonJS dependency cycle, e.g. an index file that is required by
1659
+ * many of its dependencies. All other CommonJS files are hoisted. This is the
1660
+ * recommended setting for most code bases.
1661
+ *
1662
+ * `false` will entirely prevent wrapping and hoist all files. This may still
1663
+ * work depending on the nature of cyclic dependencies but will often cause
1664
+ * problems.
1665
+ *
1666
+ * You can also provide a minimatch pattern, or array of patterns, to only
1667
+ * specify a subset of files which should be wrapped in functions for proper
1668
+ * `require` semantics.
1669
+ *
1670
+ * `"debug"` works like `"auto"` but after bundling, it will display a warning
1671
+ * containing a list of ids that have been wrapped which can be used as
1672
+ * minimatch pattern for fine-tuning.
1673
+ * @default "auto"
1674
+ */
1721
1675
  strictRequires?: boolean | string | RegExp | readonly (string | RegExp)[];
1722
1676
  /**
1723
- * Sometimes you have to leave require statements unconverted. Pass an array
1724
- * containing the IDs or a `id => boolean` function.
1725
- * @default []
1726
- */
1677
+ * Sometimes you have to leave require statements unconverted. Pass an array
1678
+ * containing the IDs or a `id => boolean` function.
1679
+ * @default []
1680
+ */
1727
1681
  ignore?: ReadonlyArray<string> | ((id: string) => boolean);
1728
1682
  /**
1729
- * In most cases, where `require` calls are inside a `try-catch` clause,
1730
- * they should be left unconverted as it requires an optional dependency
1731
- * that may or may not be installed beside the rolled up package.
1732
- * Due to the conversion of `require` to a static `import` - the call is
1733
- * hoisted to the top of the file, outside the `try-catch` clause.
1734
- *
1735
- * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
1736
- * - `false`: All `require` calls inside a `try` will be converted as if the
1737
- * `try-catch` clause is not there.
1738
- * - `remove`: Remove all `require` calls from inside any `try` block.
1739
- * - `string[]`: Pass an array containing the IDs to left unconverted.
1740
- * - `((id: string) => boolean|'remove')`: Pass a function that controls
1741
- * individual IDs.
1742
- *
1743
- * @default true
1744
- */
1683
+ * In most cases, where `require` calls are inside a `try-catch` clause,
1684
+ * they should be left unconverted as it requires an optional dependency
1685
+ * that may or may not be installed beside the rolled up package.
1686
+ * Due to the conversion of `require` to a static `import` - the call is
1687
+ * hoisted to the top of the file, outside the `try-catch` clause.
1688
+ *
1689
+ * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
1690
+ * - `false`: All `require` calls inside a `try` will be converted as if the
1691
+ * `try-catch` clause is not there.
1692
+ * - `remove`: Remove all `require` calls from inside any `try` block.
1693
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
1694
+ * - `((id: string) => boolean|'remove')`: Pass a function that controls
1695
+ * individual IDs.
1696
+ *
1697
+ * @default true
1698
+ */
1745
1699
  ignoreTryCatch?: boolean | 'remove' | ReadonlyArray<string> | ((id: string) => boolean | 'remove');
1746
1700
  /**
1747
- * Controls how to render imports from external dependencies. By default,
1748
- * this plugin assumes that all external dependencies are CommonJS. This
1749
- * means they are rendered as default imports to be compatible with e.g.
1750
- * NodeJS where ES modules can only import a default export from a CommonJS
1751
- * dependency.
1752
- *
1753
- * If you set `esmExternals` to `true`, this plugin assumes that all
1754
- * external dependencies are ES modules and respect the
1755
- * `requireReturnsDefault` option. If that option is not set, they will be
1756
- * rendered as namespace imports.
1757
- *
1758
- * You can also supply an array of ids to be treated as ES modules, or a
1759
- * function that will be passed each external id to determine whether it is
1760
- * an ES module.
1761
- * @default false
1762
- */
1701
+ * Controls how to render imports from external dependencies. By default,
1702
+ * this plugin assumes that all external dependencies are CommonJS. This
1703
+ * means they are rendered as default imports to be compatible with e.g.
1704
+ * NodeJS where ES modules can only import a default export from a CommonJS
1705
+ * dependency.
1706
+ *
1707
+ * If you set `esmExternals` to `true`, this plugin assumes that all
1708
+ * external dependencies are ES modules and respect the
1709
+ * `requireReturnsDefault` option. If that option is not set, they will be
1710
+ * rendered as namespace imports.
1711
+ *
1712
+ * You can also supply an array of ids to be treated as ES modules, or a
1713
+ * function that will be passed each external id to determine whether it is
1714
+ * an ES module.
1715
+ * @default false
1716
+ */
1763
1717
  esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
1764
1718
  /**
1765
- * Controls what is returned when requiring an ES module from a CommonJS file.
1766
- * When using the `esmExternals` option, this will also apply to external
1767
- * modules. By default, this plugin will render those imports as namespace
1768
- * imports i.e.
1769
- *
1770
- * ```js
1771
- * // input
1772
- * const foo = require('foo');
1773
- *
1774
- * // output
1775
- * import * as foo from 'foo';
1776
- * ```
1777
- *
1778
- * However, there are some situations where this may not be desired.
1779
- * For these situations, you can change Rollup's behaviour either globally or
1780
- * per module. To change it globally, set the `requireReturnsDefault` option
1781
- * to one of the following values:
1782
- *
1783
- * - `false`: This is the default, requiring an ES module returns its
1784
- * namespace. This is the only option that will also add a marker
1785
- * `__esModule: true` to the namespace to support interop patterns in
1786
- * CommonJS modules that are transpiled ES modules.
1787
- * - `"namespace"`: Like `false`, requiring an ES module returns its
1788
- * namespace, but the plugin does not add the `__esModule` marker and thus
1789
- * creates more efficient code. For external dependencies when using
1790
- * `esmExternals: true`, no additional interop code is generated.
1791
- * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
1792
- * Rollup: If a module has a default export and no named exports, requiring
1793
- * that module returns the default export. In all other cases, the namespace
1794
- * is returned. For external dependencies when using `esmExternals: true`, a
1795
- * corresponding interop helper is added.
1796
- * - `"preferred"`: If a module has a default export, requiring that module
1797
- * always returns the default export, no matter whether additional named
1798
- * exports exist. This is similar to how previous versions of this plugin
1799
- * worked. Again for external dependencies when using `esmExternals: true`,
1800
- * an interop helper is added.
1801
- * - `true`: This will always try to return the default export on require
1802
- * without checking if it actually exists. This can throw at build time if
1803
- * there is no default export. This is how external dependencies are handled
1804
- * when `esmExternals` is not used. The advantage over the other options is
1805
- * that, like `false`, this does not add an interop helper for external
1806
- * dependencies, keeping the code lean.
1807
- *
1808
- * To change this for individual modules, you can supply a function for
1809
- * `requireReturnsDefault` instead. This function will then be called once for
1810
- * each required ES module or external dependency with the corresponding id
1811
- * and allows you to return different values for different modules.
1812
- * @default false
1813
- */
1719
+ * Controls what is returned when requiring an ES module from a CommonJS file.
1720
+ * When using the `esmExternals` option, this will also apply to external
1721
+ * modules. By default, this plugin will render those imports as namespace
1722
+ * imports i.e.
1723
+ *
1724
+ * ```js
1725
+ * // input
1726
+ * const foo = require('foo');
1727
+ *
1728
+ * // output
1729
+ * import * as foo from 'foo';
1730
+ * ```
1731
+ *
1732
+ * However, there are some situations where this may not be desired.
1733
+ * For these situations, you can change Rollup's behaviour either globally or
1734
+ * per module. To change it globally, set the `requireReturnsDefault` option
1735
+ * to one of the following values:
1736
+ *
1737
+ * - `false`: This is the default, requiring an ES module returns its
1738
+ * namespace. This is the only option that will also add a marker
1739
+ * `__esModule: true` to the namespace to support interop patterns in
1740
+ * CommonJS modules that are transpiled ES modules.
1741
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
1742
+ * namespace, but the plugin does not add the `__esModule` marker and thus
1743
+ * creates more efficient code. For external dependencies when using
1744
+ * `esmExternals: true`, no additional interop code is generated.
1745
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
1746
+ * Rollup: If a module has a default export and no named exports, requiring
1747
+ * that module returns the default export. In all other cases, the namespace
1748
+ * is returned. For external dependencies when using `esmExternals: true`, a
1749
+ * corresponding interop helper is added.
1750
+ * - `"preferred"`: If a module has a default export, requiring that module
1751
+ * always returns the default export, no matter whether additional named
1752
+ * exports exist. This is similar to how previous versions of this plugin
1753
+ * worked. Again for external dependencies when using `esmExternals: true`,
1754
+ * an interop helper is added.
1755
+ * - `true`: This will always try to return the default export on require
1756
+ * without checking if it actually exists. This can throw at build time if
1757
+ * there is no default export. This is how external dependencies are handled
1758
+ * when `esmExternals` is not used. The advantage over the other options is
1759
+ * that, like `false`, this does not add an interop helper for external
1760
+ * dependencies, keeping the code lean.
1761
+ *
1762
+ * To change this for individual modules, you can supply a function for
1763
+ * `requireReturnsDefault` instead. This function will then be called once for
1764
+ * each required ES module or external dependency with the corresponding id
1765
+ * and allows you to return different values for different modules.
1766
+ * @default false
1767
+ */
1814
1768
  requireReturnsDefault?: boolean | 'auto' | 'preferred' | 'namespace' | ((id: string) => boolean | 'auto' | 'preferred' | 'namespace');
1815
-
1816
1769
  /**
1817
- * @default "auto"
1818
- */
1770
+ * @default "auto"
1771
+ */
1819
1772
  defaultIsModuleExports?: boolean | 'auto' | ((id: string) => boolean | 'auto');
1820
1773
  /**
1821
- * Some modules contain dynamic `require` calls, or require modules that
1822
- * contain circular dependencies, which are not handled well by static
1823
- * imports. Including those modules as `dynamicRequireTargets` will simulate a
1824
- * CommonJS (NodeJS-like) environment for them with support for dynamic
1825
- * dependencies. It also enables `strictRequires` for those modules.
1826
- *
1827
- * Note: In extreme cases, this feature may result in some paths being
1828
- * rendered as absolute in the final bundle. The plugin tries to avoid
1829
- * exposing paths from the local machine, but if you are `dynamicRequirePaths`
1830
- * with paths that are far away from your project's folder, that may require
1831
- * replacing strings like `"/Users/John/Desktop/foo-project/"` -\> `"/"`.
1832
- */
1774
+ * Some modules contain dynamic `require` calls, or require modules that
1775
+ * contain circular dependencies, which are not handled well by static
1776
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
1777
+ * CommonJS (NodeJS-like) environment for them with support for dynamic
1778
+ * dependencies. It also enables `strictRequires` for those modules.
1779
+ *
1780
+ * Note: In extreme cases, this feature may result in some paths being
1781
+ * rendered as absolute in the final bundle. The plugin tries to avoid
1782
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
1783
+ * with paths that are far away from your project's folder, that may require
1784
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -\> `"/"`.
1785
+ */
1833
1786
  dynamicRequireTargets?: string | ReadonlyArray<string>;
1834
1787
  /**
1835
- * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
1836
- * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
1837
- * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
1838
- * home directory name. By default, it uses the current working directory.
1839
- */
1788
+ * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
1789
+ * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
1790
+ * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
1791
+ * home directory name. By default, it uses the current working directory.
1792
+ */
1840
1793
  dynamicRequireRoot?: string;
1841
1794
  }
1842
1795
  //#endregion
1843
1796
  //#region src/types/dynamicImportVars.d.ts
1844
1797
  interface RollupDynamicImportVarsOptions {
1845
1798
  /**
1846
- * Files to include in this plugin (default all).
1847
- * @default []
1848
- */
1799
+ * Files to include in this plugin (default all).
1800
+ * @default []
1801
+ */
1849
1802
  include?: string | RegExp | (string | RegExp)[];
1850
1803
  /**
1851
- * Files to exclude in this plugin (default none).
1852
- * @default []
1853
- */
1804
+ * Files to exclude in this plugin (default none).
1805
+ * @default []
1806
+ */
1854
1807
  exclude?: string | RegExp | (string | RegExp)[];
1855
1808
  /**
1856
- * By default, the plugin quits the build process when it encounters an error. If you set this option to true, it will throw a warning instead and leave the code untouched.
1857
- * @default false
1858
- */
1809
+ * By default, the plugin quits the build process when it encounters an error. If you set this option to true, it will throw a warning instead and leave the code untouched.
1810
+ * @default false
1811
+ */
1859
1812
  warnOnError?: boolean;
1860
1813
  }
1861
1814
  //#endregion
1862
1815
  //#region src/node/plugins/terser.d.ts
1863
1816
  interface TerserOptions extends TerserMinifyOptions {
1864
1817
  /**
1865
- * Vite-specific option to specify the max number of workers to spawn
1866
- * when minifying files with terser.
1867
- *
1868
- * @default number of CPUs minus 1
1869
- */
1818
+ * Vite-specific option to specify the max number of workers to spawn
1819
+ * when minifying files with terser.
1820
+ *
1821
+ * @default number of CPUs minus 1
1822
+ */
1870
1823
  maxWorkers?: number;
1871
1824
  }
1872
1825
  //#endregion
1873
1826
  //#region src/node/plugins/resolve.d.ts
1874
1827
  interface EnvironmentResolveOptions {
1875
1828
  /**
1876
- * @default ['browser', 'module', 'jsnext:main', 'jsnext']
1877
- */
1829
+ * @default ['browser', 'module', 'jsnext:main', 'jsnext']
1830
+ */
1878
1831
  mainFields?: string[];
1879
1832
  conditions?: string[];
1880
1833
  externalConditions?: string[];
1881
1834
  /**
1882
- * @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
1883
- */
1835
+ * @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
1836
+ */
1884
1837
  extensions?: string[];
1885
1838
  dedupe?: string[];
1886
1839
  /**
1887
- * Prevent listed dependencies from being externalized and will get bundled in build.
1888
- * Only works in server environments for now. Previously this was `ssr.noExternal`.
1889
- * @experimental
1890
- */
1840
+ * Prevent listed dependencies from being externalized and will get bundled in build.
1841
+ * Only works in server environments for now. Previously this was `ssr.noExternal`.
1842
+ * @experimental
1843
+ */
1891
1844
  noExternal?: string | RegExp | (string | RegExp)[] | true;
1892
1845
  /**
1893
- * Externalize the given dependencies and their transitive dependencies.
1894
- * Only works in server environments for now. Previously this was `ssr.external`.
1895
- * @experimental
1896
- */
1846
+ * Externalize the given dependencies and their transitive dependencies.
1847
+ * Only works in server environments for now. Previously this was `ssr.external`.
1848
+ * @experimental
1849
+ */
1897
1850
  external?: string[] | true;
1898
1851
  /**
1899
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
1900
- */
1852
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
1853
+ */
1901
1854
  builtins?: (string | RegExp)[];
1902
1855
  }
1903
1856
  interface ResolveOptions extends EnvironmentResolveOptions {
1904
1857
  /**
1905
- * @default false
1906
- */
1858
+ * @default false
1859
+ */
1907
1860
  preserveSymlinks?: boolean;
1908
1861
  /**
1909
- * Enable tsconfig paths resolution
1910
- *
1911
- * This option does not have any effect if `experimental.enableNativePlugin` is set to `false`.
1912
- *
1913
- * @default false
1914
- * @experimental
1915
- */
1862
+ * Enable tsconfig paths resolution
1863
+ *
1864
+ * This option does not have any effect if `experimental.enableNativePlugin` is set to `false`.
1865
+ *
1866
+ * @default false
1867
+ * @experimental
1868
+ */
1916
1869
  tsconfigPaths?: boolean;
1917
1870
  }
1918
1871
  interface ResolvePluginOptions {
@@ -1921,10 +1874,10 @@ interface ResolvePluginOptions {
1921
1874
  isProduction: boolean;
1922
1875
  packageCache?: PackageCache;
1923
1876
  /**
1924
- * src code mode also attempts the following:
1925
- * - resolving /xxx as URLs
1926
- * - resolving bare imports from optimized deps
1927
- */
1877
+ * src code mode also attempts the following:
1878
+ * - resolving /xxx as URLs
1879
+ * - resolving bare imports from optimized deps
1880
+ */
1928
1881
  asSrc?: boolean;
1929
1882
  tryIndex?: boolean;
1930
1883
  tryPrefix?: string;
@@ -1932,8 +1885,8 @@ interface ResolvePluginOptions {
1932
1885
  isRequire?: boolean;
1933
1886
  scan?: boolean;
1934
1887
  /**
1935
- * Enable when `legacy.inconsistentCjsInterop` is true. See that option for more details.
1936
- */
1888
+ * Enable when `legacy.inconsistentCjsInterop` is true. See that option for more details.
1889
+ */
1937
1890
  legacyInconsistentCjsInterop?: boolean;
1938
1891
  }
1939
1892
  interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {}
@@ -1963,264 +1916,264 @@ interface PackageData {
1963
1916
  //#region src/node/plugins/license.d.ts
1964
1917
  interface LicenseOptions {
1965
1918
  /**
1966
- * The output file name of the license file relative to the output directory.
1967
- * Specify a path that ends with `.json` to output the raw JSON metadata.
1968
- *
1969
- * @default '.vite/license.md'
1970
- */
1919
+ * The output file name of the license file relative to the output directory.
1920
+ * Specify a path that ends with `.json` to output the raw JSON metadata.
1921
+ *
1922
+ * @default '.vite/license.md'
1923
+ */
1971
1924
  fileName: string;
1972
1925
  }
1973
1926
  //#endregion
1974
1927
  //#region src/node/build.d.ts
1975
1928
  interface BuildEnvironmentOptions {
1976
1929
  /**
1977
- * Compatibility transform target. The transform is performed with esbuild
1978
- * and the lowest supported target is es2015. Note this only handles
1979
- * syntax transformation and does not cover polyfills
1980
- *
1981
- * Default: 'baseline-widely-available' - transpile targeting browsers that
1982
- * are included in the Baseline Widely Available on 2026-01-01.
1983
- * (Chrome 111+, Edge 111+, Firefox 114+, Safari 16.4+).
1984
- *
1985
- * Another special value is 'esnext' - which only performs minimal transpiling
1986
- * (for minification compat).
1987
- *
1988
- * For custom targets, see https://esbuild.github.io/api/#target and
1989
- * https://esbuild.github.io/content-types/#javascript for more details.
1990
- * @default 'baseline-widely-available'
1991
- */
1930
+ * Compatibility transform target. The transform is performed with esbuild
1931
+ * and the lowest supported target is es2015. Note this only handles
1932
+ * syntax transformation and does not cover polyfills
1933
+ *
1934
+ * Default: 'baseline-widely-available' - transpile targeting browsers that
1935
+ * are included in the Baseline Widely Available on 2026-01-01.
1936
+ * (Chrome 111+, Edge 111+, Firefox 114+, Safari 16.4+).
1937
+ *
1938
+ * Another special value is 'esnext' - which only performs minimal transpiling
1939
+ * (for minification compat).
1940
+ *
1941
+ * For custom targets, see https://esbuild.github.io/api/#target and
1942
+ * https://esbuild.github.io/content-types/#javascript for more details.
1943
+ * @default 'baseline-widely-available'
1944
+ */
1992
1945
  target?: "baseline-widely-available" | EsbuildTarget | false;
1993
1946
  /**
1994
- * whether to inject module preload polyfill.
1995
- * Note: does not apply to library mode.
1996
- * @default true
1997
- * @deprecated use `modulePreload.polyfill` instead
1998
- */
1947
+ * whether to inject module preload polyfill.
1948
+ * Note: does not apply to library mode.
1949
+ * @default true
1950
+ * @deprecated use `modulePreload.polyfill` instead
1951
+ */
1999
1952
  polyfillModulePreload?: boolean;
2000
1953
  /**
2001
- * Configure module preload
2002
- * Note: does not apply to library mode.
2003
- * @default true
2004
- */
1954
+ * Configure module preload
1955
+ * Note: does not apply to library mode.
1956
+ * @default true
1957
+ */
2005
1958
  modulePreload?: boolean | ModulePreloadOptions;
2006
1959
  /**
2007
- * Directory relative from `root` where build output will be placed. If the
2008
- * directory exists, it will be removed before the build.
2009
- * @default 'dist'
2010
- */
1960
+ * Directory relative from `root` where build output will be placed. If the
1961
+ * directory exists, it will be removed before the build.
1962
+ * @default 'dist'
1963
+ */
2011
1964
  outDir?: string;
2012
1965
  /**
2013
- * Directory relative from `outDir` where the built js/css/image assets will
2014
- * be placed.
2015
- * @default 'assets'
2016
- */
1966
+ * Directory relative from `outDir` where the built js/css/image assets will
1967
+ * be placed.
1968
+ * @default 'assets'
1969
+ */
2017
1970
  assetsDir?: string;
2018
1971
  /**
2019
- * Static asset files smaller than this number (in bytes) will be inlined as
2020
- * base64 strings. If a callback is passed, a boolean can be returned to opt-in
2021
- * or opt-out of inlining. If nothing is returned the default logic applies.
2022
- *
2023
- * Default limit is `4096` (4 KiB). Set to `0` to disable.
2024
- * @default 4096
2025
- */
1972
+ * Static asset files smaller than this number (in bytes) will be inlined as
1973
+ * base64 strings. If a callback is passed, a boolean can be returned to opt-in
1974
+ * or opt-out of inlining. If nothing is returned the default logic applies.
1975
+ *
1976
+ * Default limit is `4096` (4 KiB). Set to `0` to disable.
1977
+ * @default 4096
1978
+ */
2026
1979
  assetsInlineLimit?: number | ((filePath: string, content: Buffer) => boolean | undefined);
2027
1980
  /**
2028
- * Whether to code-split CSS. When enabled, CSS in async chunks will be
2029
- * inlined as strings in the chunk and inserted via dynamically created
2030
- * style tags when the chunk is loaded.
2031
- * @default true
2032
- */
1981
+ * Whether to code-split CSS. When enabled, CSS in async chunks will be
1982
+ * inlined as strings in the chunk and inserted via dynamically created
1983
+ * style tags when the chunk is loaded.
1984
+ * @default true
1985
+ */
2033
1986
  cssCodeSplit?: boolean;
2034
1987
  /**
2035
- * An optional separate target for CSS minification.
2036
- * As esbuild only supports configuring targets to mainstream
2037
- * browsers, users may need this option when they are targeting
2038
- * a niche browser that comes with most modern JavaScript features
2039
- * but has poor CSS support, e.g. Android WeChat WebView, which
2040
- * doesn't support the #RGBA syntax.
2041
- * @default target
2042
- */
1988
+ * An optional separate target for CSS minification.
1989
+ * As esbuild only supports configuring targets to mainstream
1990
+ * browsers, users may need this option when they are targeting
1991
+ * a niche browser that comes with most modern JavaScript features
1992
+ * but has poor CSS support, e.g. Android WeChat WebView, which
1993
+ * doesn't support the #RGBA syntax.
1994
+ * @default target
1995
+ */
2043
1996
  cssTarget?: EsbuildTarget | false;
2044
1997
  /**
2045
- * Override CSS minification specifically instead of defaulting to `build.minify`,
2046
- * so you can configure minification for JS and CSS separately.
2047
- * @default 'lightningcss'
2048
- */
1998
+ * Override CSS minification specifically instead of defaulting to `build.minify`,
1999
+ * so you can configure minification for JS and CSS separately.
2000
+ * @default 'lightningcss'
2001
+ */
2049
2002
  cssMinify?: boolean | "lightningcss" | "esbuild";
2050
2003
  /**
2051
- * If `true`, a separate sourcemap file will be created. If 'inline', the
2052
- * sourcemap will be appended to the resulting output file as data URI.
2053
- * 'hidden' works like `true` except that the corresponding sourcemap
2054
- * comments in the bundled files are suppressed.
2055
- * @default false
2056
- */
2004
+ * If `true`, a separate sourcemap file will be created. If 'inline', the
2005
+ * sourcemap will be appended to the resulting output file as data URI.
2006
+ * 'hidden' works like `true` except that the corresponding sourcemap
2007
+ * comments in the bundled files are suppressed.
2008
+ * @default false
2009
+ */
2057
2010
  sourcemap?: boolean | "inline" | "hidden";
2058
2011
  /**
2059
- * Set to `false` to disable minification, or specify the minifier to use.
2060
- * Available options are 'oxc' or 'terser' or 'esbuild'.
2061
- * @default 'oxc'
2062
- */
2012
+ * Set to `false` to disable minification, or specify the minifier to use.
2013
+ * Available options are 'oxc' or 'terser' or 'esbuild'.
2014
+ * @default 'oxc'
2015
+ */
2063
2016
  minify?: boolean | "oxc" | "terser" | "esbuild";
2064
2017
  /**
2065
- * Options for terser
2066
- * https://terser.org/docs/api-reference#minify-options
2067
- *
2068
- * In addition, you can also pass a `maxWorkers: number` option to specify the
2069
- * max number of workers to spawn. Defaults to the number of CPUs minus 1.
2070
- */
2018
+ * Options for terser
2019
+ * https://terser.org/docs/api-reference#minify-options
2020
+ *
2021
+ * In addition, you can also pass a `maxWorkers: number` option to specify the
2022
+ * max number of workers to spawn. Defaults to the number of CPUs minus 1.
2023
+ */
2071
2024
  terserOptions?: TerserOptions;
2072
2025
  /**
2073
- * Alias to `rolldownOptions`
2074
- * @deprecated Use `rolldownOptions` instead.
2075
- */
2026
+ * Alias to `rolldownOptions`
2027
+ * @deprecated Use `rolldownOptions` instead.
2028
+ */
2076
2029
  rollupOptions?: RolldownOptions;
2077
2030
  /**
2078
- * Will be merged with internal rolldown options.
2079
- * https://rolldown.rs/reference/config-options
2080
- */
2031
+ * Will be merged with internal rolldown options.
2032
+ * https://rolldown.rs/reference/config-options
2033
+ */
2081
2034
  rolldownOptions?: RolldownOptions;
2082
2035
  /**
2083
- * Options to pass on to `@rollup/plugin-commonjs`
2084
- * @deprecated This option is no-op and will be removed in future versions.
2085
- */
2036
+ * Options to pass on to `@rollup/plugin-commonjs`
2037
+ * @deprecated This option is no-op and will be removed in future versions.
2038
+ */
2086
2039
  commonjsOptions?: RollupCommonJSOptions;
2087
2040
  /**
2088
- * Options to pass on to `@rollup/plugin-dynamic-import-vars`
2089
- */
2041
+ * Options to pass on to `@rollup/plugin-dynamic-import-vars`
2042
+ */
2090
2043
  dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
2091
2044
  /**
2092
- * Whether to write bundle to disk
2093
- * @default true
2094
- */
2045
+ * Whether to write bundle to disk
2046
+ * @default true
2047
+ */
2095
2048
  write?: boolean;
2096
2049
  /**
2097
- * Empty outDir on write.
2098
- * @default true when outDir is a sub directory of project root
2099
- */
2050
+ * Empty outDir on write.
2051
+ * @default true when outDir is a sub directory of project root
2052
+ */
2100
2053
  emptyOutDir?: boolean | null;
2101
2054
  /**
2102
- * Copy the public directory to outDir on write.
2103
- * @default true
2104
- */
2055
+ * Copy the public directory to outDir on write.
2056
+ * @default true
2057
+ */
2105
2058
  copyPublicDir?: boolean;
2106
2059
  /**
2107
- * Whether to emit a `.vite/license.md` file that includes all bundled dependencies'
2108
- * licenses. Pass an object to customize the output file name.
2109
- * @default false
2110
- */
2060
+ * Whether to emit a `.vite/license.md` file that includes all bundled dependencies'
2061
+ * licenses. Pass an object to customize the output file name.
2062
+ * @default false
2063
+ */
2111
2064
  license?: boolean | LicenseOptions;
2112
2065
  /**
2113
- * Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
2114
- * to their hashed versions. Useful when you want to generate your own HTML
2115
- * instead of using the one generated by Vite.
2116
- *
2117
- * Example:
2118
- *
2119
- * ```json
2120
- * {
2121
- * "main.js": {
2122
- * "file": "main.68fe3fad.js",
2123
- * "css": "main.e6b63442.css",
2124
- * "imports": [...],
2125
- * "dynamicImports": [...]
2126
- * }
2127
- * }
2128
- * ```
2129
- * @default false
2130
- */
2066
+ * Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
2067
+ * to their hashed versions. Useful when you want to generate your own HTML
2068
+ * instead of using the one generated by Vite.
2069
+ *
2070
+ * Example:
2071
+ *
2072
+ * ```json
2073
+ * {
2074
+ * "main.js": {
2075
+ * "file": "main.68fe3fad.js",
2076
+ * "css": "main.e6b63442.css",
2077
+ * "imports": [...],
2078
+ * "dynamicImports": [...]
2079
+ * }
2080
+ * }
2081
+ * ```
2082
+ * @default false
2083
+ */
2131
2084
  manifest?: boolean | string;
2132
2085
  /**
2133
- * Build in library mode. The value should be the global name of the lib in
2134
- * UMD mode. This will produce esm + cjs + umd bundle formats with default
2135
- * configurations that are suitable for distributing libraries.
2136
- * @default false
2137
- */
2086
+ * Build in library mode. The value should be the global name of the lib in
2087
+ * UMD mode. This will produce esm + cjs + umd bundle formats with default
2088
+ * configurations that are suitable for distributing libraries.
2089
+ * @default false
2090
+ */
2138
2091
  lib?: LibraryOptions | false;
2139
2092
  /**
2140
- * Produce SSR oriented build. Note this requires specifying SSR entry via
2141
- * `rollupOptions.input`.
2142
- * @default false
2143
- */
2093
+ * Produce SSR oriented build. Note this requires specifying SSR entry via
2094
+ * `rollupOptions.input`.
2095
+ * @default false
2096
+ */
2144
2097
  ssr?: boolean | string;
2145
2098
  /**
2146
- * Generate SSR manifest for determining style links and asset preload
2147
- * directives in production.
2148
- * @default false
2149
- */
2099
+ * Generate SSR manifest for determining style links and asset preload
2100
+ * directives in production.
2101
+ * @default false
2102
+ */
2150
2103
  ssrManifest?: boolean | string;
2151
2104
  /**
2152
- * Emit assets during SSR.
2153
- * @default false
2154
- */
2105
+ * Emit assets during SSR.
2106
+ * @default false
2107
+ */
2155
2108
  ssrEmitAssets?: boolean;
2156
2109
  /**
2157
- * Emit assets during build. Frameworks can set environments.ssr.build.emitAssets
2158
- * By default, it is true for the client and false for other environments.
2159
- */
2110
+ * Emit assets during build. Frameworks can set environments.ssr.build.emitAssets
2111
+ * By default, it is true for the client and false for other environments.
2112
+ */
2160
2113
  emitAssets?: boolean;
2161
2114
  /**
2162
- * Set to false to disable reporting compressed chunk sizes.
2163
- * Can slightly improve build speed.
2164
- * @default true
2165
- */
2115
+ * Set to false to disable reporting compressed chunk sizes.
2116
+ * Can slightly improve build speed.
2117
+ * @default true
2118
+ */
2166
2119
  reportCompressedSize?: boolean;
2167
2120
  /**
2168
- * Adjust chunk size warning limit (in kB).
2169
- * @default 500
2170
- */
2121
+ * Adjust chunk size warning limit (in kB).
2122
+ * @default 500
2123
+ */
2171
2124
  chunkSizeWarningLimit?: number;
2172
2125
  /**
2173
- * Rollup watch options
2174
- * https://rollupjs.org/configuration-options/#watch
2175
- * @default null
2176
- */
2126
+ * Rollup watch options
2127
+ * https://rollupjs.org/configuration-options/#watch
2128
+ * @default null
2129
+ */
2177
2130
  watch?: WatcherOptions | null;
2178
2131
  /**
2179
- * create the Build Environment instance
2180
- */
2132
+ * create the Build Environment instance
2133
+ */
2181
2134
  createEnvironment?: (name: string, config: ResolvedConfig) => Promise<BuildEnvironment> | BuildEnvironment;
2182
2135
  }
2183
2136
  type BuildOptions = BuildEnvironmentOptions;
2184
2137
  interface LibraryOptions {
2185
2138
  /**
2186
- * Path of library entry
2187
- */
2139
+ * Path of library entry
2140
+ */
2188
2141
  entry: InputOption;
2189
2142
  /**
2190
- * The name of the exposed global variable. Required when the `formats` option includes
2191
- * `umd` or `iife`
2192
- */
2143
+ * The name of the exposed global variable. Required when the `formats` option includes
2144
+ * `umd` or `iife`
2145
+ */
2193
2146
  name?: string;
2194
2147
  /**
2195
- * Output bundle formats
2196
- * @default ['es', 'umd']
2197
- */
2148
+ * Output bundle formats
2149
+ * @default ['es', 'umd']
2150
+ */
2198
2151
  formats?: LibraryFormats[];
2199
2152
  /**
2200
- * The name of the package file output. The default file name is the name option
2201
- * of the project package.json. It can also be defined as a function taking the
2202
- * format as an argument.
2203
- */
2153
+ * The name of the package file output. The default file name is the name option
2154
+ * of the project package.json. It can also be defined as a function taking the
2155
+ * format as an argument.
2156
+ */
2204
2157
  fileName?: string | ((format: ModuleFormat, entryName: string) => string);
2205
2158
  /**
2206
- * The name of the CSS file output if the library imports CSS. Defaults to the
2207
- * same value as `build.lib.fileName` if it's set a string, otherwise it falls
2208
- * back to the name option of the project package.json.
2209
- */
2159
+ * The name of the CSS file output if the library imports CSS. Defaults to the
2160
+ * same value as `build.lib.fileName` if it's set a string, otherwise it falls
2161
+ * back to the name option of the project package.json.
2162
+ */
2210
2163
  cssFileName?: string;
2211
2164
  }
2212
2165
  type LibraryFormats = "es" | "cjs" | "umd" | "iife";
2213
2166
  interface ModulePreloadOptions {
2214
2167
  /**
2215
- * Whether to inject a module preload polyfill.
2216
- * Note: does not apply to library mode.
2217
- * @default true
2218
- */
2168
+ * Whether to inject a module preload polyfill.
2169
+ * Note: does not apply to library mode.
2170
+ * @default true
2171
+ */
2219
2172
  polyfill?: boolean;
2220
2173
  /**
2221
- * Resolve the list of dependencies to preload for a given dynamic import
2222
- * @experimental
2223
- */
2174
+ * Resolve the list of dependencies to preload for a given dynamic import
2175
+ * @experimental
2176
+ */
2224
2177
  resolveDependencies?: ResolveModulePreloadDependenciesFn;
2225
2178
  }
2226
2179
  interface ResolvedModulePreloadOptions {
@@ -2267,18 +2220,18 @@ interface ViteBuilder {
2267
2220
  }
2268
2221
  interface BuilderOptions {
2269
2222
  /**
2270
- * Whether to share the config instance among environments to align with the behavior of dev server.
2271
- *
2272
- * @default false
2273
- * @experimental
2274
- */
2223
+ * Whether to share the config instance among environments to align with the behavior of dev server.
2224
+ *
2225
+ * @default false
2226
+ * @experimental
2227
+ */
2275
2228
  sharedConfigBuild?: boolean;
2276
2229
  /**
2277
- * Whether to share the plugin instances among environments to align with the behavior of dev server.
2278
- *
2279
- * @default false
2280
- * @experimental
2281
- */
2230
+ * Whether to share the plugin instances among environments to align with the behavior of dev server.
2231
+ *
2232
+ * @default false
2233
+ * @experimental
2234
+ */
2282
2235
  sharedPlugins?: boolean;
2283
2236
  buildApp?: (builder: ViteBuilder) => Promise<void>;
2284
2237
  }
@@ -2334,8 +2287,7 @@ declare class EnvironmentPluginContainer<Env extends Environment = Environment>
2334
2287
  resolveId(rawId: string, importer?: string | undefined, options?: {
2335
2288
  kind?: ImportKind;
2336
2289
  attributes?: Record<string, string>;
2337
- custom?: CustomPluginOptions;
2338
- /** @deprecated use `skipCalls` instead */
2290
+ custom?: CustomPluginOptions; /** @deprecated use `skipCalls` instead */
2339
2291
  skip?: Set<Plugin>;
2340
2292
  skipCalls?: readonly SkipInformation[];
2341
2293
 
@@ -2385,8 +2337,7 @@ declare class PluginContainer {
2385
2337
  }): Promise<void>;
2386
2338
  resolveId(rawId: string, importer?: string, options?: {
2387
2339
  attributes?: Record<string, string>;
2388
- custom?: CustomPluginOptions;
2389
- /** @deprecated use `skipCalls` instead */
2340
+ custom?: CustomPluginOptions; /** @deprecated use `skipCalls` instead */
2390
2341
  skip?: Set<Plugin>;
2391
2342
  skipCalls?: readonly SkipInformation[];
2392
2343
  ssr?: boolean;
@@ -2421,87 +2372,87 @@ declare class PluginContainer {
2421
2372
  //#region src/node/server/index.d.ts
2422
2373
  interface ServerOptions$1 extends CommonServerOptions {
2423
2374
  /**
2424
- * Configure HMR-specific options (port, host, path & protocol)
2425
- */
2375
+ * Configure HMR-specific options (port, host, path & protocol)
2376
+ */
2426
2377
  hmr?: HmrOptions | boolean;
2427
2378
  /**
2428
- * Do not start the websocket connection.
2429
- * @experimental
2430
- */
2379
+ * Do not start the websocket connection.
2380
+ * @experimental
2381
+ */
2431
2382
  ws?: false;
2432
2383
  /**
2433
- * Warm-up files to transform and cache the results in advance. This improves the
2434
- * initial page load during server starts and prevents transform waterfalls.
2435
- */
2384
+ * Warm-up files to transform and cache the results in advance. This improves the
2385
+ * initial page load during server starts and prevents transform waterfalls.
2386
+ */
2436
2387
  warmup?: {
2437
2388
  /**
2438
- * The files to be transformed and used on the client-side. Supports glob patterns.
2439
- */
2389
+ * The files to be transformed and used on the client-side. Supports glob patterns.
2390
+ */
2440
2391
  clientFiles?: string[];
2441
2392
  /**
2442
- * The files to be transformed and used in SSR. Supports glob patterns.
2443
- */
2393
+ * The files to be transformed and used in SSR. Supports glob patterns.
2394
+ */
2444
2395
  ssrFiles?: string[];
2445
2396
  };
2446
2397
  /**
2447
- * chokidar watch options or null to disable FS watching
2448
- * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2449
- */
2398
+ * chokidar watch options or null to disable FS watching
2399
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2400
+ */
2450
2401
  watch?: WatchOptions | null;
2451
2402
  /**
2452
- * Create Vite dev server to be used as a middleware in an existing server
2453
- * @default false
2454
- */
2403
+ * Create Vite dev server to be used as a middleware in an existing server
2404
+ * @default false
2405
+ */
2455
2406
  middlewareMode?: boolean | {
2456
2407
  /**
2457
- * Parent server instance to attach to
2458
- *
2459
- * This is needed to proxy WebSocket connections to the parent server.
2460
- */
2408
+ * Parent server instance to attach to
2409
+ *
2410
+ * This is needed to proxy WebSocket connections to the parent server.
2411
+ */
2461
2412
  server: HttpServer;
2462
2413
  };
2463
2414
  /**
2464
- * Options for files served via '/\@fs/'.
2465
- */
2415
+ * Options for files served via '/\@fs/'.
2416
+ */
2466
2417
  fs?: FileSystemServeOptions;
2467
2418
  /**
2468
- * Origin for the generated asset URLs.
2469
- *
2470
- * @example `http://127.0.0.1:8080`
2471
- */
2419
+ * Origin for the generated asset URLs.
2420
+ *
2421
+ * @example `http://127.0.0.1:8080`
2422
+ */
2472
2423
  origin?: string;
2473
2424
  /**
2474
- * Pre-transform known direct imports
2475
- * @default true
2476
- */
2425
+ * Pre-transform known direct imports
2426
+ * @default true
2427
+ */
2477
2428
  preTransformRequests?: boolean;
2478
2429
  /**
2479
- * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
2480
- * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
2481
- *
2482
- * By default, it excludes all paths containing `node_modules`. You can pass `false` to
2483
- * disable this behavior, or, for full control, a function that takes the source path and
2484
- * sourcemap path and returns whether to ignore the source path.
2485
- */
2430
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
2431
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
2432
+ *
2433
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
2434
+ * disable this behavior, or, for full control, a function that takes the source path and
2435
+ * sourcemap path and returns whether to ignore the source path.
2436
+ */
2486
2437
  sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
2487
2438
  /**
2488
- * Backward compatibility. The buildStart and buildEnd hooks were called only once for
2489
- * the client environment. This option enables per-environment buildStart and buildEnd hooks.
2490
- * @default false
2491
- * @experimental
2492
- */
2439
+ * Backward compatibility. The buildStart and buildEnd hooks were called only once for
2440
+ * the client environment. This option enables per-environment buildStart and buildEnd hooks.
2441
+ * @default false
2442
+ * @experimental
2443
+ */
2493
2444
  perEnvironmentStartEndDuringDev?: boolean;
2494
2445
  /**
2495
- * Backward compatibility. The watchChange hook was called only once for the client environment.
2496
- * This option enables per-environment watchChange hooks.
2497
- * @default false
2498
- * @experimental
2499
- */
2446
+ * Backward compatibility. The watchChange hook was called only once for the client environment.
2447
+ * This option enables per-environment watchChange hooks.
2448
+ * @default false
2449
+ * @experimental
2450
+ */
2500
2451
  perEnvironmentWatchChangeDuringDev?: boolean;
2501
2452
  /**
2502
- * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2503
- * @experimental
2504
- */
2453
+ * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2454
+ * @experimental
2455
+ */
2505
2456
  hotUpdateEnvironments?: (server: ViteDevServer, hmr: (environment: DevEnvironment) => Promise<void>) => Promise<void>;
2506
2457
  }
2507
2458
  interface ResolvedServerOptions extends Omit<RequiredExceptFor<ServerOptions$1, "host" | "https" | "proxy" | "hmr" | "ws" | "watch" | "origin" | "hotUpdateEnvironments">, "fs" | "middlewareMode" | "sourcemapIgnoreList"> {
@@ -2511,156 +2462,156 @@ interface ResolvedServerOptions extends Omit<RequiredExceptFor<ServerOptions$1,
2511
2462
  }
2512
2463
  interface FileSystemServeOptions {
2513
2464
  /**
2514
- * Strictly restrict file accessing outside of allowing paths.
2515
- *
2516
- * Set to `false` to disable the warning
2517
- *
2518
- * @default true
2519
- */
2465
+ * Strictly restrict file accessing outside of allowing paths.
2466
+ *
2467
+ * Set to `false` to disable the warning
2468
+ *
2469
+ * @default true
2470
+ */
2520
2471
  strict?: boolean;
2521
2472
  /**
2522
- * Restrict accessing files outside the allowed directories.
2523
- *
2524
- * Accepts absolute path or a path relative to project root.
2525
- * Will try to search up for workspace root by default.
2526
- */
2473
+ * Restrict accessing files outside the allowed directories.
2474
+ *
2475
+ * Accepts absolute path or a path relative to project root.
2476
+ * Will try to search up for workspace root by default.
2477
+ */
2527
2478
  allow?: string[];
2528
2479
  /**
2529
- * Restrict accessing files that matches the patterns.
2530
- *
2531
- * This will have higher priority than `allow`.
2532
- * picomatch patterns are supported.
2533
- *
2534
- * @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
2535
- */
2480
+ * Restrict accessing files that matches the patterns.
2481
+ *
2482
+ * This will have higher priority than `allow`.
2483
+ * picomatch patterns are supported.
2484
+ *
2485
+ * @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
2486
+ */
2536
2487
  deny?: string[];
2537
2488
  }
2538
2489
  type ServerHook = (this: MinimalPluginContextWithoutEnvironment, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
2539
2490
  type HttpServer = http.Server | Http2SecureServer;
2540
2491
  interface ViteDevServer {
2541
2492
  /**
2542
- * The resolved vite config object
2543
- */
2493
+ * The resolved vite config object
2494
+ */
2544
2495
  config: ResolvedConfig;
2545
2496
  /**
2546
- * A connect app instance.
2547
- * - Can be used to attach custom middlewares to the dev server.
2548
- * - Can also be used as the handler function of a custom http server
2549
- * or as a middleware in any connect-style Node.js frameworks
2550
- *
2551
- * https://github.com/senchalabs/connect#use-middleware
2552
- */
2497
+ * A connect app instance.
2498
+ * - Can be used to attach custom middlewares to the dev server.
2499
+ * - Can also be used as the handler function of a custom http server
2500
+ * or as a middleware in any connect-style Node.js frameworks
2501
+ *
2502
+ * https://github.com/senchalabs/connect#use-middleware
2503
+ */
2553
2504
  middlewares: Connect.Server;
2554
2505
  /**
2555
- * native Node http server instance
2556
- * will be null in middleware mode
2557
- */
2506
+ * native Node http server instance
2507
+ * will be null in middleware mode
2508
+ */
2558
2509
  httpServer: HttpServer | null;
2559
2510
  /**
2560
- * Chokidar watcher instance. If `config.server.watch` is set to `null`,
2561
- * it will not watch any files and calling `add` or `unwatch` will have no effect.
2562
- * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2563
- */
2511
+ * Chokidar watcher instance. If `config.server.watch` is set to `null`,
2512
+ * it will not watch any files and calling `add` or `unwatch` will have no effect.
2513
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2514
+ */
2564
2515
  watcher: FSWatcher;
2565
2516
  /**
2566
- * WebSocket server with `send(payload)` method
2567
- */
2517
+ * WebSocket server with `send(payload)` method
2518
+ */
2568
2519
  ws: WebSocketServer;
2569
2520
  /**
2570
- * An alias to `server.environments.client.hot`.
2571
- * If you want to interact with all environments, loop over `server.environments`.
2572
- */
2521
+ * An alias to `server.environments.client.hot`.
2522
+ * If you want to interact with all environments, loop over `server.environments`.
2523
+ */
2573
2524
  hot: NormalizedHotChannel;
2574
2525
  /**
2575
- * Rollup plugin container that can run plugin hooks on a given file
2576
- */
2526
+ * Rollup plugin container that can run plugin hooks on a given file
2527
+ */
2577
2528
  pluginContainer: PluginContainer;
2578
2529
  /**
2579
- * Module execution environments attached to the Vite server.
2580
- */
2530
+ * Module execution environments attached to the Vite server.
2531
+ */
2581
2532
  environments: Record<"client" | "ssr" | (string & {}), DevEnvironment>;
2582
2533
  /**
2583
- * Module graph that tracks the import relationships, url to file mapping
2584
- * and hmr state.
2585
- */
2534
+ * Module graph that tracks the import relationships, url to file mapping
2535
+ * and hmr state.
2536
+ */
2586
2537
  moduleGraph: ModuleGraph;
2587
2538
  /**
2588
- * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
2589
- * in middleware mode or if the server is not listening on any port.
2590
- */
2539
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
2540
+ * in middleware mode or if the server is not listening on any port.
2541
+ */
2591
2542
  resolvedUrls: ResolvedServerUrls | null;
2592
2543
  /**
2593
- * Programmatically resolve, load and transform a URL and get the result
2594
- * without going through the http request pipeline.
2595
- */
2544
+ * Programmatically resolve, load and transform a URL and get the result
2545
+ * without going through the http request pipeline.
2546
+ */
2596
2547
  transformRequest(url: string, options?: TransformOptions): Promise<TransformResult | null>;
2597
2548
  /**
2598
- * Same as `transformRequest` but only warm up the URLs so the next request
2599
- * will already be cached. The function will never throw as it handles and
2600
- * reports errors internally.
2601
- */
2549
+ * Same as `transformRequest` but only warm up the URLs so the next request
2550
+ * will already be cached. The function will never throw as it handles and
2551
+ * reports errors internally.
2552
+ */
2602
2553
  warmupRequest(url: string, options?: TransformOptions): Promise<void>;
2603
2554
  /**
2604
- * Apply vite built-in HTML transforms and any plugin HTML transforms.
2605
- */
2555
+ * Apply vite built-in HTML transforms and any plugin HTML transforms.
2556
+ */
2606
2557
  transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
2607
2558
  /**
2608
- * Transform module code into SSR format.
2609
- */
2559
+ * Transform module code into SSR format.
2560
+ */
2610
2561
  ssrTransform(code: string, inMap: SourceMap | {
2611
2562
  mappings: "";
2612
2563
  } | null, url: string, originalCode?: string): Promise<TransformResult | null>;
2613
2564
  /**
2614
- * Load a given URL as an instantiated module for SSR.
2615
- */
2565
+ * Load a given URL as an instantiated module for SSR.
2566
+ */
2616
2567
  ssrLoadModule(url: string, opts?: {
2617
2568
  fixStacktrace?: boolean;
2618
2569
  }): Promise<Record<string, any>>;
2619
2570
  /**
2620
- * Returns a fixed version of the given stack
2621
- */
2571
+ * Returns a fixed version of the given stack
2572
+ */
2622
2573
  ssrRewriteStacktrace(stack: string): string;
2623
2574
  /**
2624
- * Mutates the given SSR error by rewriting the stacktrace
2625
- */
2575
+ * Mutates the given SSR error by rewriting the stacktrace
2576
+ */
2626
2577
  ssrFixStacktrace(e: Error): void;
2627
2578
  /**
2628
- * Triggers HMR for a module in the module graph. You can use the `server.moduleGraph`
2629
- * API to retrieve the module to be reloaded. If `hmr` is false, this is a no-op.
2630
- */
2579
+ * Triggers HMR for a module in the module graph. You can use the `server.moduleGraph`
2580
+ * API to retrieve the module to be reloaded. If `hmr` is false, this is a no-op.
2581
+ */
2631
2582
  reloadModule(module: ModuleNode): Promise<void>;
2632
2583
  /**
2633
- * Start the server.
2634
- */
2584
+ * Start the server.
2585
+ */
2635
2586
  listen(port?: number, isRestart?: boolean): Promise<ViteDevServer>;
2636
2587
  /**
2637
- * Stop the server.
2638
- */
2588
+ * Stop the server.
2589
+ */
2639
2590
  close(): Promise<void>;
2640
2591
  /**
2641
- * Print server urls
2642
- */
2592
+ * Print server urls
2593
+ */
2643
2594
  printUrls(): void;
2644
2595
  /**
2645
- * Bind CLI shortcuts
2646
- */
2596
+ * Bind CLI shortcuts
2597
+ */
2647
2598
  bindCLIShortcuts(options?: BindCLIShortcutsOptions<ViteDevServer>): void;
2648
2599
  /**
2649
- * Restart the server.
2650
- *
2651
- * @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
2652
- */
2600
+ * Restart the server.
2601
+ *
2602
+ * @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
2603
+ */
2653
2604
  restart(forceOptimize?: boolean): Promise<void>;
2654
2605
  /**
2655
- * Open browser
2656
- */
2606
+ * Open browser
2607
+ */
2657
2608
  openBrowser(): void;
2658
2609
  /**
2659
- * Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
2660
- * are processed. If called from a load or transform plugin hook, the id needs to be
2661
- * passed as a parameter to avoid deadlocks. Calling this function after the first
2662
- * static imports section of the module graph has been processed will resolve immediately.
2663
- */
2610
+ * Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
2611
+ * are processed. If called from a load or transform plugin hook, the id needs to be
2612
+ * passed as a parameter to avoid deadlocks. Calling this function after the first
2613
+ * static imports section of the module graph has been processed will resolve immediately.
2614
+ */
2664
2615
  waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
2665
2616
  }
2666
2617
  interface ResolvedServerUrls {
@@ -2673,13 +2624,13 @@ declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Pro
2673
2624
  interface HtmlTagDescriptor {
2674
2625
  tag: string;
2675
2626
  /**
2676
- * attribute values will be escaped automatically if needed
2677
- */
2627
+ * attribute values will be escaped automatically if needed
2628
+ */
2678
2629
  attrs?: Record<string, string | boolean | undefined>;
2679
2630
  children?: string | HtmlTagDescriptor[];
2680
2631
  /**
2681
- * default: 'head-prepend'
2682
- */
2632
+ * default: 'head-prepend'
2633
+ */
2683
2634
  injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
2684
2635
  }
2685
2636
  type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
@@ -2688,12 +2639,12 @@ type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
2688
2639
  };
2689
2640
  interface IndexHtmlTransformContext {
2690
2641
  /**
2691
- * public path when served
2692
- */
2642
+ * public path when served
2643
+ */
2693
2644
  path: string;
2694
2645
  /**
2695
- * filename on disk
2696
- */
2646
+ * filename on disk
2647
+ */
2697
2648
  filename: string;
2698
2649
  server?: ViteDevServer;
2699
2650
  bundle?: OutputBundle;
@@ -2741,8 +2692,8 @@ type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
2741
2692
  */
2742
2693
  interface PluginContextExtension {
2743
2694
  /**
2744
- * Vite-specific environment instance
2745
- */
2695
+ * Vite-specific environment instance
2696
+ */
2746
2697
  environment: Environment;
2747
2698
  }
2748
2699
  interface PluginContextMetaExtension {
@@ -2762,32 +2713,32 @@ declare module "rolldown" {
2762
2713
  * once per each environment allowing users to have completely different plugins
2763
2714
  * for each of them. The constructor gets the resolved environment after the server
2764
2715
  * and builder has already been created simplifying config access and cache
2765
- * management for for environment specific plugins.
2716
+ * management for environment specific plugins.
2766
2717
  * Environment Plugins are closer to regular rollup plugins. They can't define
2767
2718
  * app level hooks (like config, configResolved, configureServer, etc).
2768
2719
  */
2769
2720
  interface Plugin<A = any> extends Rolldown.Plugin<A> {
2770
2721
  /**
2771
- * Perform custom handling of HMR updates.
2772
- * The handler receives an options containing changed filename, timestamp, a
2773
- * list of modules affected by the file change, and the dev server instance.
2774
- *
2775
- * - The hook can return a filtered list of modules to narrow down the update.
2776
- * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2777
- * the descriptors.
2778
- *
2779
- * - The hook can also return an empty array and then perform custom updates
2780
- * by sending a custom hmr payload via environment.hot.send().
2781
- *
2782
- * - If the hook doesn't return a value, the hmr update will be performed as
2783
- * normal.
2784
- */
2722
+ * Perform custom handling of HMR updates.
2723
+ * The handler receives an options containing changed filename, timestamp, a
2724
+ * list of modules affected by the file change, and the dev server instance.
2725
+ *
2726
+ * - The hook can return a filtered list of modules to narrow down the update.
2727
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2728
+ * the descriptors.
2729
+ *
2730
+ * - The hook can also return an empty array and then perform custom updates
2731
+ * by sending a custom hmr payload via environment.hot.send().
2732
+ *
2733
+ * - If the hook doesn't return a value, the hmr update will be performed as
2734
+ * normal.
2735
+ */
2785
2736
  hotUpdate?: ObjectHook<(this: MinimalPluginContext & {
2786
2737
  environment: DevEnvironment;
2787
2738
  }, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>>;
2788
2739
  /**
2789
- * extend hooks with ssr flag
2790
- */
2740
+ * extend hooks with ssr flag
2741
+ */
2791
2742
  resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
2792
2743
  kind?: ImportKind;
2793
2744
  custom?: CustomPluginOptions;
@@ -2817,152 +2768,152 @@ interface Plugin<A = any> extends Rolldown.Plugin<A> {
2817
2768
  };
2818
2769
  }>;
2819
2770
  /**
2820
- * Opt-in this plugin into the shared plugins pipeline.
2821
- * For backward-compatibility, plugins are re-recreated for each environment
2822
- * during `vite build --app`
2823
- * We have an opt-in per plugin, and a general `builder.sharedPlugins`
2824
- * In a future major, we'll flip the default to be shared by default
2825
- * @experimental
2826
- */
2771
+ * Opt-in this plugin into the shared plugins pipeline.
2772
+ * For backward-compatibility, plugins are re-recreated for each environment
2773
+ * during `vite build --app`
2774
+ * We have an opt-in per plugin, and a general `builder.sharedPlugins`
2775
+ * In a future major, we'll flip the default to be shared by default
2776
+ * @experimental
2777
+ */
2827
2778
  sharedDuringBuild?: boolean;
2828
2779
  /**
2829
- * Opt-in this plugin into per-environment buildStart and buildEnd during dev.
2830
- * For backward-compatibility, the buildStart hook is called only once during
2831
- * dev, for the client environment. Plugins can opt-in to be called
2832
- * per-environment, aligning with the build hook behavior.
2833
- * @experimental
2834
- */
2780
+ * Opt-in this plugin into per-environment buildStart and buildEnd during dev.
2781
+ * For backward-compatibility, the buildStart hook is called only once during
2782
+ * dev, for the client environment. Plugins can opt-in to be called
2783
+ * per-environment, aligning with the build hook behavior.
2784
+ * @experimental
2785
+ */
2835
2786
  perEnvironmentStartEndDuringDev?: boolean;
2836
2787
  /**
2837
- * Opt-in this plugin into per-environment watchChange during dev.
2838
- * For backward-compatibility, the watchChange hook is called only once during
2839
- * dev, for the client environment. Plugins can opt-in to be called
2840
- * per-environment, aligning with the watchChange hook behavior.
2841
- * @experimental
2842
- */
2788
+ * Opt-in this plugin into per-environment watchChange during dev.
2789
+ * For backward-compatibility, the watchChange hook is called only once during
2790
+ * dev, for the client environment. Plugins can opt-in to be called
2791
+ * per-environment, aligning with the watchChange hook behavior.
2792
+ * @experimental
2793
+ */
2843
2794
  perEnvironmentWatchChangeDuringDev?: boolean;
2844
2795
  /**
2845
- * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
2846
- * is still subject to the `order` property in the hook object.
2847
- *
2848
- * Plugin invocation order:
2849
- * - alias resolution
2850
- * - `enforce: 'pre'` plugins
2851
- * - vite core plugins
2852
- * - normal plugins
2853
- * - vite build plugins
2854
- * - `enforce: 'post'` plugins
2855
- * - vite build post plugins
2856
- */
2796
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
2797
+ * is still subject to the `order` property in the hook object.
2798
+ *
2799
+ * Plugin invocation order:
2800
+ * - alias resolution
2801
+ * - `enforce: 'pre'` plugins
2802
+ * - vite core plugins
2803
+ * - normal plugins
2804
+ * - vite build plugins
2805
+ * - `enforce: 'post'` plugins
2806
+ * - vite build post plugins
2807
+ */
2857
2808
  enforce?: "pre" | "post";
2858
2809
  /**
2859
- * Apply the plugin only for serve or build, or on certain conditions.
2860
- */
2810
+ * Apply the plugin only for serve or build, or on certain conditions.
2811
+ */
2861
2812
  apply?: "serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean);
2862
2813
  /**
2863
- * Define environments where this plugin should be active
2864
- * By default, the plugin is active in all environments
2865
- * @experimental
2866
- */
2814
+ * Define environments where this plugin should be active
2815
+ * By default, the plugin is active in all environments
2816
+ * @experimental
2817
+ */
2867
2818
  applyToEnvironment?: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption;
2868
2819
  /**
2869
- * Modify vite config before it's resolved. The hook can either mutate the
2870
- * passed-in config directly, or return a partial config object that will be
2871
- * deeply merged into existing config.
2872
- *
2873
- * Note: User plugins are resolved before running this hook so injecting other
2874
- * plugins inside the `config` hook will have no effect.
2875
- */
2820
+ * Modify vite config before it's resolved. The hook can either mutate the
2821
+ * passed-in config directly, or return a partial config object that will be
2822
+ * deeply merged into existing config.
2823
+ *
2824
+ * Note: User plugins are resolved before running this hook so injecting other
2825
+ * plugins inside the `config` hook will have no effect.
2826
+ */
2876
2827
  config?: ObjectHook<(this: ConfigPluginContext, config: UserConfig, env: ConfigEnv) => Omit<UserConfig, "plugins"> | null | void | Promise<Omit<UserConfig, "plugins"> | null | void>>;
2877
2828
  /**
2878
- * Modify environment configs before it's resolved. The hook can either mutate the
2879
- * passed-in environment config directly, or return a partial config object that will be
2880
- * deeply merged into existing config.
2881
- * This hook is called for each environment with a partially resolved environment config
2882
- * that already accounts for the default environment config values set at the root level.
2883
- * If plugins need to modify the config of a given environment, they should do it in this
2884
- * hook instead of the config hook. Leaving the config hook only for modifying the root
2885
- * default environment config.
2886
- */
2829
+ * Modify environment configs before it's resolved. The hook can either mutate the
2830
+ * passed-in environment config directly, or return a partial config object that will be
2831
+ * deeply merged into existing config.
2832
+ * This hook is called for each environment with a partially resolved environment config
2833
+ * that already accounts for the default environment config values set at the root level.
2834
+ * If plugins need to modify the config of a given environment, they should do it in this
2835
+ * hook instead of the config hook. Leaving the config hook only for modifying the root
2836
+ * default environment config.
2837
+ */
2887
2838
  configEnvironment?: ObjectHook<(this: ConfigPluginContext, name: string, config: EnvironmentOptions, env: ConfigEnv & {
2888
2839
  /**
2889
- * Whether this environment is SSR environment and `ssr.target` is set to `'webworker'`.
2890
- * Only intended to be used for backward compatibility.
2891
- */
2840
+ * Whether this environment is SSR environment and `ssr.target` is set to `'webworker'`.
2841
+ * Only intended to be used for backward compatibility.
2842
+ */
2892
2843
  isSsrTargetWebworker?: boolean;
2893
2844
  }) => EnvironmentOptions | null | void | Promise<EnvironmentOptions | null | void>>;
2894
2845
  /**
2895
- * Use this hook to read and store the final resolved vite config.
2896
- */
2846
+ * Use this hook to read and store the final resolved vite config.
2847
+ */
2897
2848
  configResolved?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, config: ResolvedConfig) => void | Promise<void>>;
2898
2849
  /**
2899
- * Configure the vite server. The hook receives the {@link ViteDevServer}
2900
- * instance. This can also be used to store a reference to the server
2901
- * for use in other hooks.
2902
- *
2903
- * The hooks will be called before internal middlewares are applied. A hook
2904
- * can return a post hook that will be called after internal middlewares
2905
- * are applied. Hook can be async functions and will be called in series.
2906
- */
2850
+ * Configure the vite server. The hook receives the {@link ViteDevServer}
2851
+ * instance. This can also be used to store a reference to the server
2852
+ * for use in other hooks.
2853
+ *
2854
+ * The hooks will be called before internal middlewares are applied. A hook
2855
+ * can return a post hook that will be called after internal middlewares
2856
+ * are applied. Hook can be async functions and will be called in series.
2857
+ */
2907
2858
  configureServer?: ObjectHook<ServerHook>;
2908
2859
  /**
2909
- * Configure the preview server. The hook receives the {@link PreviewServer}
2910
- * instance. This can also be used to store a reference to the server
2911
- * for use in other hooks.
2912
- *
2913
- * The hooks are called before other middlewares are applied. A hook can
2914
- * return a post hook that will be called after other middlewares are
2915
- * applied. Hooks can be async functions and will be called in series.
2916
- */
2860
+ * Configure the preview server. The hook receives the {@link PreviewServer}
2861
+ * instance. This can also be used to store a reference to the server
2862
+ * for use in other hooks.
2863
+ *
2864
+ * The hooks are called before other middlewares are applied. A hook can
2865
+ * return a post hook that will be called after other middlewares are
2866
+ * applied. Hooks can be async functions and will be called in series.
2867
+ */
2917
2868
  configurePreviewServer?: ObjectHook<PreviewServerHook>;
2918
2869
  /**
2919
- * Transform index.html.
2920
- * The hook receives the following arguments:
2921
- *
2922
- * - html: string
2923
- * - ctx: IndexHtmlTransformContext, which contains:
2924
- * - path: public path when served
2925
- * - filename: filename on disk
2926
- * - server?: ViteDevServer (only present during serve)
2927
- * - bundle?: rollup.OutputBundle (only present during build)
2928
- * - chunk?: rollup.OutputChunk
2929
- * - originalUrl?: string
2930
- *
2931
- * It can either return a transformed string, or a list of html tag
2932
- * descriptors that will be injected into the `<head>` or `<body>`.
2933
- *
2934
- * By default the transform is applied **after** vite's internal html
2935
- * transform. If you need to apply the transform before vite, use an object:
2936
- * `{ order: 'pre', handler: hook }`
2937
- */
2870
+ * Transform index.html.
2871
+ * The hook receives the following arguments:
2872
+ *
2873
+ * - html: string
2874
+ * - ctx: IndexHtmlTransformContext, which contains:
2875
+ * - path: public path when served
2876
+ * - filename: filename on disk
2877
+ * - server?: ViteDevServer (only present during serve)
2878
+ * - bundle?: rollup.OutputBundle (only present during build)
2879
+ * - chunk?: rollup.OutputChunk
2880
+ * - originalUrl?: string
2881
+ *
2882
+ * It can either return a transformed string, or a list of html tag
2883
+ * descriptors that will be injected into the `<head>` or `<body>`.
2884
+ *
2885
+ * By default the transform is applied **after** vite's internal html
2886
+ * transform. If you need to apply the transform before vite, use an object:
2887
+ * `{ order: 'pre', handler: hook }`
2888
+ */
2938
2889
  transformIndexHtml?: IndexHtmlTransform;
2939
2890
  /**
2940
- * Build Environments
2941
- *
2942
- * @experimental
2943
- */
2891
+ * Build Environments
2892
+ *
2893
+ * @experimental
2894
+ */
2944
2895
  buildApp?: ObjectHook<BuildAppHook>;
2945
2896
  /**
2946
- * Perform custom handling of HMR updates.
2947
- * The handler receives a context containing changed filename, timestamp, a
2948
- * list of modules affected by the file change, and the dev server instance.
2949
- *
2950
- * - The hook can return a filtered list of modules to narrow down the update.
2951
- * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2952
- * the descriptors.
2953
- *
2954
- * - The hook can also return an empty array and then perform custom updates
2955
- * by sending a custom hmr payload via server.ws.send().
2956
- *
2957
- * - If the hook doesn't return a value, the hmr update will be performed as
2958
- * normal.
2959
- */
2897
+ * Perform custom handling of HMR updates.
2898
+ * The handler receives a context containing changed filename, timestamp, a
2899
+ * list of modules affected by the file change, and the dev server instance.
2900
+ *
2901
+ * - The hook can return a filtered list of modules to narrow down the update.
2902
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2903
+ * the descriptors.
2904
+ *
2905
+ * - The hook can also return an empty array and then perform custom updates
2906
+ * by sending a custom hmr payload via server.ws.send().
2907
+ *
2908
+ * - If the hook doesn't return a value, the hmr update will be performed as
2909
+ * normal.
2910
+ */
2960
2911
  handleHotUpdate?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, ctx: HmrContext) => Array<ModuleNode> | void | Promise<Array<ModuleNode> | void>>;
2961
2912
  /**
2962
- * This hook is not supported by Rolldown yet. But the type is declared for compatibility.
2963
- *
2964
- * @deprecated This hook is **not** deprecated. It is marked as deprecated just to make it clear that this hook is currently a no-op.
2965
- */
2913
+ * This hook is not supported by Rolldown yet. But the type is declared for compatibility.
2914
+ *
2915
+ * @deprecated This hook is **not** deprecated. It is marked as deprecated just to make it clear that this hook is currently a no-op.
2916
+ */
2966
2917
  shouldTransformCachedModule?: ObjectHook<(this: PluginContext, options: {
2967
2918
  code: string;
2968
2919
  id: string;
@@ -2971,7 +2922,7 @@ interface Plugin<A = any> extends Rolldown.Plugin<A> {
2971
2922
  }) => boolean | null | void>;
2972
2923
  }
2973
2924
  type HookHandler<T> = T extends ObjectHook<infer H> ? H : T;
2974
- type PluginWithRequiredHook<K$1 extends keyof Plugin> = Plugin & { [P in K$1]: NonNullable<Plugin[P]> };
2925
+ type PluginWithRequiredHook<K extends keyof Plugin> = Plugin & { [P in K]: NonNullable<Plugin[P]> };
2975
2926
  type Thenable<T> = T | Promise<T>;
2976
2927
  type FalsyPlugin = false | null | undefined;
2977
2928
  type PluginOption = Thenable<Plugin | {
@@ -2985,24 +2936,24 @@ declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environ
2985
2936
  //#region src/node/plugins/css.d.ts
2986
2937
  interface CSSOptions {
2987
2938
  /**
2988
- * Using lightningcss is an experimental option to handle CSS modules,
2989
- * assets and imports via Lightning CSS. It requires to install it as a
2990
- * peer dependency.
2991
- *
2992
- * @default 'postcss'
2993
- * @experimental
2994
- */
2939
+ * Using lightningcss is an experimental option to handle CSS modules,
2940
+ * assets and imports via Lightning CSS. It requires to install it as a
2941
+ * peer dependency.
2942
+ *
2943
+ * @default 'postcss'
2944
+ * @experimental
2945
+ */
2995
2946
  transformer?: "postcss" | "lightningcss";
2996
2947
  /**
2997
- * https://github.com/css-modules/postcss-modules
2998
- */
2948
+ * https://github.com/css-modules/postcss-modules
2949
+ */
2999
2950
  modules?: CSSModulesOptions | false;
3000
2951
  /**
3001
- * Options for preprocessors.
3002
- *
3003
- * In addition to options specific to each processors, Vite supports `additionalData` option.
3004
- * The `additionalData` option can be used to inject extra code for each style content.
3005
- */
2952
+ * Options for preprocessors.
2953
+ *
2954
+ * In addition to options specific to each processors, Vite supports `additionalData` option.
2955
+ * The `additionalData` option can be used to inject extra code for each style content.
2956
+ */
3006
2957
  preprocessorOptions?: {
3007
2958
  scss?: SassPreprocessorOptions;
3008
2959
  sass?: SassPreprocessorOptions;
@@ -3011,24 +2962,24 @@ interface CSSOptions {
3011
2962
  stylus?: StylusPreprocessorOptions;
3012
2963
  };
3013
2964
  /**
3014
- * If this option is set, preprocessors will run in workers when possible.
3015
- * `true` means the number of CPUs minus 1.
3016
- *
3017
- * @default true
3018
- */
2965
+ * If this option is set, preprocessors will run in workers when possible.
2966
+ * `true` means the number of CPUs minus 1.
2967
+ *
2968
+ * @default true
2969
+ */
3019
2970
  preprocessorMaxWorkers?: number | true;
3020
2971
  postcss?: string | (PostCSS.ProcessOptions & {
3021
2972
  plugins?: PostCSS.AcceptedPlugin[];
3022
2973
  });
3023
2974
  /**
3024
- * Enables css sourcemaps during dev
3025
- * @default false
3026
- * @experimental
3027
- */
2975
+ * Enables css sourcemaps during dev
2976
+ * @default false
2977
+ * @experimental
2978
+ */
3028
2979
  devSourcemap?: boolean;
3029
2980
  /**
3030
- * @experimental
3031
- */
2981
+ * @experimental
2982
+ */
3032
2983
  lightningcss?: lightningcssOptions_LightningCSSOptions;
3033
2984
  }
3034
2985
  interface CSSModulesOptions {
@@ -3039,8 +2990,8 @@ interface CSSModulesOptions {
3039
2990
  generateScopedName?: string | ((name: string, filename: string, css: string) => string);
3040
2991
  hashPrefix?: string;
3041
2992
  /**
3042
- * default: undefined
3043
- */
2993
+ * default: undefined
2994
+ */
3044
2995
  localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly" | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
3045
2996
  }
3046
2997
  type ResolvedCSSOptions = Omit<CSSOptions, "lightningcss"> & Required<Pick<CSSOptions, "transformer" | "devSourcemap">> & {
@@ -3078,8 +3029,8 @@ interface ESBuildOptions extends esbuildOptions_EsbuildTransformOptions {
3078
3029
  exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3079
3030
  jsxInject?: string;
3080
3031
  /**
3081
- * This option is not respected. Use `build.minify` instead.
3082
- */
3032
+ * This option is not respected. Use `build.minify` instead.
3033
+ */
3083
3034
  minify?: never;
3084
3035
  }
3085
3036
  type ESBuildTransformResult = Omit<EsbuildTransformResult, "map"> & {
@@ -3090,16 +3041,16 @@ declare function transformWithEsbuild(code: string, filename: string, options?:
3090
3041
  //#region src/node/plugins/json.d.ts
3091
3042
  interface JsonOptions {
3092
3043
  /**
3093
- * Generate a named export for every property of the JSON object
3094
- * @default true
3095
- */
3044
+ * Generate a named export for every property of the JSON object
3045
+ * @default true
3046
+ */
3096
3047
  namedExports?: boolean;
3097
3048
  /**
3098
- * Generate performant output as JSON.parse("stringified").
3099
- *
3100
- * When set to 'auto', the data will be stringified only if the data is bigger than 10kB.
3101
- * @default 'auto'
3102
- */
3049
+ * Generate performant output as JSON.parse("stringified").
3050
+ *
3051
+ * When set to 'auto', the data will be stringified only if the data is bigger than 10kB.
3052
+ * @default 'auto'
3053
+ */
3103
3054
  stringify?: boolean | "auto";
3104
3055
  }
3105
3056
  //#endregion
@@ -3110,35 +3061,35 @@ interface SSROptions {
3110
3061
  noExternal?: string | RegExp | (string | RegExp)[] | true;
3111
3062
  external?: string[] | true;
3112
3063
  /**
3113
- * Define the target for the ssr build. The browser field in package.json
3114
- * is ignored for node but used if webworker is the target
3115
- * This option will be removed in a future major version
3116
- * @default 'node'
3117
- */
3064
+ * Define the target for the ssr build. The browser field in package.json
3065
+ * is ignored for node but used if webworker is the target
3066
+ * This option will be removed in a future major version
3067
+ * @default 'node'
3068
+ */
3118
3069
  target?: SSRTarget;
3119
3070
  /**
3120
- * Control over which dependencies are optimized during SSR and esbuild options
3121
- * During build:
3122
- * no external CJS dependencies are optimized by default
3123
- * During dev:
3124
- * explicit no external CJS dependencies are optimized by default
3125
- * @experimental
3126
- */
3071
+ * Control over which dependencies are optimized during SSR and esbuild options
3072
+ * During build:
3073
+ * no external CJS dependencies are optimized by default
3074
+ * During dev:
3075
+ * explicit no external CJS dependencies are optimized by default
3076
+ * @experimental
3077
+ */
3127
3078
  optimizeDeps?: SsrDepOptimizationConfig;
3128
3079
  resolve?: {
3129
3080
  /**
3130
- * Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
3131
- *
3132
- * Use this to override the default ssr conditions for the ssr build.
3133
- *
3134
- * @default rootConfig.resolve.conditions
3135
- */
3081
+ * Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
3082
+ *
3083
+ * Use this to override the default ssr conditions for the ssr build.
3084
+ *
3085
+ * @default rootConfig.resolve.conditions
3086
+ */
3136
3087
  conditions?: string[];
3137
3088
  /**
3138
- * Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
3139
- *
3140
- * @default ['node', 'module-sync']
3141
- */
3089
+ * Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
3090
+ *
3091
+ * @default ['node', 'module-sync']
3092
+ */
3142
3093
  externalConditions?: string[];
3143
3094
  mainFields?: string[];
3144
3095
  };
@@ -3163,9 +3114,9 @@ declare function transformWithOxc(code: string, filename: string, options?: roll
3163
3114
  //#region src/node/config.d.ts
3164
3115
  interface ConfigEnv {
3165
3116
  /**
3166
- * 'serve': during dev (`vite` command)
3167
- * 'build': when building for production (`vite build` command)
3168
- */
3117
+ * 'serve': during dev (`vite` command)
3118
+ * 'build': when building for production (`vite build` command)
3119
+ */
3169
3120
  command: "build" | "serve";
3170
3121
  mode: string;
3171
3122
  isSsrBuild?: boolean;
@@ -3199,48 +3150,48 @@ interface CreateDevEnvironmentContext {
3199
3150
  }
3200
3151
  interface DevEnvironmentOptions {
3201
3152
  /**
3202
- * Files to be pre-transformed. Supports glob patterns.
3203
- */
3153
+ * Files to be pre-transformed. Supports glob patterns.
3154
+ */
3204
3155
  warmup?: string[];
3205
3156
  /**
3206
- * Pre-transform known direct imports
3207
- * defaults to true for the client environment, false for the rest
3208
- */
3157
+ * Pre-transform known direct imports
3158
+ * defaults to true for the client environment, false for the rest
3159
+ */
3209
3160
  preTransformRequests?: boolean;
3210
3161
  /**
3211
- * Enables sourcemaps during dev
3212
- * @default { js: true }
3213
- * @experimental
3214
- */
3162
+ * Enables sourcemaps during dev
3163
+ * @default { js: true }
3164
+ * @experimental
3165
+ */
3215
3166
  sourcemap?: boolean | {
3216
3167
  js?: boolean;
3217
3168
  css?: boolean;
3218
3169
  };
3219
3170
  /**
3220
- * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
3221
- * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
3222
- *
3223
- * By default, it excludes all paths containing `node_modules`. You can pass `false` to
3224
- * disable this behavior, or, for full control, a function that takes the source path and
3225
- * sourcemap path and returns whether to ignore the source path.
3226
- */
3171
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
3172
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
3173
+ *
3174
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
3175
+ * disable this behavior, or, for full control, a function that takes the source path and
3176
+ * sourcemap path and returns whether to ignore the source path.
3177
+ */
3227
3178
  sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
3228
3179
  /**
3229
- * create the Dev Environment instance
3230
- */
3180
+ * create the Dev Environment instance
3181
+ */
3231
3182
  createEnvironment?: (name: string, config: ResolvedConfig, context: CreateDevEnvironmentContext) => Promise<DevEnvironment> | DevEnvironment;
3232
3183
  /**
3233
- * For environments that support a full-reload, like the client, we can short-circuit when
3234
- * restarting the server throwing early to stop processing current files. We avoided this for
3235
- * SSR requests. Maybe this is no longer needed.
3236
- * @experimental
3237
- */
3184
+ * For environments that support a full-reload, like the client, we can short-circuit when
3185
+ * restarting the server throwing early to stop processing current files. We avoided this for
3186
+ * SSR requests. Maybe this is no longer needed.
3187
+ * @experimental
3188
+ */
3238
3189
  recoverable?: boolean;
3239
3190
  /**
3240
- * For environments associated with a module runner.
3241
- * By default, it is false for the client environment and true for non-client environments.
3242
- * This option can also be used instead of the removed config.experimental.skipSsrTransform.
3243
- */
3191
+ * For environments associated with a module runner.
3192
+ * By default, it is false for the client environment and true for non-client environments.
3193
+ * This option can also be used instead of the removed config.experimental.skipSsrTransform.
3194
+ */
3244
3195
  moduleRunnerTransform?: boolean;
3245
3196
  }
3246
3197
  type ResolvedDevEnvironmentOptions = Omit<Required<DevEnvironmentOptions>, "sourcemapIgnoreList"> & {
@@ -3251,37 +3202,37 @@ type AllResolveOptions = ResolveOptions & {
3251
3202
  };
3252
3203
  interface SharedEnvironmentOptions {
3253
3204
  /**
3254
- * Define global variable replacements.
3255
- * Entries will be defined on `window` during dev and replaced during build.
3256
- */
3205
+ * Define global variable replacements.
3206
+ * Entries will be defined on `window` during dev and replaced during build.
3207
+ */
3257
3208
  define?: Record<string, any>;
3258
3209
  /**
3259
- * Configure resolver
3260
- */
3210
+ * Configure resolver
3211
+ */
3261
3212
  resolve?: EnvironmentResolveOptions;
3262
3213
  /**
3263
- * Define if this environment is used for Server-Side Rendering
3264
- * @default 'server' if it isn't the client environment
3265
- */
3214
+ * Define if this environment is used for Server-Side Rendering
3215
+ * @default 'server' if it isn't the client environment
3216
+ */
3266
3217
  consumer?: "client" | "server";
3267
3218
  /**
3268
- * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
3269
- * Otherwise, it is statically replaced as an empty object.
3270
- */
3219
+ * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
3220
+ * Otherwise, it is statically replaced as an empty object.
3221
+ */
3271
3222
  keepProcessEnv?: boolean;
3272
3223
  /**
3273
- * Optimize deps config
3274
- */
3224
+ * Optimize deps config
3225
+ */
3275
3226
  optimizeDeps?: DepOptimizationOptions;
3276
3227
  }
3277
3228
  interface EnvironmentOptions extends SharedEnvironmentOptions {
3278
3229
  /**
3279
- * Dev specific options
3280
- */
3230
+ * Dev specific options
3231
+ */
3281
3232
  dev?: DevEnvironmentOptions;
3282
3233
  /**
3283
- * Build specific options
3284
- */
3234
+ * Build specific options
3235
+ */
3285
3236
  build?: BuildEnvironmentOptions;
3286
3237
  }
3287
3238
  type ResolvedResolveOptions = Required<ResolveOptions>;
@@ -3300,181 +3251,181 @@ type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve"
3300
3251
  };
3301
3252
  interface UserConfig extends DefaultEnvironmentOptions {
3302
3253
  /**
3303
- * Project root directory. Can be an absolute path, or a path relative from
3304
- * the location of the config file itself.
3305
- * @default process.cwd()
3306
- */
3254
+ * Project root directory. Can be an absolute path, or a path relative from
3255
+ * the location of the config file itself.
3256
+ * @default process.cwd()
3257
+ */
3307
3258
  root?: string;
3308
3259
  /**
3309
- * Base public path when served in development or production.
3310
- * @default '/'
3311
- */
3260
+ * Base public path when served in development or production.
3261
+ * @default '/'
3262
+ */
3312
3263
  base?: string;
3313
3264
  /**
3314
- * Directory to serve as plain static assets. Files in this directory are
3315
- * served and copied to build dist dir as-is without transform. The value
3316
- * can be either an absolute file system path or a path relative to project root.
3317
- *
3318
- * Set to `false` or an empty string to disable copied static assets to build dist dir.
3319
- * @default 'public'
3320
- */
3265
+ * Directory to serve as plain static assets. Files in this directory are
3266
+ * served and copied to build dist dir as-is without transform. The value
3267
+ * can be either an absolute file system path or a path relative to project root.
3268
+ *
3269
+ * Set to `false` or an empty string to disable copied static assets to build dist dir.
3270
+ * @default 'public'
3271
+ */
3321
3272
  publicDir?: string | false;
3322
3273
  /**
3323
- * Directory to save cache files. Files in this directory are pre-bundled
3324
- * deps or some other cache files that generated by vite, which can improve
3325
- * the performance. You can use `--force` flag or manually delete the directory
3326
- * to regenerate the cache files. The value can be either an absolute file
3327
- * system path or a path relative to project root.
3328
- * Default to `.vite` when no `package.json` is detected.
3329
- * @default 'node_modules/.vite'
3330
- */
3274
+ * Directory to save cache files. Files in this directory are pre-bundled
3275
+ * deps or some other cache files that generated by vite, which can improve
3276
+ * the performance. You can use `--force` flag or manually delete the directory
3277
+ * to regenerate the cache files. The value can be either an absolute file
3278
+ * system path or a path relative to project root.
3279
+ * Default to `.vite` when no `package.json` is detected.
3280
+ * @default 'node_modules/.vite'
3281
+ */
3331
3282
  cacheDir?: string;
3332
3283
  /**
3333
- * Explicitly set a mode to run in. This will override the default mode for
3334
- * each command, and can be overridden by the command line --mode option.
3335
- */
3284
+ * Explicitly set a mode to run in. This will override the default mode for
3285
+ * each command, and can be overridden by the command line --mode option.
3286
+ */
3336
3287
  mode?: string;
3337
3288
  /**
3338
- * Array of vite plugins to use.
3339
- */
3289
+ * Array of vite plugins to use.
3290
+ */
3340
3291
  plugins?: PluginOption[];
3341
3292
  /**
3342
- * HTML related options
3343
- */
3293
+ * HTML related options
3294
+ */
3344
3295
  html?: HTMLOptions;
3345
3296
  /**
3346
- * CSS related options (preprocessors and CSS modules)
3347
- */
3297
+ * CSS related options (preprocessors and CSS modules)
3298
+ */
3348
3299
  css?: CSSOptions;
3349
3300
  /**
3350
- * JSON loading options
3351
- */
3301
+ * JSON loading options
3302
+ */
3352
3303
  json?: JsonOptions;
3353
3304
  /**
3354
- * Transform options to pass to esbuild.
3355
- * Or set to `false` to disable esbuild.
3356
- *
3357
- * @deprecated Use `oxc` option instead.
3358
- */
3305
+ * Transform options to pass to esbuild.
3306
+ * Or set to `false` to disable esbuild.
3307
+ *
3308
+ * @deprecated Use `oxc` option instead.
3309
+ */
3359
3310
  esbuild?: ESBuildOptions | false;
3360
3311
  /**
3361
- * Transform options to pass to Oxc.
3362
- * Or set to `false` to disable Oxc.
3363
- */
3312
+ * Transform options to pass to Oxc.
3313
+ * Or set to `false` to disable Oxc.
3314
+ */
3364
3315
  oxc?: OxcOptions | false;
3365
3316
  /**
3366
- * Specify additional picomatch patterns to be treated as static assets.
3367
- */
3317
+ * Specify additional picomatch patterns to be treated as static assets.
3318
+ */
3368
3319
  assetsInclude?: string | RegExp | (string | RegExp)[];
3369
3320
  /**
3370
- * Builder specific options
3371
- * @experimental
3372
- */
3321
+ * Builder specific options
3322
+ * @experimental
3323
+ */
3373
3324
  builder?: BuilderOptions;
3374
3325
  /**
3375
- * Server specific options, e.g. host, port, https...
3376
- */
3326
+ * Server specific options, e.g. host, port, https...
3327
+ */
3377
3328
  server?: ServerOptions$1;
3378
3329
  /**
3379
- * Preview specific options, e.g. host, port, https...
3380
- */
3330
+ * Preview specific options, e.g. host, port, https...
3331
+ */
3381
3332
  preview?: PreviewOptions;
3382
3333
  /**
3383
- * Experimental features
3384
- *
3385
- * Features under this field could change in the future and might NOT follow semver.
3386
- * Please be careful and always pin Vite's version when using them.
3387
- * @experimental
3388
- */
3334
+ * Experimental features
3335
+ *
3336
+ * Features under this field could change in the future and might NOT follow semver.
3337
+ * Please be careful and always pin Vite's version when using them.
3338
+ * @experimental
3339
+ */
3389
3340
  experimental?: ExperimentalOptions;
3390
3341
  /**
3391
- * Options to opt-in to future behavior
3392
- */
3342
+ * Options to opt-in to future behavior
3343
+ */
3393
3344
  future?: FutureOptions | "warn";
3394
3345
  /**
3395
- * Legacy options
3396
- *
3397
- * Features under this field only follow semver for patches, they could be removed in a
3398
- * future minor version. Please always pin Vite's version to a minor when using them.
3399
- */
3346
+ * Legacy options
3347
+ *
3348
+ * Features under this field only follow semver for patches, they could be removed in a
3349
+ * future minor version. Please always pin Vite's version to a minor when using them.
3350
+ */
3400
3351
  legacy?: LegacyOptions;
3401
3352
  /**
3402
- * Log level.
3403
- * @default 'info'
3404
- */
3353
+ * Log level.
3354
+ * @default 'info'
3355
+ */
3405
3356
  logLevel?: LogLevel;
3406
3357
  /**
3407
- * Custom logger.
3408
- */
3358
+ * Custom logger.
3359
+ */
3409
3360
  customLogger?: Logger;
3410
3361
  /**
3411
- * @default true
3412
- */
3362
+ * @default true
3363
+ */
3413
3364
  clearScreen?: boolean;
3414
3365
  /**
3415
- * Environment files directory. Can be an absolute path, or a path relative from
3416
- * root.
3417
- * @default root
3418
- */
3366
+ * Environment files directory. Can be an absolute path, or a path relative from
3367
+ * root.
3368
+ * @default root
3369
+ */
3419
3370
  envDir?: string | false;
3420
3371
  /**
3421
- * Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
3422
- * @default 'VITE_'
3423
- */
3372
+ * Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
3373
+ * @default 'VITE_'
3374
+ */
3424
3375
  envPrefix?: string | string[];
3425
3376
  /**
3426
- * Worker bundle options
3427
- */
3377
+ * Worker bundle options
3378
+ */
3428
3379
  worker?: {
3429
3380
  /**
3430
- * Output format for worker bundle
3431
- * @default 'iife'
3432
- */
3381
+ * Output format for worker bundle
3382
+ * @default 'iife'
3383
+ */
3433
3384
  format?: "es" | "iife";
3434
3385
  /**
3435
- * Vite plugins that apply to worker bundle. The plugins returned by this function
3436
- * should be new instances every time it is called, because they are used for each
3437
- * rolldown worker bundling process.
3438
- */
3386
+ * Vite plugins that apply to worker bundle. The plugins returned by this function
3387
+ * should be new instances every time it is called, because they are used for each
3388
+ * rolldown worker bundling process.
3389
+ */
3439
3390
  plugins?: () => PluginOption[];
3440
3391
  /**
3441
- * Alias to `rolldownOptions`.
3442
- * @deprecated Use `rolldownOptions` instead.
3443
- */
3392
+ * Alias to `rolldownOptions`.
3393
+ * @deprecated Use `rolldownOptions` instead.
3394
+ */
3444
3395
  rollupOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3445
3396
  /**
3446
- * Rolldown options to build worker bundle
3447
- */
3397
+ * Rolldown options to build worker bundle
3398
+ */
3448
3399
  rolldownOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3449
3400
  };
3450
3401
  /**
3451
- * Dep optimization options
3452
- */
3402
+ * Dep optimization options
3403
+ */
3453
3404
  optimizeDeps?: DepOptimizationOptions;
3454
3405
  /**
3455
- * SSR specific options
3456
- * We could make SSROptions be a EnvironmentOptions if we can abstract
3457
- * external/noExternal for environments in general.
3458
- */
3406
+ * SSR specific options
3407
+ * We could make SSROptions be a EnvironmentOptions if we can abstract
3408
+ * external/noExternal for environments in general.
3409
+ */
3459
3410
  ssr?: SSROptions;
3460
3411
  /**
3461
- * Environment overrides
3462
- */
3412
+ * Environment overrides
3413
+ */
3463
3414
  environments?: Record<string, EnvironmentOptions>;
3464
3415
  /**
3465
- * Whether your application is a Single Page Application (SPA),
3466
- * a Multi-Page Application (MPA), or Custom Application (SSR
3467
- * and frameworks with custom HTML handling)
3468
- * @default 'spa'
3469
- */
3416
+ * Whether your application is a Single Page Application (SPA),
3417
+ * a Multi-Page Application (MPA), or Custom Application (SSR
3418
+ * and frameworks with custom HTML handling)
3419
+ * @default 'spa'
3420
+ */
3470
3421
  appType?: AppType;
3471
3422
  }
3472
3423
  interface HTMLOptions {
3473
3424
  /**
3474
- * A nonce value placeholder that will be used when generating script/style tags.
3475
- *
3476
- * Make sure that this placeholder will be replaced with a unique value for each request by the server.
3477
- */
3425
+ * A nonce value placeholder that will be used when generating script/style tags.
3426
+ *
3427
+ * Make sure that this placeholder will be replaced with a unique value for each request by the server.
3428
+ */
3478
3429
  cspNonce?: string;
3479
3430
  }
3480
3431
  interface FutureOptions {
@@ -3490,78 +3441,78 @@ interface FutureOptions {
3490
3441
  }
3491
3442
  interface ExperimentalOptions {
3492
3443
  /**
3493
- * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
3494
- *
3495
- * @experimental
3496
- * @default false
3497
- */
3444
+ * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
3445
+ *
3446
+ * @experimental
3447
+ * @default false
3448
+ */
3498
3449
  importGlobRestoreExtension?: boolean;
3499
3450
  /**
3500
- * Allow finegrain control over assets and public files paths
3501
- *
3502
- * @experimental
3503
- */
3451
+ * Allow finegrain control over assets and public files paths
3452
+ *
3453
+ * @experimental
3454
+ */
3504
3455
  renderBuiltUrl?: RenderBuiltAssetUrl;
3505
3456
  /**
3506
- * Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
3507
- *
3508
- * @experimental
3509
- * @default false
3510
- */
3457
+ * Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
3458
+ *
3459
+ * @experimental
3460
+ * @default false
3461
+ */
3511
3462
  hmrPartialAccept?: boolean;
3512
3463
  /**
3513
- * Enable builtin plugin that written by rust, which is faster than js plugin.
3514
- *
3515
- * - 'resolver' (deprecated, will be removed in v8 stable): Enable only the native resolver plugin.
3516
- * - 'v1' (will be deprecated, will be removed in v8 stable): Enable the first stable set of native plugins (including resolver).
3517
- * - 'v2' (will be deprecated, will be removed in v8 stable): Enable the improved dynamicImportVarsPlugin and importGlobPlugin.
3518
- * - true: Enable all native plugins (currently an alias of 'v2', it will map to a newer one in the future versions).
3519
- *
3520
- * @experimental
3521
- * @default 'v2'
3522
- */
3464
+ * Enable builtin plugin that written by rust, which is faster than js plugin.
3465
+ *
3466
+ * - 'resolver' (deprecated, will be removed in v8 stable): Enable only the native resolver plugin.
3467
+ * - 'v1' (will be deprecated, will be removed in v8 stable): Enable the first stable set of native plugins (including resolver).
3468
+ * - 'v2' (will be deprecated, will be removed in v8 stable): Enable the improved dynamicImportVarsPlugin and importGlobPlugin.
3469
+ * - true: Enable all native plugins (currently an alias of 'v2', it will map to a newer one in the future versions).
3470
+ *
3471
+ * @experimental
3472
+ * @default 'v2'
3473
+ */
3523
3474
  enableNativePlugin?: boolean | "resolver" | "v1" | "v2";
3524
3475
  /**
3525
- * Enable full bundle mode.
3526
- *
3527
- * This is highly experimental.
3528
- *
3529
- * @experimental
3530
- * @default false
3531
- */
3476
+ * Enable full bundle mode.
3477
+ *
3478
+ * This is highly experimental.
3479
+ *
3480
+ * @experimental
3481
+ * @default false
3482
+ */
3532
3483
  bundledDev?: boolean;
3533
3484
  }
3534
3485
  interface LegacyOptions {
3535
3486
  /**
3536
- * In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
3537
- * that could be exploited by a malicious web page.
3538
- *
3539
- * In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
3540
- * But this may break some plugins and frameworks that connects to the WebSocket server
3541
- * on their own. Enabling this option will make Vite skip the token check.
3542
- *
3543
- * **We do not recommend enabling this option unless you are sure that you are fine with
3544
- * that security weakness.**
3545
- */
3487
+ * In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
3488
+ * that could be exploited by a malicious web page.
3489
+ *
3490
+ * In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
3491
+ * But this may break some plugins and frameworks that connects to the WebSocket server
3492
+ * on their own. Enabling this option will make Vite skip the token check.
3493
+ *
3494
+ * **We do not recommend enabling this option unless you are sure that you are fine with
3495
+ * that security weakness.**
3496
+ */
3546
3497
  skipWebSocketTokenCheck?: boolean;
3547
3498
  /**
3548
- * Opt-in to the pre-Vite 8 CJS interop behavior, which was inconsistent.
3549
- *
3550
- * In pre-Vite 8 versions, Vite had inconsistent CJS interop behavior. This was due to
3551
- * the different behavior of esbuild and the Rollup commonjs plugin.
3552
- * Vite 8+ uses Rolldown for both the dependency optimization in dev and the production build,
3553
- * which aligns the behavior to esbuild.
3554
- *
3555
- * See the Vite 8 migration guide for more details.
3556
- */
3499
+ * Opt-in to the pre-Vite 8 CJS interop behavior, which was inconsistent.
3500
+ *
3501
+ * In pre-Vite 8 versions, Vite had inconsistent CJS interop behavior. This was due to
3502
+ * the different behavior of esbuild and the Rollup commonjs plugin.
3503
+ * Vite 8+ uses Rolldown for both the dependency optimization in dev and the production build,
3504
+ * which aligns the behavior to esbuild.
3505
+ *
3506
+ * See the Vite 8 migration guide for more details.
3507
+ */
3557
3508
  inconsistentCjsInterop?: boolean;
3558
3509
  }
3559
3510
  interface ResolvedWorkerOptions {
3560
3511
  format: "es" | "iife";
3561
3512
  plugins: (bundleChain: string[]) => Promise<ResolvedConfig>;
3562
3513
  /**
3563
- * @deprecated Use `rolldownOptions` instead.
3564
- */
3514
+ * @deprecated Use `rolldownOptions` instead.
3515
+ */
3565
3516
  rollupOptions: RolldownOptions;
3566
3517
  rolldownOptions: RolldownOptions;
3567
3518
  }
@@ -3582,8 +3533,7 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
3582
3533
  publicDir: string;
3583
3534
  cacheDir: string;
3584
3535
  command: "build" | "serve";
3585
- mode: string;
3586
- /** `true` when build or full-bundle mode dev */
3536
+ mode: string; /** `true` when build or full-bundle mode dev */
3587
3537
  isBundled: boolean;
3588
3538
  isWorker: boolean;
3589
3539
  isProduction: boolean;
@@ -3594,13 +3544,11 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
3594
3544
  };
3595
3545
  plugins: readonly Plugin[];
3596
3546
  css: ResolvedCSSOptions;
3597
- json: Required<JsonOptions>;
3598
- /** @deprecated Use `oxc` option instead. */
3547
+ json: Required<JsonOptions>; /** @deprecated Use `oxc` option instead. */
3599
3548
  esbuild: ESBuildOptions | false;
3600
3549
  oxc: OxcOptions | false;
3601
3550
  server: ResolvedServerOptions;
3602
- dev: ResolvedDevEnvironmentOptions;
3603
- /** @experimental */
3551
+ dev: ResolvedDevEnvironmentOptions; /** @experimental */
3604
3552
  builder: ResolvedBuilderOptions | undefined;
3605
3553
  build: ResolvedBuildOptions;
3606
3554
  preview: ResolvedPreviewOptions;
@@ -3609,15 +3557,15 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
3609
3557
  rawAssetsInclude: (string | RegExp)[];
3610
3558
  logger: Logger;
3611
3559
  /**
3612
- * Create an internal resolver to be used in special scenarios, e.g.
3613
- * optimizer & handling css `@imports`.
3614
- *
3615
- * This API is deprecated. It only works for the client and ssr
3616
- * environments. The `aliasOnly` option is also not being used anymore.
3617
- * Plugins should move to `createIdResolver(environment.config)` instead.
3618
- *
3619
- * @deprecated Use `createIdResolver` from `vite` instead.
3620
- */
3560
+ * Create an internal resolver to be used in special scenarios, e.g.
3561
+ * optimizer & handling css `@imports`.
3562
+ *
3563
+ * This API is deprecated. It only works for the client and ssr
3564
+ * environments. The `aliasOnly` option is also not being used anymore.
3565
+ * Plugins should move to `createIdResolver(environment.config)` instead.
3566
+ *
3567
+ * @deprecated Use `createIdResolver` from `vite` instead.
3568
+ */
3621
3569
  createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
3622
3570
  optimizeDeps: DepOptimizationOptions;
3623
3571
  worker: ResolvedWorkerOptions;
@@ -3626,20 +3574,20 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
3626
3574
  future: FutureOptions | undefined;
3627
3575
  environments: Record<string, ResolvedEnvironmentOptions>;
3628
3576
  /**
3629
- * The token to connect to the WebSocket server from browsers.
3630
- *
3631
- * We recommend using `import.meta.hot` rather than connecting
3632
- * to the WebSocket server directly.
3633
- * If you have a usecase that requires connecting to the WebSocket
3634
- * server, please create an issue so that we can discuss.
3635
- *
3636
- * @deprecated
3637
- */
3577
+ * The token to connect to the WebSocket server from browsers.
3578
+ *
3579
+ * We recommend using `import.meta.hot` rather than connecting
3580
+ * to the WebSocket server directly.
3581
+ * If you have a usecase that requires connecting to the WebSocket
3582
+ * server, please create an issue so that we can discuss.
3583
+ *
3584
+ * @deprecated
3585
+ */
3638
3586
  webSocketToken: string;
3639
3587
  } & PluginHookUtils> {}
3640
3588
  interface PluginHookUtils {
3641
- getSortedPlugins: <K$1 extends keyof Plugin>(hookName: K$1) => PluginWithRequiredHook<K$1>[];
3642
- getSortedPluginHooks: <K$1 extends keyof Plugin>(hookName: K$1) => NonNullable<HookHandler<Plugin[K$1]>>[];
3589
+ getSortedPlugins: <K extends keyof Plugin>(hookName: K) => PluginWithRequiredHook<K>[];
3590
+ getSortedPluginHooks: <K extends keyof Plugin>(hookName: K) => NonNullable<HookHandler<Plugin[K]>>[];
3643
3591
  }
3644
3592
  type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
3645
3593
  declare function resolveConfig(inlineConfig: InlineConfig, command: "build" | "serve", defaultMode?: string, defaultNodeEnv?: string, isPreview?: boolean, patchConfig?: ((config: ResolvedConfig) => void) | undefined, patchPlugins?: ((resolvedPlugins: Plugin[]) => void) | undefined): Promise<ResolvedConfig>;
@@ -3667,14 +3615,14 @@ declare function buildErrorMessage(err: RollupError, args?: string[], includeSta
3667
3615
  */
3668
3616
  interface ServerModuleRunnerOptions extends Omit<ModuleRunnerOptions, "root" | "fetchModule" | "hmr" | "transport"> {
3669
3617
  /**
3670
- * Disable HMR or configure HMR logger.
3671
- */
3618
+ * Disable HMR or configure HMR logger.
3619
+ */
3672
3620
  hmr?: false | {
3673
3621
  logger?: ModuleRunnerHmr["logger"];
3674
3622
  };
3675
3623
  /**
3676
- * Provide a custom module evaluator. This controls how the code is executed.
3677
- */
3624
+ * Provide a custom module evaluator. This controls how the code is executed.
3625
+ */
3678
3626
  evaluator?: ModuleEvaluator;
3679
3627
  }
3680
3628
  declare const createServerModuleRunnerTransport: (options: {
@@ -3810,50 +3758,50 @@ declare function resolveEnvPrefix({
3810
3758
  type Manifest = Record<string, ManifestChunk>;
3811
3759
  interface ManifestChunk {
3812
3760
  /**
3813
- * The input file name of this chunk / asset if known
3814
- */
3761
+ * The input file name of this chunk / asset if known
3762
+ */
3815
3763
  src?: string;
3816
3764
  /**
3817
- * The output file name of this chunk / asset
3818
- */
3765
+ * The output file name of this chunk / asset
3766
+ */
3819
3767
  file: string;
3820
3768
  /**
3821
- * The list of CSS files imported by this chunk
3822
- *
3823
- * This field is only present in JS chunks.
3824
- */
3769
+ * The list of CSS files imported by this chunk
3770
+ *
3771
+ * This field is only present in JS chunks.
3772
+ */
3825
3773
  css?: string[];
3826
3774
  /**
3827
- * The list of asset files imported by this chunk, excluding CSS files
3828
- *
3829
- * This field is only present in JS chunks.
3830
- */
3775
+ * The list of asset files imported by this chunk, excluding CSS files
3776
+ *
3777
+ * This field is only present in JS chunks.
3778
+ */
3831
3779
  assets?: string[];
3832
3780
  /**
3833
- * Whether this chunk or asset is an entry point
3834
- */
3781
+ * Whether this chunk or asset is an entry point
3782
+ */
3835
3783
  isEntry?: boolean;
3836
3784
  /**
3837
- * The name of this chunk / asset if known
3838
- */
3785
+ * The name of this chunk / asset if known
3786
+ */
3839
3787
  name?: string;
3840
3788
  /**
3841
- * Whether this chunk is a dynamic entry point
3842
- *
3843
- * This field is only present in JS chunks.
3844
- */
3789
+ * Whether this chunk is a dynamic entry point
3790
+ *
3791
+ * This field is only present in JS chunks.
3792
+ */
3845
3793
  isDynamicEntry?: boolean;
3846
3794
  /**
3847
- * The list of statically imported chunks by this chunk
3848
- *
3849
- * The values are the keys of the manifest. This field is only present in JS chunks.
3850
- */
3795
+ * The list of statically imported chunks by this chunk
3796
+ *
3797
+ * The values are the keys of the manifest. This field is only present in JS chunks.
3798
+ */
3851
3799
  imports?: string[];
3852
3800
  /**
3853
- * The list of dynamically imported chunks by this chunk
3854
- *
3855
- * The values are the keys of the manifest. This field is only present in JS chunks.
3856
- */
3801
+ * The list of dynamically imported chunks by this chunk
3802
+ *
3803
+ * The values are the keys of the manifest. This field is only present in JS chunks.
3804
+ */
3857
3805
  dynamicImports?: string[];
3858
3806
  }
3859
3807
  //#endregion