@ohos-ports/vite 8.3.0-beta.0

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.
@@ -0,0 +1,4060 @@
1
+ /// <reference types="node" />
2
+ import { t as ModuleRunnerTransport } from "./chunks/moduleRunnerTransport.js";
3
+ import { CustomEventMap, InferCustomEventPayload, InferCustomEventPayload as hmrPayload_InferCustomEventPayload, InvalidatePayload } from "#types/customEvent";
4
+ import { ConnectedPayload, CustomPayload, CustomPayload as hmrPayload_CustomPayload, ErrorPayload, FullReloadPayload, HMRPayload, HotPayload, HotPayload as hmrPayload_HotPayload, PrunePayload, Update, UpdatePayload } from "#types/hmrPayload";
5
+ import * as Rolldown from "rolldown";
6
+ import { CustomPluginOptions, ExistingRawSourceMap, FunctionPluginHooks, ImportKind, InputOption, InputOptions, LoadResult, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleType, ModuleTypeFilter, ObjectHook, OutputBundle, OutputChunk, OutputOptions, PartialResolvedId, PluginContext, PluginContextMeta, ResolveIdResult, RolldownOptions, RolldownOutput, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, TransformPluginContext, VERSION as rolldownVersion, WatcherOptions } from "rolldown";
7
+ import { parseAst as parseAst$1, parseAstAsync as parseAstAsync$1 } from "rolldown/parseAst";
8
+ import * as Rollup from "#types/internal/rollupTypeCompat";
9
+ import { esmExternalRequirePlugin } from "rolldown/plugins";
10
+ import { ESTree, MinifyOptions, MinifyResult, ParseResult, ParserOptions, TransformOptions as rolldown_utils_TransformOptions, TransformResult as rolldown_utils_TransformResult, Visitor, VisitorObject, minify, minifySync, parse, parseSync } from "rolldown/utils";
11
+ import { DevToolsConfig, ResolvedDevToolsConfig } from "#types/internal/devtoolsOptions";
12
+ import { DepsOptimizerEsbuildOptions, EsbuildTarget, EsbuildTransformOptions, EsbuildTransformOptions as esbuildOptions_EsbuildTransformOptions, EsbuildTransformResult } from "#types/internal/esbuildOptions";
13
+ import { ChunkMetadata, CustomPluginOptionsVite } from "#types/metadata";
14
+ import * as http from "node:http";
15
+ import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders, ServerResponse } from "node:http";
16
+ import { Http2SecureServer } from "node:http2";
17
+ import { EventEmitter } from "node:events";
18
+ import * as fs from "node:fs";
19
+ import { Server as HttpsServer, ServerOptions as HttpsServerOptions } from "node:https";
20
+ import * as net from "node:net";
21
+ import { Duplex, DuplexOptions, Stream } from "node:stream";
22
+ import { FetchFunction, FetchFunctionOptions, FetchResult, FetchResult as moduleRunner_FetchResult, ModuleEvaluator, ModuleRunner, ModuleRunnerHmr, ModuleRunnerOptions } from "vite/module-runner";
23
+ import { SecureContextOptions } from "node:tls";
24
+ import { URL as url_URL } from "node:url";
25
+ import { ZlibOptions } from "node:zlib";
26
+ import { DevWatchOptions } from "rolldown/experimental";
27
+ import { Terser, TerserMinifyOptions } from "#types/internal/terserOptions";
28
+ import * as PostCSS from "postcss";
29
+ import { ProcessOptions, Processor, Transformer } from "postcss";
30
+ import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "#types/internal/cssPreprocessorOptions";
31
+ import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "#types/internal/lightningcssOptions";
32
+ import { withFilter } from "rolldown/filter";
33
+ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap, KnownQueryTypeMap } from "#types/importGlob";
34
+ //#endregion
35
+ //#region src/types/alias.d.ts
36
+ interface Alias {
37
+ find: string | RegExp;
38
+ replacement: string;
39
+ /**
40
+ * Instructs the plugin to use an alternative resolving algorithm,
41
+ * rather than the Rollup's resolver.
42
+ * @default null
43
+ * @deprecated Use a custom plugin with resolveId hook and `enforce: 'pre'` instead
44
+ */
45
+ customResolver?: ResolverFunction | ResolverObject | null;
46
+ }
47
+ type MapToFunction<T> = T extends Function ? T : never;
48
+ type ResolverFunction = MapToFunction<FunctionPluginHooks['resolveId']>;
49
+ interface ResolverObject {
50
+ buildStart?: FunctionPluginHooks['buildStart'];
51
+ resolveId: ResolverFunction;
52
+ }
53
+ /**
54
+ * Specifies an `Object`, or an `Array` of `Object`,
55
+ * which defines aliases used to replace values in `import` or `require` statements.
56
+ * With either format, the order of the entries is important,
57
+ * in that the first defined rules are applied first.
58
+ *
59
+ * This is passed to \@rollup/plugin-alias as the "entries" field
60
+ * https://github.com/rollup/plugins/tree/master/packages/alias#entries
61
+ */
62
+ type AliasOptions = readonly Alias[] | {
63
+ [find: string]: string;
64
+ };
65
+ //#endregion
66
+ //#region src/node/assetSource.d.ts
67
+ /**
68
+ * Defines which attributes of an HTML element should be treated as asset sources.
69
+ * Used in `html.additionalAssetSources` configuration.
70
+ */
71
+ interface HtmlAssetSource {
72
+ /**
73
+ * Attributes that contain a single asset URL.
74
+ * @example ['src', 'data-src-dark']
75
+ */
76
+ srcAttributes?: string[];
77
+ /**
78
+ * Attributes that contain srcset-format URLs.
79
+ * @example ['srcset', 'imagesrcset']
80
+ */
81
+ srcsetAttributes?: string[];
82
+ /**
83
+ * Called before handling an attribute to determine if it should be processed.
84
+ */
85
+ filter?: (data: HtmlAssetSourceFilterData) => boolean;
86
+ }
87
+ interface HtmlAssetSourceFilterData {
88
+ key: string;
89
+ value: string;
90
+ attributes: Record<string, string>;
91
+ }
92
+ //#endregion
93
+ //#region src/types/commonjs.d.ts
94
+
95
+ interface RollupCommonJSOptions {
96
+ /**
97
+ * A minimatch pattern, or array of patterns, which specifies the files in
98
+ * the build the plugin should operate on. By default, all files with
99
+ * extension `".cjs"` or those in `extensions` are included, but you can
100
+ * narrow this list by only including specific files. These files will be
101
+ * analyzed and transpiled if either the analysis does not find ES module
102
+ * specific statements or `transformMixedEsModules` is `true`.
103
+ * @default undefined
104
+ */
105
+ include?: string | RegExp | readonly (string | RegExp)[];
106
+ /**
107
+ * A minimatch pattern, or array of patterns, which specifies the files in
108
+ * the build the plugin should _ignore_. By default, all files with
109
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
110
+ * can exclude additional files. See also the `include` option.
111
+ * @default undefined
112
+ */
113
+ exclude?: string | RegExp | readonly (string | RegExp)[];
114
+ /**
115
+ * For extensionless imports, search for extensions other than .js in the
116
+ * order specified. Note that you need to make sure that non-JavaScript files
117
+ * are transpiled by another plugin first.
118
+ * @default [ '.js' ]
119
+ */
120
+ extensions?: ReadonlyArray<string>;
121
+ /**
122
+ * If true then uses of `global` won't be dealt with by this plugin
123
+ * @default false
124
+ */
125
+ ignoreGlobal?: boolean;
126
+ /**
127
+ * If false, skips source map generation for CommonJS modules. This will
128
+ * improve performance.
129
+ * @default true
130
+ */
131
+ sourceMap?: boolean;
132
+ /**
133
+ * Some `require` calls cannot be resolved statically to be translated to
134
+ * imports.
135
+ * When this option is set to `false`, the generated code will either
136
+ * directly throw an error when such a call is encountered or, when
137
+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
138
+ * configured dynamic require target.
139
+ * Setting this option to `true` will instead leave the `require` call in the
140
+ * code or use it as a fallback for `dynamicRequireTargets`.
141
+ * @default false
142
+ */
143
+ ignoreDynamicRequires?: boolean;
144
+ /**
145
+ * Instructs the plugin whether to enable mixed module transformations. This
146
+ * is useful in scenarios with modules that contain a mix of ES `import`
147
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
148
+ * calls should be transformed to imports in mixed modules, or `false` if the
149
+ * `require` expressions should survive the transformation. The latter can be
150
+ * important if the code contains environment detection, or you are coding
151
+ * for an environment with special treatment for `require` calls such as
152
+ * ElectronJS. See also the `ignore` option.
153
+ * @default false
154
+ */
155
+ transformMixedEsModules?: boolean;
156
+ /**
157
+ * By default, this plugin will try to hoist `require` statements as imports
158
+ * to the top of each file. While this works well for many code bases and
159
+ * allows for very efficient ESM output, it does not perfectly capture
160
+ * CommonJS semantics as the order of side effects like log statements may
161
+ * change. But it is especially problematic when there are circular `require`
162
+ * calls between CommonJS modules as those often rely on the lazy execution of
163
+ * nested `require` calls.
164
+ *
165
+ * Setting this option to `true` will wrap all CommonJS files in functions
166
+ * which are executed when they are required for the first time, preserving
167
+ * NodeJS semantics. Note that this can have an impact on the size and
168
+ * performance of the generated code.
169
+ *
170
+ * The default value of `"auto"` will only wrap CommonJS files when they are
171
+ * part of a CommonJS dependency cycle, e.g. an index file that is required by
172
+ * many of its dependencies. All other CommonJS files are hoisted. This is the
173
+ * recommended setting for most code bases.
174
+ *
175
+ * `false` will entirely prevent wrapping and hoist all files. This may still
176
+ * work depending on the nature of cyclic dependencies but will often cause
177
+ * problems.
178
+ *
179
+ * You can also provide a minimatch pattern, or array of patterns, to only
180
+ * specify a subset of files which should be wrapped in functions for proper
181
+ * `require` semantics.
182
+ *
183
+ * `"debug"` works like `"auto"` but after bundling, it will display a warning
184
+ * containing a list of ids that have been wrapped which can be used as
185
+ * minimatch pattern for fine-tuning.
186
+ * @default "auto"
187
+ */
188
+ strictRequires?: boolean | string | RegExp | readonly (string | RegExp)[];
189
+ /**
190
+ * Sometimes you have to leave require statements unconverted. Pass an array
191
+ * containing the IDs or a `id => boolean` function.
192
+ * @default []
193
+ */
194
+ ignore?: ReadonlyArray<string> | ((id: string) => boolean);
195
+ /**
196
+ * In most cases, where `require` calls are inside a `try-catch` clause,
197
+ * they should be left unconverted as it requires an optional dependency
198
+ * that may or may not be installed beside the rolled up package.
199
+ * Due to the conversion of `require` to a static `import` - the call is
200
+ * hoisted to the top of the file, outside the `try-catch` clause.
201
+ *
202
+ * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
203
+ * - `false`: All `require` calls inside a `try` will be converted as if the
204
+ * `try-catch` clause is not there.
205
+ * - `remove`: Remove all `require` calls from inside any `try` block.
206
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
207
+ * - `((id: string) => boolean|'remove')`: Pass a function that controls
208
+ * individual IDs.
209
+ *
210
+ * @default true
211
+ */
212
+ ignoreTryCatch?: boolean | 'remove' | ReadonlyArray<string> | ((id: string) => boolean | 'remove');
213
+ /**
214
+ * Controls how to render imports from external dependencies. By default,
215
+ * this plugin assumes that all external dependencies are CommonJS. This
216
+ * means they are rendered as default imports to be compatible with e.g.
217
+ * NodeJS where ES modules can only import a default export from a CommonJS
218
+ * dependency.
219
+ *
220
+ * If you set `esmExternals` to `true`, this plugin assumes that all
221
+ * external dependencies are ES modules and respect the
222
+ * `requireReturnsDefault` option. If that option is not set, they will be
223
+ * rendered as namespace imports.
224
+ *
225
+ * You can also supply an array of ids to be treated as ES modules, or a
226
+ * function that will be passed each external id to determine whether it is
227
+ * an ES module.
228
+ * @default false
229
+ */
230
+ esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
231
+ /**
232
+ * Controls what is returned when requiring an ES module from a CommonJS file.
233
+ * When using the `esmExternals` option, this will also apply to external
234
+ * modules. By default, this plugin will render those imports as namespace
235
+ * imports i.e.
236
+ *
237
+ * ```js
238
+ * // input
239
+ * const foo = require('foo');
240
+ *
241
+ * // output
242
+ * import * as foo from 'foo';
243
+ * ```
244
+ *
245
+ * However, there are some situations where this may not be desired.
246
+ * For these situations, you can change Rollup's behaviour either globally or
247
+ * per module. To change it globally, set the `requireReturnsDefault` option
248
+ * to one of the following values:
249
+ *
250
+ * - `false`: This is the default, requiring an ES module returns its
251
+ * namespace. This is the only option that will also add a marker
252
+ * `__esModule: true` to the namespace to support interop patterns in
253
+ * CommonJS modules that are transpiled ES modules.
254
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
255
+ * namespace, but the plugin does not add the `__esModule` marker and thus
256
+ * creates more efficient code. For external dependencies when using
257
+ * `esmExternals: true`, no additional interop code is generated.
258
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
259
+ * Rollup: If a module has a default export and no named exports, requiring
260
+ * that module returns the default export. In all other cases, the namespace
261
+ * is returned. For external dependencies when using `esmExternals: true`, a
262
+ * corresponding interop helper is added.
263
+ * - `"preferred"`: If a module has a default export, requiring that module
264
+ * always returns the default export, no matter whether additional named
265
+ * exports exist. This is similar to how previous versions of this plugin
266
+ * worked. Again for external dependencies when using `esmExternals: true`,
267
+ * an interop helper is added.
268
+ * - `true`: This will always try to return the default export on require
269
+ * without checking if it actually exists. This can throw at build time if
270
+ * there is no default export. This is how external dependencies are handled
271
+ * when `esmExternals` is not used. The advantage over the other options is
272
+ * that, like `false`, this does not add an interop helper for external
273
+ * dependencies, keeping the code lean.
274
+ *
275
+ * To change this for individual modules, you can supply a function for
276
+ * `requireReturnsDefault` instead. This function will then be called once for
277
+ * each required ES module or external dependency with the corresponding id
278
+ * and allows you to return different values for different modules.
279
+ * @default false
280
+ */
281
+ requireReturnsDefault?: boolean | 'auto' | 'preferred' | 'namespace' | ((id: string) => boolean | 'auto' | 'preferred' | 'namespace');
282
+ /**
283
+ * @default "auto"
284
+ */
285
+ defaultIsModuleExports?: boolean | 'auto' | ((id: string) => boolean | 'auto');
286
+ /**
287
+ * Some modules contain dynamic `require` calls, or require modules that
288
+ * contain circular dependencies, which are not handled well by static
289
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
290
+ * CommonJS (NodeJS-like) environment for them with support for dynamic
291
+ * dependencies. It also enables `strictRequires` for those modules.
292
+ *
293
+ * Note: In extreme cases, this feature may result in some paths being
294
+ * rendered as absolute in the final bundle. The plugin tries to avoid
295
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
296
+ * with paths that are far away from your project's folder, that may require
297
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -\> `"/"`.
298
+ */
299
+ dynamicRequireTargets?: string | ReadonlyArray<string>;
300
+ /**
301
+ * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
302
+ * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
303
+ * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
304
+ * home directory name. By default, it uses the current working directory.
305
+ */
306
+ dynamicRequireRoot?: string;
307
+ }
308
+ //#endregion
309
+ //#region src/types/dynamicImportVars.d.ts
310
+ interface RollupDynamicImportVarsOptions {
311
+ /**
312
+ * Files to include in this plugin (default all).
313
+ * @default []
314
+ */
315
+ include?: string | RegExp | (string | RegExp)[];
316
+ /**
317
+ * Files to exclude in this plugin (default none).
318
+ * @default []
319
+ */
320
+ exclude?: string | RegExp | (string | RegExp)[];
321
+ /**
322
+ * @deprecated This option is no-op and will be removed in future versions.
323
+ */
324
+ warnOnError?: boolean;
325
+ }
326
+ //#endregion
327
+ //#region src/types/anymatch.d.ts
328
+ type AnymatchFn = (testString: string) => boolean;
329
+ type AnymatchPattern = string | RegExp | AnymatchFn;
330
+ type AnymatchMatcher = AnymatchPattern | AnymatchPattern[];
331
+ //#endregion
332
+ //#region src/types/chokidar.d.ts
333
+ declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
334
+ options: WatchOptions;
335
+ /**
336
+ * Constructs a new FSWatcher instance with optional WatchOptions parameter.
337
+ */
338
+ constructor(options?: WatchOptions);
339
+ /**
340
+ * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
341
+ * Calling watcher.ref() multiple times will have no effect.
342
+ */
343
+ ref(): this;
344
+ /**
345
+ * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
346
+ * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
347
+ * Calling watcher.unref() multiple times will have no effect.
348
+ */
349
+ unref(): this;
350
+ /**
351
+ * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
352
+ * string.
353
+ */
354
+ add(paths: string | ReadonlyArray<string>): this;
355
+ /**
356
+ * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
357
+ * string.
358
+ */
359
+ unwatch(paths: string | ReadonlyArray<string>): this;
360
+ /**
361
+ * Returns an object representing all the paths on the file system being watched by this
362
+ * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
363
+ * the `cwd` option was used), and the values are arrays of the names of the items contained in
364
+ * each directory.
365
+ */
366
+ getWatched(): {
367
+ [directory: string]: string[];
368
+ };
369
+ /**
370
+ * Removes all listeners from watched files.
371
+ */
372
+ close(): Promise<void>;
373
+ on(event: 'add' | 'addDir' | 'change', listener: (path: string, stats?: fs.Stats) => void): this;
374
+ on(event: 'all', listener: (eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void): this;
375
+ /**
376
+ * Error occurred
377
+ */
378
+ on(event: 'error', listener: (error: Error) => void): this;
379
+ /**
380
+ * Exposes the native Node `fs.FSWatcher events`
381
+ */
382
+ on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
383
+ /**
384
+ * Fires when the initial scan is complete
385
+ */
386
+ on(event: 'ready', listener: () => void): this;
387
+ on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this;
388
+ on(event: string, listener: (...args: any[]) => void): this;
389
+ }
390
+ interface WatchOptions {
391
+ /**
392
+ * Indicates whether the process should continue to run as long as files are being watched. If
393
+ * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
394
+ * even if the process continues to run.
395
+ */
396
+ persistent?: boolean;
397
+ /**
398
+ * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
399
+ * be ignored. The whole relative or absolute path is tested, not just filename. If a function
400
+ * with two arguments is provided, it gets called twice per path - once with a single argument
401
+ * (the path), second time with two arguments (the path and the
402
+ * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
403
+ */
404
+ ignored?: AnymatchMatcher;
405
+ /**
406
+ * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
407
+ * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
408
+ */
409
+ ignoreInitial?: boolean;
410
+ /**
411
+ * When `false`, only the symlinks themselves will be watched for changes instead of following
412
+ * the link references and bubbling events through the link's path.
413
+ */
414
+ followSymlinks?: boolean;
415
+ /**
416
+ * The base directory from which watch `paths` are to be derived. Paths emitted with events will
417
+ * be relative to this.
418
+ */
419
+ cwd?: string;
420
+ /**
421
+ * If set to true then the strings passed to .watch() and .add() are treated as literal path
422
+ * names, even if they look like globs.
423
+ *
424
+ * @default false
425
+ */
426
+ disableGlobbing?: boolean;
427
+ /**
428
+ * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
429
+ * utilization, consider setting this to `false`. It is typically necessary to **set this to
430
+ * `true` to successfully watch files over a network**, and it may be necessary to successfully
431
+ * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
432
+ * the `useFsEvents` default.
433
+ */
434
+ usePolling?: boolean;
435
+ /**
436
+ * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
437
+ * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
438
+ * OS X, `usePolling: true` becomes the default.
439
+ */
440
+ useFsEvents?: boolean;
441
+ /**
442
+ * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
443
+ * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
444
+ * provided even in cases where it wasn't already available from the underlying watch events.
445
+ */
446
+ alwaysStat?: boolean;
447
+ /**
448
+ * If set, limits how many levels of subdirectories will be traversed.
449
+ */
450
+ depth?: number;
451
+ /**
452
+ * Interval of file system polling.
453
+ */
454
+ interval?: number;
455
+ /**
456
+ * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
457
+ * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
458
+ */
459
+ binaryInterval?: number;
460
+ /**
461
+ * Indicates whether to watch files that don't have read permissions if possible. If watching
462
+ * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
463
+ * silently.
464
+ */
465
+ ignorePermissionErrors?: boolean;
466
+ /**
467
+ * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
468
+ * that occur when using editors that use "atomic writes" instead of writing directly to the
469
+ * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
470
+ * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
471
+ * you can override it by setting `atomic` to a custom value, in milliseconds.
472
+ */
473
+ atomic?: boolean | number;
474
+ /**
475
+ * can be set to an object in order to adjust timing params:
476
+ */
477
+ awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
478
+ }
479
+ interface AwaitWriteFinishOptions {
480
+ /**
481
+ * Amount of time in milliseconds for a file size to remain constant before emitting its event.
482
+ */
483
+ stabilityThreshold?: number;
484
+ /**
485
+ * File size polling interval.
486
+ */
487
+ pollInterval?: number;
488
+ }
489
+ //#endregion
490
+ //#region src/types/connect.d.ts
491
+ declare namespace Connect {
492
+ export type ServerHandle = HandleFunction | http.Server;
493
+ export class IncomingMessage extends http.IncomingMessage {
494
+ originalUrl?: http.IncomingMessage['url'] | undefined;
495
+ }
496
+ export type NextFunction = (err?: any) => void;
497
+ export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
498
+ export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
499
+ export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
500
+ export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
501
+ export interface ServerStackItem {
502
+ route: string;
503
+ handle: ServerHandle;
504
+ }
505
+ export interface Server extends NodeJS.EventEmitter {
506
+ (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
507
+ route: string;
508
+ stack: ServerStackItem[];
509
+ /**
510
+ * Utilize the given middleware `handle` to the given `route`,
511
+ * defaulting to _/_. This "route" is the mount-point for the
512
+ * middleware, when given a value other than _/_ the middleware
513
+ * is only effective when that segment is present in the request's
514
+ * pathname.
515
+ *
516
+ * For example if we were to mount a function at _/admin_, it would
517
+ * be invoked on _/admin_, and _/admin/settings_, however it would
518
+ * not be invoked for _/_, or _/posts_.
519
+ */
520
+ use(fn: NextHandleFunction): Server;
521
+ use(fn: HandleFunction): Server;
522
+ use(route: string, fn: NextHandleFunction): Server;
523
+ use(route: string, fn: HandleFunction): Server;
524
+ /**
525
+ * Handle server requests, punting them down
526
+ * the middleware stack.
527
+ */
528
+ handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
529
+ /**
530
+ * Listen for connections.
531
+ *
532
+ * This method takes the same arguments
533
+ * as node's `http.Server#listen()`.
534
+ *
535
+ * HTTP and HTTPS:
536
+ *
537
+ * If you run your application both as HTTP
538
+ * and HTTPS you may wrap them individually,
539
+ * since your Connect "server" is really just
540
+ * a JavaScript `Function`.
541
+ *
542
+ * var connect = require('connect')
543
+ * , http = require('http')
544
+ * , https = require('https');
545
+ *
546
+ * var app = connect();
547
+ *
548
+ * http.createServer(app).listen(80);
549
+ * https.createServer(options, app).listen(443);
550
+ */
551
+ listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
552
+ listen(port: number, hostname?: string, callback?: Function): http.Server;
553
+ listen(path: string, callback?: Function): http.Server;
554
+ listen(handle: any, listeningListener?: Function): http.Server;
555
+ }
556
+ }
557
+ //#endregion
558
+ //#region src/shared/forwardConsole.d.ts
559
+ type ForwardConsoleLogLevel = "error" | "warn" | "info" | "log" | "debug" | (string & {});
560
+ interface ForwardConsoleOptions {
561
+ unhandledErrors?: boolean;
562
+ logLevels?: ForwardConsoleLogLevel[];
563
+ }
564
+ interface ResolvedForwardConsoleOptions {
565
+ enabled: boolean;
566
+ unhandledErrors: boolean;
567
+ logLevels: ForwardConsoleLogLevel[];
568
+ }
569
+ //#endregion
570
+ //#region ../../node_modules/.pnpm/http-proxy-3@1.23.3_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/index.d.ts
571
+ interface ProxyTargetDetailed {
572
+ host: string;
573
+ port: number;
574
+ protocol?: string;
575
+ hostname?: string;
576
+ socketPath?: string;
577
+ key?: string;
578
+ passphrase?: string;
579
+ pfx?: Buffer | string;
580
+ cert?: string;
581
+ ca?: string;
582
+ ciphers?: string;
583
+ secureProtocol?: string;
584
+ }
585
+ type ProxyType = "ws" | "web";
586
+ type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
587
+ type ProxyTargetUrl = URL | string | {
588
+ port: number;
589
+ host: string;
590
+ protocol?: string;
591
+ };
592
+ type NormalizeProxyTarget<T extends ProxyTargetUrl> = Exclude<T, string> | URL;
593
+ interface ServerOptions$3 {
594
+ /** URL string to be parsed with the url module. */
595
+ target?: ProxyTarget;
596
+ /** URL string to be parsed with the url module or a URL object. */
597
+ forward?: ProxyTargetUrl;
598
+ /** Object to be passed to http(s).request. */
599
+ agent?: any;
600
+ /** Object to be passed to https.createServer(). */
601
+ ssl?: any;
602
+ /** If you want to proxy websockets. */
603
+ ws?: boolean;
604
+ /** Adds x- forward headers. */
605
+ xfwd?: boolean;
606
+ /** Verify SSL certificate. */
607
+ secure?: boolean;
608
+ /** Explicitly specify if we are proxying to another proxy. */
609
+ toProxy?: boolean;
610
+ /** Specify whether you want to prepend the target's path to the proxy path. */
611
+ prependPath?: boolean;
612
+ /** Specify whether you want to ignore the proxy path of the incoming request. */
613
+ ignorePath?: boolean;
614
+ /** Local interface string to bind for outgoing connections. */
615
+ localAddress?: string;
616
+ /** Changes the origin of the host header to the target URL. */
617
+ changeOrigin?: boolean;
618
+ /** specify whether you want to keep letter case of response header key */
619
+ preserveHeaderKeyCase?: boolean;
620
+ /** Basic authentication i.e. 'user:password' to compute an Authorization header. */
621
+ auth?: string;
622
+ /** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
623
+ hostRewrite?: string;
624
+ /** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
625
+ autoRewrite?: boolean;
626
+ /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
627
+ protocolRewrite?: string;
628
+ /** rewrites domain of set-cookie headers. */
629
+ cookieDomainRewrite?: false | string | {
630
+ [oldDomain: string]: string;
631
+ };
632
+ /** rewrites path of set-cookie headers. Default: false */
633
+ cookiePathRewrite?: false | string | {
634
+ [oldPath: string]: string;
635
+ };
636
+ /** object with extra headers to be added to target requests. */
637
+ headers?: {
638
+ [header: string]: string | string[] | undefined;
639
+ };
640
+ /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
641
+ proxyTimeout?: number;
642
+ /** Timeout (in milliseconds) for incoming requests */
643
+ timeout?: number;
644
+ /** Specify whether you want to follow redirects. Default: false */
645
+ followRedirects?: boolean;
646
+ /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
647
+ selfHandleResponse?: boolean;
648
+ /** Buffer */
649
+ buffer?: Stream;
650
+ /** Explicitly set the method type of the ProxyReq */
651
+ method?: string;
652
+ /**
653
+ * Optionally override the trusted CA certificates.
654
+ * This is passed to https.request.
655
+ */
656
+ ca?: string;
657
+ /** Optional fetch implementation to use instead of global fetch, use this to activate fetch-based proxying,
658
+ * for example to proxy HTTP/2 requests
659
+ */
660
+ fetch?: typeof fetch;
661
+ /** Optional configuration object for fetch-based proxy requests.
662
+ * Use this to customize fetch request and response handling.
663
+ * For custom fetch implementations, use the `fetch` property.*/
664
+ fetchOptions?: FetchOptions;
665
+ }
666
+ interface FetchOptions {
667
+ /** Fetch request options */
668
+ requestOptions?: RequestInit;
669
+ /** Called before making the fetch request */
670
+ onBeforeRequest?: (requestOptions: RequestInit, req: http.IncomingMessage, res: http.ServerResponse, options: NormalizedServerOptions) => void | Promise<void>;
671
+ /** Called after receiving the fetch response */
672
+ onAfterResponse?: (response: Response, req: http.IncomingMessage, res: http.ServerResponse, options: NormalizedServerOptions) => void | Promise<void>;
673
+ }
674
+ interface NormalizedServerOptions extends ServerOptions$3 {
675
+ target?: NormalizeProxyTarget<ProxyTarget>;
676
+ forward?: NormalizeProxyTarget<ProxyTargetUrl>;
677
+ }
678
+ type ErrorCallback<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = (err: TError, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse> | net.Socket, target?: ProxyTargetUrl) => void;
679
+ type ProxyServerEventMap<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
680
+ error: Parameters<ErrorCallback<TIncomingMessage, TServerResponse, TError>>;
681
+ start: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, target: ProxyTargetUrl];
682
+ open: [socket: net.Socket];
683
+ proxyReq: [proxyReq: http.ClientRequest, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, options: ServerOptions$3, socket: net.Socket];
684
+ proxyRes: [proxyRes: InstanceType<TIncomingMessage>, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>];
685
+ proxyReqWs: [proxyReq: http.ClientRequest, req: InstanceType<TIncomingMessage>, socket: net.Socket, options: ServerOptions$3, head: any];
686
+ econnreset: [err: Error, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, target: ProxyTargetUrl];
687
+ end: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, proxyRes: InstanceType<TIncomingMessage>];
688
+ close: [proxyRes: InstanceType<TIncomingMessage>, proxySocket: net.Socket, proxyHead: any];
689
+ };
690
+ type ProxyMethodArgs<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
691
+ ws: [req: InstanceType<TIncomingMessage>, socket: any, head: any, ...args: [options?: ServerOptions$3, callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>] | [callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>]];
692
+ web: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, ...args: [options: ServerOptions$3, callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>] | [callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>]];
693
+ };
694
+ type PassFunctions<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
695
+ ws: (req: InstanceType<TIncomingMessage>, socket: net.Socket, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer<TIncomingMessage, TServerResponse, TError>, cb?: ErrorCallback<TIncomingMessage, TServerResponse, TError>) => unknown;
696
+ web: (req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer<TIncomingMessage, TServerResponse, TError>, cb?: ErrorCallback<TIncomingMessage, TServerResponse, TError>) => unknown;
697
+ };
698
+ 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>> {
699
+ /**
700
+ * Used for proxying WS(S) requests
701
+ * @param req - Client request.
702
+ * @param socket - Client socket.
703
+ * @param head - Client head.
704
+ * @param options - Additional options.
705
+ */
706
+ readonly ws: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["ws"]) => void;
707
+ /**
708
+ * Used for proxying regular HTTP(S) requests
709
+ * @param req - Client request.
710
+ * @param res - Client response.
711
+ * @param options - Additional options.
712
+ */
713
+ readonly web: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["web"]) => void;
714
+ private options;
715
+ private webPasses;
716
+ private wsPasses;
717
+ private _server?;
718
+ /**
719
+ * Creates the proxy server with specified options.
720
+ * @param options - Config object passed to the proxy
721
+ */
722
+ constructor(options?: ServerOptions$3);
723
+ /**
724
+ * Creates the proxy server with specified options.
725
+ * @param options Config object passed to the proxy
726
+ * @returns Proxy object with handlers for `ws` and `web` requests
727
+ */
728
+ static createProxyServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
729
+ /**
730
+ * Creates the proxy server with specified options.
731
+ * @param options Config object passed to the proxy
732
+ * @returns Proxy object with handlers for `ws` and `web` requests
733
+ */
734
+ static createServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
735
+ /**
736
+ * Creates the proxy server with specified options.
737
+ * @param options Config object passed to the proxy
738
+ * @returns Proxy object with handlers for `ws` and `web` requests
739
+ */
740
+ static createProxy<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
741
+ createRightProxy: <PT extends ProxyType>(type: PT) => Function;
742
+ onError: (err: TError) => void;
743
+ /**
744
+ * A function that wraps the object in a webserver, for your convenience
745
+ * @param port - Port to listen on
746
+ * @param hostname - The hostname to listen on
747
+ */
748
+ listen: (port: number, hostname?: string) => this;
749
+ address: () => string | net.AddressInfo | null | undefined;
750
+ /**
751
+ * A function that closes the inner webserver and stops listening on given port
752
+ */
753
+ close: (cb?: Function) => void;
754
+ before: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
755
+ after: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
756
+ }
757
+ //#endregion
758
+ //#region ../../node_modules/.pnpm/http-proxy-3@1.23.3_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.d.ts
759
+ declare function numOpenSockets(): number;
760
+ declare namespace index_d_exports {
761
+ export { ErrorCallback, ProxyServer, ProxyTarget, ProxyTargetUrl, ServerOptions$3 as ServerOptions, createProxyServer as createProxy, createProxyServer, createProxyServer as createServer, ProxyServer as default, numOpenSockets };
762
+ }
763
+ /**
764
+ * Creates the proxy server.
765
+ *
766
+ * Examples:
767
+ *
768
+ * httpProxy.createProxyServer({ .. }, 8000)
769
+ * // => '{ web: [Function], ws: [Function] ... }'
770
+ *
771
+ * @param {Object} Options Config object passed to the proxy
772
+ *
773
+ * @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests
774
+ *
775
+ * @api public
776
+ */
777
+ declare function createProxyServer<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
778
+ //#endregion
779
+ //#region src/node/server/middlewares/proxy.d.ts
780
+ interface ProxyOptions extends ServerOptions$3 {
781
+ /**
782
+ * rewrite path
783
+ */
784
+ rewrite?: (path: string) => string;
785
+ /**
786
+ * configure the proxy server (e.g. listen to events)
787
+ */
788
+ configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
789
+ /**
790
+ * webpack-dev-server style bypass function
791
+ */
792
+ bypass?: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
793
+ /**
794
+ * rewrite the Origin header of a WebSocket request to match the target
795
+ *
796
+ * **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
797
+ */
798
+ rewriteWsOrigin?: boolean | undefined;
799
+ }
800
+ //#endregion
801
+ //#region src/node/http.d.ts
802
+ interface CommonServerOptions {
803
+ /**
804
+ * Specify server port. Note if the port is already being used, Vite will
805
+ * automatically try the next available port so this may not be the actual
806
+ * port the server ends up listening on.
807
+ */
808
+ port?: number;
809
+ /**
810
+ * If enabled, vite will exit if specified port is already in use
811
+ */
812
+ strictPort?: boolean;
813
+ /**
814
+ * Specify which IP addresses the server should listen on.
815
+ * Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
816
+ */
817
+ host?: string | boolean;
818
+ /**
819
+ * The hostnames that Vite is allowed to respond to.
820
+ * `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
821
+ * When using HTTPS, this check is skipped.
822
+ *
823
+ * If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
824
+ * For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
825
+ *
826
+ * If set to `true`, the server is allowed to respond to requests for any hosts.
827
+ * This is not recommended as it will be vulnerable to DNS rebinding attacks.
828
+ */
829
+ allowedHosts?: string[] | true;
830
+ /**
831
+ * Enable TLS + HTTP/2.
832
+ * Note: this downgrades to TLS only when the proxy option is also used.
833
+ */
834
+ https?: HttpsServerOptions;
835
+ /**
836
+ * Open browser window on startup
837
+ */
838
+ open?: boolean | string;
839
+ /**
840
+ * Configure custom proxy rules for the dev server. Expects an object
841
+ * of `{ key: options }` pairs.
842
+ * Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
843
+ * Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
844
+ *
845
+ * Example `vite.config.js`:
846
+ * ``` js
847
+ * module.exports = {
848
+ * proxy: {
849
+ * // string shorthand: /foo -> http://localhost:4567/foo
850
+ * '/foo': 'http://localhost:4567',
851
+ * // with options
852
+ * '/api': {
853
+ * target: 'http://jsonplaceholder.typicode.com',
854
+ * changeOrigin: true,
855
+ * rewrite: path => path.replace(/^\/api/, '')
856
+ * }
857
+ * }
858
+ * }
859
+ * ```
860
+ */
861
+ proxy?: Record<string, string | ProxyOptions>;
862
+ /**
863
+ * Configure CORS for the dev server.
864
+ * Uses https://github.com/expressjs/cors.
865
+ *
866
+ * When enabling this option, **we recommend setting a specific value
867
+ * rather than `true`** to avoid exposing the source code to untrusted origins.
868
+ *
869
+ * Set to `true` to allow all methods from any origin, or configure separately
870
+ * using an object.
871
+ *
872
+ * @default { origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/ }
873
+ */
874
+ cors?: CorsOptions | boolean;
875
+ /**
876
+ * Specify server response headers.
877
+ */
878
+ headers?: OutgoingHttpHeaders;
879
+ }
880
+ /**
881
+ * https://github.com/expressjs/cors#configuration-options
882
+ */
883
+ interface CorsOptions {
884
+ /**
885
+ * Configures the Access-Control-Allow-Origin CORS header.
886
+ *
887
+ * **We recommend setting a specific value rather than
888
+ * `true`** to avoid exposing the source code to untrusted origins.
889
+ */
890
+ origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
891
+ methods?: string | string[];
892
+ allowedHeaders?: string | string[];
893
+ exposedHeaders?: string | string[];
894
+ credentials?: boolean;
895
+ maxAge?: number;
896
+ preflightContinue?: boolean;
897
+ optionsSuccessStatus?: number;
898
+ }
899
+ type CorsOrigin = boolean | string | RegExp | (string | RegExp)[];
900
+ //#endregion
901
+ //#region src/node/optimizer/index.d.ts
902
+ type ExportsData = {
903
+ hasModuleSyntax: boolean;
904
+ exports: readonly string[];
905
+ jsxLoader?: boolean;
906
+ };
907
+ interface DepsOptimizer {
908
+ init: () => Promise<void>;
909
+ metadata: DepOptimizationMetadata;
910
+ scanProcessing?: Promise<void>;
911
+ registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
912
+ run: () => void;
913
+ isOptimizedDepFile: (id: string) => boolean;
914
+ isOptimizedDepUrl: (url: string) => boolean;
915
+ getOptimizedDepId: (depInfo: OptimizedDepInfo) => string;
916
+ close: () => Promise<void>;
917
+ options: DepOptimizationOptions;
918
+ }
919
+ interface DepOptimizationConfig {
920
+ /**
921
+ * Force optimize listed dependencies (must be resolvable import paths,
922
+ * cannot be globs).
923
+ */
924
+ include?: string[];
925
+ /**
926
+ * Do not optimize these dependencies (must be resolvable import paths,
927
+ * cannot be globs).
928
+ */
929
+ exclude?: string[];
930
+ /**
931
+ * Forces ESM interop when importing these dependencies. Some legacy
932
+ * packages advertise themselves as ESM but use `require` internally
933
+ * @experimental
934
+ */
935
+ needsInterop?: string[];
936
+ /**
937
+ * Options to pass to esbuild during the dep scanning and optimization
938
+ *
939
+ * Certain options are omitted since changing them would not be compatible
940
+ * with Vite's dep optimization.
941
+ *
942
+ * - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
943
+ * - `plugins` are merged with Vite's dep plugin
944
+ *
945
+ * https://esbuild.github.io/api
946
+ *
947
+ * @deprecated Use `rolldownOptions` instead.
948
+ */
949
+ esbuildOptions?: DepsOptimizerEsbuildOptions;
950
+ /**
951
+ * @deprecated Use `rolldownOptions` instead.
952
+ */
953
+ rollupOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
954
+ output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
955
+ };
956
+ /**
957
+ * Options to pass to rolldown during the dep scanning and optimization
958
+ *
959
+ * Certain options are omitted since changing them would not be compatible
960
+ * with Vite's dep optimization.
961
+ *
962
+ * - `plugins` are merged with Vite's dep plugin
963
+ */
964
+ rolldownOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
965
+ output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
966
+ };
967
+ /**
968
+ * List of file extensions that can be optimized. A corresponding esbuild
969
+ * plugin must exist to handle the specific extension.
970
+ *
971
+ * By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
972
+ * allows specifying additional extensions.
973
+ *
974
+ * @experimental
975
+ */
976
+ extensions?: string[];
977
+ /**
978
+ * Deps optimization during build was removed in Vite 5.1. This option is
979
+ * now redundant and will be removed in a future version. Switch to using
980
+ * `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
981
+ * true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
982
+ * @default 'build'
983
+ * @deprecated
984
+ * @experimental
985
+ */
986
+ disabled?: boolean | "build" | "dev";
987
+ /**
988
+ * Automatic dependency discovery. When `noDiscovery` is true, only dependencies
989
+ * listed in `include` will be optimized. The scanner isn't run for cold start
990
+ * in this case. CJS-only dependencies must be present in `include` during dev.
991
+ * @default false
992
+ */
993
+ noDiscovery?: boolean;
994
+ /**
995
+ * When enabled, it will hold the first optimized deps results until all static
996
+ * imports are crawled on cold start. This avoids the need for full-page reloads
997
+ * when new dependencies are discovered and they trigger the generation of new
998
+ * common chunks. If all dependencies are found by the scanner plus the explicitly
999
+ * defined ones in `include`, it is better to disable this option to let the
1000
+ * browser process more requests in parallel.
1001
+ * @default true
1002
+ * @experimental
1003
+ */
1004
+ holdUntilCrawlEnd?: boolean;
1005
+ /**
1006
+ * When enabled, Vite will not throw an error when an outdated optimized
1007
+ * dependency is requested. Enabling this option may cause a single module
1008
+ * to have a multiple reference.
1009
+ * @default false
1010
+ * @experimental
1011
+ */
1012
+ ignoreOutdatedRequests?: boolean;
1013
+ }
1014
+ type DepOptimizationOptions = DepOptimizationConfig & {
1015
+ /**
1016
+ * By default, Vite will crawl your `index.html` to detect dependencies that
1017
+ * need to be pre-bundled. If `build.rolldownOptions.input` is specified, Vite
1018
+ * will crawl those entry points instead.
1019
+ *
1020
+ * If neither of these fit your needs, you can specify custom entries using
1021
+ * this option - the value should be a tinyglobby pattern or array of patterns
1022
+ * (https://github.com/SuperchupuDev/tinyglobby) that are relative from
1023
+ * vite project root. This will overwrite default entries inference.
1024
+ */
1025
+ entries?: string | string[];
1026
+ /**
1027
+ * Force dep pre-optimization regardless of whether deps have changed.
1028
+ * @experimental
1029
+ */
1030
+ force?: boolean;
1031
+ };
1032
+ interface OptimizedDepInfo {
1033
+ id: string;
1034
+ file: string;
1035
+ src?: string;
1036
+ needsInterop?: boolean;
1037
+ browserHash?: string;
1038
+ fileHash?: string;
1039
+ /**
1040
+ * During optimization, ids can still be resolved to their final location
1041
+ * but the bundles may not yet be saved to disk
1042
+ */
1043
+ processing?: Promise<void>;
1044
+ /**
1045
+ * ExportData cache, discovered deps will parse the src entry to get exports
1046
+ * data used both to define if interop is needed and when pre-bundling
1047
+ */
1048
+ exportsData?: Promise<ExportsData>;
1049
+ isDynamicEntry?: boolean;
1050
+ }
1051
+ interface DepOptimizationMetadata {
1052
+ /**
1053
+ * The main hash is determined by user config and dependency lockfiles.
1054
+ * This is checked on server startup to avoid unnecessary re-bundles.
1055
+ */
1056
+ hash: string;
1057
+ /**
1058
+ * This hash is determined by dependency lockfiles.
1059
+ * This is checked on server startup to avoid unnecessary re-bundles.
1060
+ */
1061
+ lockfileHash: string;
1062
+ /**
1063
+ * This hash is determined by user config.
1064
+ * This is checked on server startup to avoid unnecessary re-bundles.
1065
+ */
1066
+ configHash: string;
1067
+ /**
1068
+ * The browser hash is determined by the main hash plus additional dependencies
1069
+ * discovered at runtime. This is used to invalidate browser requests to
1070
+ * optimized deps.
1071
+ */
1072
+ browserHash: string;
1073
+ /**
1074
+ * Metadata for each already optimized dependency
1075
+ */
1076
+ optimized: Record<string, OptimizedDepInfo>;
1077
+ /**
1078
+ * Metadata for non-entry optimized chunks and dynamic imports
1079
+ */
1080
+ chunks: Record<string, OptimizedDepInfo>;
1081
+ /**
1082
+ * Metadata for each newly discovered dependency after processing
1083
+ */
1084
+ discovered: Record<string, OptimizedDepInfo>;
1085
+ /**
1086
+ * OptimizedDepInfo list
1087
+ */
1088
+ depInfoList: OptimizedDepInfo[];
1089
+ }
1090
+ /**
1091
+ * Scan and optimize dependencies within a project.
1092
+ * Used by Vite CLI when running `vite optimize`.
1093
+ *
1094
+ * @deprecated the optimization process runs automatically and does not need to be called
1095
+ */
1096
+ export declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean): Promise<DepOptimizationMetadata>;
1097
+ //#endregion
1098
+ //#region src/node/server/bundledDev.d.ts
1099
+ type MemoryFile = {
1100
+ source: string | Uint8Array;
1101
+ etag?: string;
1102
+ };
1103
+ declare class MemoryFiles {
1104
+ private files;
1105
+ get size(): number;
1106
+ get(file: string): MemoryFile | undefined;
1107
+ set(file: string, content: MemoryFile | (() => MemoryFile)): void;
1108
+ has(file: string): boolean;
1109
+ clear(): void;
1110
+ }
1111
+ declare class BundledDev {
1112
+ private environment;
1113
+ private _devEngine;
1114
+ private viteRuntime?;
1115
+ private initialBuildCompleted;
1116
+ private _closed;
1117
+ private clients;
1118
+ private debouncedFullReload;
1119
+ private fullReloadPending;
1120
+ private reloadNeededClientIds;
1121
+ private debouncedReloadNeededFlush;
1122
+ private lastBuildError;
1123
+ memoryFiles: MemoryFiles;
1124
+ constructor(environment: DevEnvironment);
1125
+ private get devEngine();
1126
+ private pendingPayloadFilenames;
1127
+ get hasBuildOutput(): boolean;
1128
+ listen(): Promise<void>;
1129
+ private waitForInitialBuildFinish;
1130
+ private ensureOutputAndFlushReloadNeeded;
1131
+ triggerBundleRegenerationIfStale(): Promise<boolean>;
1132
+ triggerLazyBundling(moduleId: string | null, clientId: string | null): Promise<{
1133
+ code: string;
1134
+ filename: string;
1135
+ } | undefined>;
1136
+ /**
1137
+ * Called when the client reports that it evaluated a payload (the line appended
1138
+ * by `payloadDeliveredAck`). Only then is the payload recorded on the server's
1139
+ * per-client ship map, so later chunks may omit a module only if the client
1140
+ * already registered it.
1141
+ *
1142
+ * Note: the payload filename is unique across all clients.
1143
+ */
1144
+ markPayloadDelivered(filename: string): void;
1145
+ close(): Promise<void>;
1146
+ private storeOutputFiles;
1147
+ private getRolldownOptions;
1148
+ private handleHmrOutput;
1149
+ }
1150
+ //#endregion
1151
+ //#region src/node/server/transformRequest.d.ts
1152
+ interface TransformResult {
1153
+ code: string;
1154
+ map: SourceMap | {
1155
+ mappings: "";
1156
+ } | null;
1157
+ ssr?: boolean;
1158
+ etag?: string;
1159
+ deps?: string[];
1160
+ dynamicDeps?: string[];
1161
+ }
1162
+ interface TransformOptions {
1163
+ /**
1164
+ * @deprecated inferred from environment
1165
+ */
1166
+ ssr?: boolean;
1167
+ }
1168
+ //#endregion
1169
+ //#region src/node/server/moduleGraph.d.ts
1170
+ declare class EnvironmentModuleNode {
1171
+ environment: string;
1172
+ /**
1173
+ * Public served url path, starts with /
1174
+ */
1175
+ url: string;
1176
+ /**
1177
+ * Resolved file system path + query
1178
+ */
1179
+ id: string | null;
1180
+ file: string | null;
1181
+ type: "js" | "css" | "asset";
1182
+ info?: ModuleInfo;
1183
+ meta?: Record<string, any>;
1184
+ importers: Set<EnvironmentModuleNode>;
1185
+ importedModules: Set<EnvironmentModuleNode>;
1186
+ acceptedHmrDeps: Set<EnvironmentModuleNode>;
1187
+ acceptedHmrExports: Set<string> | null;
1188
+ importedBindings: Map<string, Set<string>> | null;
1189
+ isSelfAccepting?: boolean;
1190
+ transformResult: TransformResult | null;
1191
+ ssrModule: Record<string, any> | null;
1192
+ ssrError: Error | null;
1193
+ lastHMRTimestamp: number;
1194
+ lastInvalidationTimestamp: number;
1195
+ /**
1196
+ * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
1197
+ */
1198
+ constructor(url: string, environment: string, setIsSelfAccepting?: boolean);
1199
+ }
1200
+ type ResolvedUrl = [url: string, resolvedId: string, meta: object | null | undefined];
1201
+ declare class EnvironmentModuleGraph {
1202
+ environment: string;
1203
+ urlToModuleMap: Map<string, EnvironmentModuleNode>;
1204
+ idToModuleMap: Map<string, EnvironmentModuleNode>;
1205
+ etagToModuleMap: Map<string, EnvironmentModuleNode>;
1206
+ fileToModulesMap: Map<string, Set<EnvironmentModuleNode>>;
1207
+ constructor(environment: string, resolveId: (url: string) => Promise<PartialResolvedId | null>);
1208
+ getModuleByUrl(rawUrl: string): Promise<EnvironmentModuleNode | undefined>;
1209
+ getModuleById(id: string): EnvironmentModuleNode | undefined;
1210
+ getModulesByFile(file: string): Set<EnvironmentModuleNode> | undefined;
1211
+ onFileChange(file: string): void;
1212
+ onFileDelete(file: string): void;
1213
+ invalidateModule(mod: EnvironmentModuleNode, seen?: Set<EnvironmentModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1214
+ invalidateAll(): void;
1215
+ /**
1216
+ * Update the module graph based on a module's updated imports information
1217
+ * If there are dependencies that no longer have any importers, they are
1218
+ * returned as a Set.
1219
+ *
1220
+ * @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
1221
+ * This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
1222
+ */
1223
+ 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>;
1224
+ ensureEntryFromUrl(rawUrl: string, setIsSelfAccepting?: boolean): Promise<EnvironmentModuleNode>;
1225
+ createFileOnlyEntry(file: string): EnvironmentModuleNode;
1226
+ resolveUrl(url: string): Promise<ResolvedUrl>;
1227
+ updateModuleTransformResult(mod: EnvironmentModuleNode, result: TransformResult | null): void;
1228
+ getModuleByEtag(etag: string): EnvironmentModuleNode | undefined;
1229
+ }
1230
+ //#endregion
1231
+ //#region src/node/server/mixedModuleGraph.d.ts
1232
+ declare class ModuleNode {
1233
+ _moduleGraph: ModuleGraph;
1234
+ _clientModule: EnvironmentModuleNode | undefined;
1235
+ _ssrModule: EnvironmentModuleNode | undefined;
1236
+ constructor(moduleGraph: ModuleGraph, clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode);
1237
+ _get<T extends keyof EnvironmentModuleNode>(prop: T): EnvironmentModuleNode[T];
1238
+ _set<T extends keyof EnvironmentModuleNode>(prop: T, value: EnvironmentModuleNode[T]): void;
1239
+ _wrapModuleSet(prop: ModuleSetNames, module: EnvironmentModuleNode | undefined): Set<ModuleNode>;
1240
+ _getModuleSetUnion(prop: "importedModules" | "importers"): Set<ModuleNode>;
1241
+ _getModuleInfoUnion(prop: "info"): ModuleInfo | undefined;
1242
+ _getModuleObjectUnion(prop: "meta"): Record<string, any> | undefined;
1243
+ get url(): string;
1244
+ set url(value: string);
1245
+ get id(): string | null;
1246
+ set id(value: string | null);
1247
+ get file(): string | null;
1248
+ set file(value: string | null);
1249
+ get type(): "js" | "css" | "asset";
1250
+ get info(): ModuleInfo | undefined;
1251
+ get meta(): Record<string, any> | undefined;
1252
+ get importers(): Set<ModuleNode>;
1253
+ get clientImportedModules(): Set<ModuleNode>;
1254
+ get ssrImportedModules(): Set<ModuleNode>;
1255
+ get importedModules(): Set<ModuleNode>;
1256
+ get acceptedHmrDeps(): Set<ModuleNode>;
1257
+ get acceptedHmrExports(): Set<string> | null;
1258
+ get importedBindings(): Map<string, Set<string>> | null;
1259
+ get isSelfAccepting(): boolean | undefined;
1260
+ get transformResult(): TransformResult | null;
1261
+ set transformResult(value: TransformResult | null);
1262
+ get ssrTransformResult(): TransformResult | null;
1263
+ set ssrTransformResult(value: TransformResult | null);
1264
+ get ssrModule(): Record<string, any> | null;
1265
+ get ssrError(): Error | null;
1266
+ get lastHMRTimestamp(): number;
1267
+ set lastHMRTimestamp(value: number);
1268
+ get lastInvalidationTimestamp(): number;
1269
+ get invalidationState(): TransformResult | "HARD_INVALIDATED" | undefined;
1270
+ get ssrInvalidationState(): TransformResult | "HARD_INVALIDATED" | undefined;
1271
+ }
1272
+ declare class ModuleGraph {
1273
+ urlToModuleMap: Map<string, ModuleNode>;
1274
+ idToModuleMap: Map<string, ModuleNode>;
1275
+ etagToModuleMap: Map<string, ModuleNode>;
1276
+ fileToModulesMap: Map<string, Set<ModuleNode>>;
1277
+ private moduleNodeCache;
1278
+ constructor(moduleGraphs: {
1279
+ client: () => EnvironmentModuleGraph;
1280
+ ssr: () => EnvironmentModuleGraph;
1281
+ });
1282
+ getModuleById(id: string): ModuleNode | undefined;
1283
+ getModuleByUrl(url: string, _ssr?: boolean): Promise<ModuleNode | undefined>;
1284
+ getModulesByFile(file: string): Set<ModuleNode> | undefined;
1285
+ onFileChange(file: string): void;
1286
+ onFileDelete(file: string): void;
1287
+ invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1288
+ invalidateAll(): void;
1289
+ ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
1290
+ createFileOnlyEntry(file: string): ModuleNode;
1291
+ resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
1292
+ updateModuleTransformResult(mod: ModuleNode, result: TransformResult | null, ssr?: boolean): void;
1293
+ getModuleByEtag(etag: string): ModuleNode | undefined;
1294
+ getBackwardCompatibleBrowserModuleNode(clientModule: EnvironmentModuleNode): ModuleNode;
1295
+ getBackwardCompatibleServerModuleNode(ssrModule: EnvironmentModuleNode): ModuleNode;
1296
+ getBackwardCompatibleModuleNode(mod: EnvironmentModuleNode): ModuleNode;
1297
+ getBackwardCompatibleModuleNodeDual(clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode): ModuleNode;
1298
+ }
1299
+ type ModuleSetNames = "acceptedHmrDeps" | "importedModules";
1300
+ //#endregion
1301
+ //#region src/node/server/hmr.d.ts
1302
+ interface WsOptions {
1303
+ protocol?: string;
1304
+ host?: string;
1305
+ port?: number;
1306
+ clientPort?: number;
1307
+ path?: string;
1308
+ timeout?: number;
1309
+ server?: HttpServer;
1310
+ }
1311
+ interface HmrOptions {
1312
+ /**
1313
+ * @deprecated Use `server.ws.protocol` instead.
1314
+ */
1315
+ protocol?: string;
1316
+ /**
1317
+ * @deprecated Use `server.ws.host` instead.
1318
+ */
1319
+ host?: string;
1320
+ /**
1321
+ * @deprecated Use `server.ws.port` instead.
1322
+ */
1323
+ port?: number;
1324
+ /**
1325
+ * @deprecated Use `server.ws.clientPort` instead.
1326
+ */
1327
+ clientPort?: number;
1328
+ /**
1329
+ * @deprecated Use `server.ws.path` instead.
1330
+ */
1331
+ path?: string;
1332
+ /**
1333
+ * @deprecated Use `server.ws.timeout` instead.
1334
+ */
1335
+ timeout?: number;
1336
+ overlay?: boolean;
1337
+ /**
1338
+ * @deprecated Use `server.ws.server` instead.
1339
+ */
1340
+ server?: HttpServer;
1341
+ }
1342
+ interface HotUpdateOptions {
1343
+ type: "create" | "update" | "delete";
1344
+ file: string;
1345
+ timestamp: number;
1346
+ modules: Array<EnvironmentModuleNode>;
1347
+ read: () => string | Promise<string>;
1348
+ server: ViteDevServer;
1349
+ }
1350
+ interface HmrContext {
1351
+ file: string;
1352
+ timestamp: number;
1353
+ modules: Array<ModuleNode>;
1354
+ read: () => string | Promise<string>;
1355
+ server: ViteDevServer;
1356
+ }
1357
+ interface HotChannelClient {
1358
+ send(payload: hmrPayload_HotPayload): void;
1359
+ }
1360
+ type HotChannelListener<T extends string = string> = (data: InferCustomEventPayload<T>, client: HotChannelClient) => void;
1361
+ interface HotChannel<Api = any> {
1362
+ /**
1363
+ * When true, the fs access check is skipped in fetchModule.
1364
+ * Set this for transports that is not exposed over the network.
1365
+ */
1366
+ skipFsCheck?: boolean;
1367
+ /**
1368
+ * Broadcast events to all clients
1369
+ */
1370
+ send?(payload: hmrPayload_HotPayload): void;
1371
+ /**
1372
+ * Handle custom event emitted by `import.meta.hot.send`
1373
+ */
1374
+ on?<T extends string>(event: T, listener: HotChannelListener<T>): void;
1375
+ on?(event: "connection", listener: () => void): void;
1376
+ /**
1377
+ * Unregister event listener
1378
+ */
1379
+ off?(event: string, listener: Function): void;
1380
+ /**
1381
+ * Start listening for messages
1382
+ */
1383
+ listen?(): void;
1384
+ /**
1385
+ * Disconnect all clients, called when server is closed or restarted.
1386
+ */
1387
+ close?(): Promise<unknown> | void;
1388
+ api?: Api;
1389
+ }
1390
+ interface NormalizedHotChannelClient {
1391
+ /**
1392
+ * Send event to the client
1393
+ */
1394
+ send(payload: hmrPayload_HotPayload): void;
1395
+ /**
1396
+ * Send custom event
1397
+ */
1398
+ send(event: string, payload?: hmrPayload_CustomPayload["data"]): void;
1399
+ }
1400
+ interface NormalizedHotChannel<Api = any> {
1401
+ /**
1402
+ * Broadcast events to all clients
1403
+ */
1404
+ send(payload: hmrPayload_HotPayload): void;
1405
+ /**
1406
+ * Send custom event
1407
+ */
1408
+ send<T extends string>(event: T, payload?: InferCustomEventPayload<T>): void;
1409
+ /**
1410
+ * Handle custom event emitted by `import.meta.hot.send`
1411
+ */
1412
+ on<T extends string>(event: T, listener: (data: InferCustomEventPayload<T>, client: NormalizedHotChannelClient) => void): void;
1413
+ /**
1414
+ * @deprecated use `vite:client:connect` event instead
1415
+ */
1416
+ on(event: "connection", listener: () => void): void;
1417
+ /**
1418
+ * Unregister event listener
1419
+ */
1420
+ off(event: string, listener: Function): void;
1421
+ handleInvoke(payload: hmrPayload_HotPayload): Promise<{
1422
+ result: any;
1423
+ } | {
1424
+ error: any;
1425
+ }>;
1426
+ /**
1427
+ * Start listening for messages
1428
+ */
1429
+ listen(): void;
1430
+ /**
1431
+ * Disconnect all clients, called when server is closed or restarted.
1432
+ */
1433
+ close(): Promise<unknown> | void;
1434
+ api?: Api;
1435
+ }
1436
+ type ServerHotChannelApi = {
1437
+ innerEmitter: EventEmitter;
1438
+ outsideEmitter: EventEmitter;
1439
+ };
1440
+ type ServerHotChannel = HotChannel<ServerHotChannelApi>;
1441
+ type NormalizedServerHotChannel = NormalizedHotChannel<ServerHotChannelApi>;
1442
+ export declare function createServerHotChannel(): ServerHotChannel;
1443
+ //#endregion
1444
+ //#region src/node/server/pluginContainer.d.ts
1445
+ type SkipInformation = {
1446
+ id: string;
1447
+ importer: string | undefined;
1448
+ plugin: Plugin;
1449
+ called?: boolean;
1450
+ };
1451
+ declare class EnvironmentPluginContainer<Env extends Environment = Environment> {
1452
+ private _pluginContextMap;
1453
+ private _resolvedRolldownOptions?;
1454
+ private _processesing;
1455
+ private _seenResolves;
1456
+ private _moduleNodeToLoadAddedImports;
1457
+ getSortedPluginHooks: PluginHookUtils["getSortedPluginHooks"];
1458
+ getSortedPlugins: PluginHookUtils["getSortedPlugins"];
1459
+ moduleGraph: EnvironmentModuleGraph | undefined;
1460
+ watchFiles: Set<string>;
1461
+ minimalContext: MinimalPluginContext$1<Env>;
1462
+ private _started;
1463
+ private _buildStartPromise;
1464
+ private _closed;
1465
+ private _updateModuleLoadAddedImports;
1466
+ private _getAddedImports;
1467
+ getModuleInfo(id: string): ModuleInfo | null;
1468
+ private handleHookPromise;
1469
+ get options(): InputOptions;
1470
+ resolveRolldownOptions(): Promise<InputOptions>;
1471
+ private _getPluginContext;
1472
+ private hookParallel;
1473
+ buildStart(_options?: InputOptions): Promise<void>;
1474
+ resolveId(rawId: string, importer?: string | undefined, options?: {
1475
+ kind?: ImportKind;
1476
+ attributes?: Record<string, string>;
1477
+ custom?: CustomPluginOptions;
1478
+ /** @deprecated use `skipCalls` instead */
1479
+ skip?: Set<Plugin>;
1480
+ skipCalls?: readonly SkipInformation[];
1481
+
1482
+ isEntry?: boolean;
1483
+ }): Promise<PartialResolvedId | null>;
1484
+ load(id: string): Promise<LoadResult | null>;
1485
+ transform(code: string, id: string, options?: {
1486
+ inMap?: SourceDescription["map"];
1487
+ moduleType?: string;
1488
+ }): Promise<{
1489
+ code: string;
1490
+ map: SourceMap | {
1491
+ mappings: "";
1492
+ } | null;
1493
+ moduleType?: ModuleType;
1494
+ }>;
1495
+ watchChange(id: string, change: {
1496
+ event: "create" | "update" | "delete";
1497
+ }): Promise<void>;
1498
+ close(): Promise<void>;
1499
+ }
1500
+ declare class BasicMinimalPluginContext<Meta = PluginContextMeta> {
1501
+ meta: Meta;
1502
+ private _logger;
1503
+ constructor(meta: Meta, _logger: Logger);
1504
+ get pluginName(): string;
1505
+ debug(rawLog: string | RollupLog | (() => string | RollupLog)): void;
1506
+ info(rawLog: string | RollupLog | (() => string | RollupLog)): void;
1507
+ warn(rawLog: string | RollupLog | (() => string | RollupLog)): void;
1508
+ error(e: string | RollupError): never;
1509
+ private _normalizeRawLog;
1510
+ }
1511
+ declare class MinimalPluginContext$1<T extends Environment = Environment> extends BasicMinimalPluginContext implements MinimalPluginContext {
1512
+ environment: T;
1513
+ constructor(meta: PluginContextMeta, environment: T);
1514
+ }
1515
+ declare class PluginContainer {
1516
+ private environments;
1517
+ constructor(environments: Record<string, Environment>);
1518
+ private _getEnvironment;
1519
+ private _getPluginContainer;
1520
+ getModuleInfo(id: string): ModuleInfo | null;
1521
+ get options(): InputOptions;
1522
+ buildStart(_options?: InputOptions): Promise<void>;
1523
+ watchChange(id: string, change: {
1524
+ event: "create" | "update" | "delete";
1525
+ }): Promise<void>;
1526
+ resolveId(rawId: string, importer?: string, options?: {
1527
+ attributes?: Record<string, string>;
1528
+ custom?: CustomPluginOptions;
1529
+ /** @deprecated use `skipCalls` instead */
1530
+ skip?: Set<Plugin>;
1531
+ skipCalls?: readonly SkipInformation[];
1532
+ ssr?: boolean;
1533
+
1534
+ isEntry?: boolean;
1535
+ }): Promise<PartialResolvedId | null>;
1536
+ load(id: string, options?: {
1537
+ ssr?: boolean;
1538
+ }): Promise<LoadResult | null>;
1539
+ transform(code: string, id: string, options?: {
1540
+ ssr?: boolean;
1541
+ environment?: Environment;
1542
+ inMap?: SourceDescription["map"];
1543
+ }): Promise<{
1544
+ code: string;
1545
+ map: SourceMap | {
1546
+ mappings: "";
1547
+ } | null;
1548
+ }>;
1549
+ close(): Promise<void>;
1550
+ }
1551
+ //#endregion
1552
+ //#region src/types/ws.d.ts
1553
+ // WebSocket socket.
1554
+ declare class WebSocket extends EventEmitter {
1555
+ /** The connection is not yet open. */
1556
+ static readonly CONNECTING: 0;
1557
+ /** The connection is open and ready to communicate. */
1558
+ static readonly OPEN: 1;
1559
+ /** The connection is in the process of closing. */
1560
+ static readonly CLOSING: 2;
1561
+ /** The connection is closed. */
1562
+ static readonly CLOSED: 3;
1563
+ binaryType: 'nodebuffer' | 'arraybuffer' | 'fragments';
1564
+ readonly bufferedAmount: number;
1565
+ readonly extensions: string;
1566
+ /** Indicates whether the websocket is paused */
1567
+ readonly isPaused: boolean;
1568
+ readonly protocol: string;
1569
+ /** The current state of the connection */
1570
+ readonly readyState: typeof WebSocket.CONNECTING | typeof WebSocket.OPEN | typeof WebSocket.CLOSING | typeof WebSocket.CLOSED;
1571
+ readonly url: string;
1572
+ /** The connection is not yet open. */
1573
+ readonly CONNECTING: 0;
1574
+ /** The connection is open and ready to communicate. */
1575
+ readonly OPEN: 1;
1576
+ /** The connection is in the process of closing. */
1577
+ readonly CLOSING: 2;
1578
+ /** The connection is closed. */
1579
+ readonly CLOSED: 3;
1580
+ onopen: ((event: WebSocket.Event) => void) | null;
1581
+ onerror: ((event: WebSocket.ErrorEvent) => void) | null;
1582
+ onclose: ((event: WebSocket.CloseEvent) => void) | null;
1583
+ onmessage: ((event: WebSocket.MessageEvent) => void) | null;
1584
+ constructor(address: null);
1585
+ constructor(address: string | url_URL, options?: WebSocket.ClientOptions | ClientRequestArgs);
1586
+ constructor(address: string | url_URL, protocols?: string | string[], options?: WebSocket.ClientOptions | ClientRequestArgs);
1587
+ close(code?: number, data?: string | Buffer): void;
1588
+ ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
1589
+ pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
1590
+ send(data: any, cb?: (err?: Error) => void): void;
1591
+ send(data: any, options: {
1592
+ mask?: boolean | undefined;
1593
+ binary?: boolean | undefined;
1594
+ compress?: boolean | undefined;
1595
+ fin?: boolean | undefined;
1596
+ }, cb?: (err?: Error) => void): void;
1597
+ terminate(): void;
1598
+ /**
1599
+ * Pause the websocket causing it to stop emitting events. Some events can still be
1600
+ * emitted after this is called, until all buffered data is consumed. This method
1601
+ * is a noop if the ready state is `CONNECTING` or `CLOSED`.
1602
+ */
1603
+ pause(): void;
1604
+ /**
1605
+ * Make a paused socket resume emitting events. This method is a noop if the ready
1606
+ * state is `CONNECTING` or `CLOSED`.
1607
+ */
1608
+ resume(): void;
1609
+ // HTML5 WebSocket events
1610
+ addEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void, options?: WebSocket.EventListenerOptions): void;
1611
+ addEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void, options?: WebSocket.EventListenerOptions): void;
1612
+ addEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void, options?: WebSocket.EventListenerOptions): void;
1613
+ addEventListener(method: 'open', cb: (event: WebSocket.Event) => void, options?: WebSocket.EventListenerOptions): void;
1614
+ removeEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void): void;
1615
+ removeEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void): void;
1616
+ removeEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void): void;
1617
+ removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void;
1618
+ // Events
1619
+ on(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1620
+ on(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1621
+ on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1622
+ on(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1623
+ on(event: 'open', listener: (this: WebSocket) => void): this;
1624
+ on(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1625
+ on(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1626
+ on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1627
+ once(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1628
+ once(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1629
+ once(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1630
+ once(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1631
+ once(event: 'open', listener: (this: WebSocket) => void): this;
1632
+ once(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1633
+ once(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1634
+ once(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1635
+ off(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1636
+ off(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1637
+ off(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1638
+ off(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1639
+ off(event: 'open', listener: (this: WebSocket) => void): this;
1640
+ off(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1641
+ off(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1642
+ off(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1643
+ addListener(event: 'close', listener: (code: number, reason: Buffer) => void): this;
1644
+ addListener(event: 'error', listener: (err: Error) => void): this;
1645
+ addListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
1646
+ addListener(event: 'message', listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
1647
+ addListener(event: 'open', listener: () => void): this;
1648
+ addListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this;
1649
+ addListener(event: 'unexpected-response', listener: (request: ClientRequest, response: http.IncomingMessage) => void): this;
1650
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1651
+ removeListener(event: 'close', listener: (code: number, reason: Buffer) => void): this;
1652
+ removeListener(event: 'error', listener: (err: Error) => void): this;
1653
+ removeListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
1654
+ removeListener(event: 'message', listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
1655
+ removeListener(event: 'open', listener: () => void): this;
1656
+ removeListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this;
1657
+ removeListener(event: 'unexpected-response', listener: (request: ClientRequest, response: http.IncomingMessage) => void): this;
1658
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1659
+ }
1660
+ declare const WebSocketAlias: typeof WebSocket;
1661
+ interface WebSocketAlias extends WebSocket {}
1662
+ declare namespace WebSocket {
1663
+ /**
1664
+ * Data represents the raw message payload received over the WebSocket.
1665
+ */
1666
+ type RawData = Buffer | ArrayBuffer | Buffer[];
1667
+ /**
1668
+ * Data represents the message payload received over the WebSocket.
1669
+ */
1670
+ type Data = string | Buffer | ArrayBuffer | Buffer[];
1671
+ /**
1672
+ * CertMeta represents the accepted types for certificate & key data.
1673
+ */
1674
+ type CertMeta = string | string[] | Buffer | Buffer[];
1675
+ /**
1676
+ * VerifyClientCallbackSync is a synchronous callback used to inspect the
1677
+ * incoming message. The return value (boolean) of the function determines
1678
+ * whether or not to accept the handshake.
1679
+ */
1680
+ type VerifyClientCallbackSync = (info: {
1681
+ origin: string;
1682
+ secure: boolean;
1683
+ req: http.IncomingMessage;
1684
+ }) => boolean;
1685
+ /**
1686
+ * VerifyClientCallbackAsync is an asynchronous callback used to inspect the
1687
+ * incoming message. The return value (boolean) of the function determines
1688
+ * whether or not to accept the handshake.
1689
+ */
1690
+ type VerifyClientCallbackAsync = (info: {
1691
+ origin: string;
1692
+ secure: boolean;
1693
+ req: http.IncomingMessage;
1694
+ }, callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void) => void;
1695
+ interface ClientOptions extends SecureContextOptions {
1696
+ protocol?: string | undefined;
1697
+ followRedirects?: boolean | undefined;
1698
+ generateMask?(mask: Buffer): void;
1699
+ handshakeTimeout?: number | undefined;
1700
+ maxRedirects?: number | undefined;
1701
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
1702
+ localAddress?: string | undefined;
1703
+ protocolVersion?: number | undefined;
1704
+ headers?: {
1705
+ [key: string]: string;
1706
+ } | undefined;
1707
+ origin?: string | undefined;
1708
+ agent?: Agent | undefined;
1709
+ host?: string | undefined;
1710
+ family?: number | undefined;
1711
+ checkServerIdentity?(servername: string, cert: CertMeta): boolean;
1712
+ rejectUnauthorized?: boolean | undefined;
1713
+ maxPayload?: number | undefined;
1714
+ skipUTF8Validation?: boolean | undefined;
1715
+ }
1716
+ interface PerMessageDeflateOptions {
1717
+ serverNoContextTakeover?: boolean | undefined;
1718
+ clientNoContextTakeover?: boolean | undefined;
1719
+ serverMaxWindowBits?: number | undefined;
1720
+ clientMaxWindowBits?: number | undefined;
1721
+ zlibDeflateOptions?: {
1722
+ flush?: number | undefined;
1723
+ finishFlush?: number | undefined;
1724
+ chunkSize?: number | undefined;
1725
+ windowBits?: number | undefined;
1726
+ level?: number | undefined;
1727
+ memLevel?: number | undefined;
1728
+ strategy?: number | undefined;
1729
+ dictionary?: Buffer | Buffer[] | DataView | undefined;
1730
+ info?: boolean | undefined;
1731
+ } | undefined;
1732
+ zlibInflateOptions?: ZlibOptions | undefined;
1733
+ threshold?: number | undefined;
1734
+ concurrencyLimit?: number | undefined;
1735
+ }
1736
+ interface Event {
1737
+ type: string;
1738
+ target: WebSocket;
1739
+ }
1740
+ interface ErrorEvent {
1741
+ error: any;
1742
+ message: string;
1743
+ type: string;
1744
+ target: WebSocket;
1745
+ }
1746
+ interface CloseEvent {
1747
+ wasClean: boolean;
1748
+ code: number;
1749
+ reason: string;
1750
+ type: string;
1751
+ target: WebSocket;
1752
+ }
1753
+ interface MessageEvent {
1754
+ data: Data;
1755
+ type: string;
1756
+ target: WebSocket;
1757
+ }
1758
+ interface EventListenerOptions {
1759
+ once?: boolean | undefined;
1760
+ }
1761
+ interface ServerOptions {
1762
+ host?: string | undefined;
1763
+ port?: number | undefined;
1764
+ backlog?: number | undefined;
1765
+ server?: http.Server | HttpsServer | undefined;
1766
+ verifyClient?: VerifyClientCallbackAsync | VerifyClientCallbackSync | undefined;
1767
+ handleProtocols?: (protocols: Set<string>, request: http.IncomingMessage) => string | false;
1768
+ path?: string | undefined;
1769
+ noServer?: boolean | undefined;
1770
+ clientTracking?: boolean | undefined;
1771
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
1772
+ maxPayload?: number | undefined;
1773
+ skipUTF8Validation?: boolean | undefined;
1774
+ WebSocket?: typeof WebSocket.WebSocket | undefined;
1775
+ }
1776
+ interface AddressInfo {
1777
+ address: string;
1778
+ family: string;
1779
+ port: number;
1780
+ }
1781
+ // WebSocket Server
1782
+ class Server<T extends WebSocket = WebSocket> extends EventEmitter {
1783
+ options: ServerOptions;
1784
+ path: string;
1785
+ clients: Set<T>;
1786
+ constructor(options?: ServerOptions, callback?: () => void);
1787
+ address(): AddressInfo | string;
1788
+ close(cb?: (err?: Error) => void): void;
1789
+ handleUpgrade(request: http.IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback: (client: T, request: http.IncomingMessage) => void): void;
1790
+ shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>;
1791
+ // Events
1792
+ on(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1793
+ on(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1794
+ on(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
1795
+ on(event: 'close' | 'listening', cb: (this: Server<T>) => void): this;
1796
+ on(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
1797
+ once(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1798
+ once(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1799
+ once(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
1800
+ once(event: 'close' | 'listening', cb: (this: Server<T>) => void): this;
1801
+ once(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
1802
+ off(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1803
+ off(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1804
+ off(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
1805
+ off(event: 'close' | 'listening', cb: (this: Server<T>) => void): this;
1806
+ off(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
1807
+ addListener(event: 'connection', cb: (client: T, request: http.IncomingMessage) => void): this;
1808
+ addListener(event: 'error', cb: (err: Error) => void): this;
1809
+ addListener(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this;
1810
+ addListener(event: 'close' | 'listening', cb: () => void): this;
1811
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1812
+ removeListener(event: 'connection', cb: (client: T) => void): this;
1813
+ removeListener(event: 'error', cb: (err: Error) => void): this;
1814
+ removeListener(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this;
1815
+ removeListener(event: 'close' | 'listening', cb: () => void): this;
1816
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1817
+ }
1818
+ const WebSocketServer: typeof Server;
1819
+ interface WebSocketServer extends Server {}
1820
+ const WebSocket: typeof WebSocketAlias;
1821
+ interface WebSocket extends WebSocketAlias {}
1822
+ // WebSocket stream
1823
+ function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
1824
+ }
1825
+ //#endregion
1826
+ //#region src/node/server/ws.d.ts
1827
+ type WebSocketCustomListener<T> = (data: T, client: WebSocketClient) => void;
1828
+ declare const isWebSocketServer: unique symbol;
1829
+ interface WebSocketServer extends NormalizedHotChannel {
1830
+ /**
1831
+ * Handle custom event emitted by `import.meta.hot.send`
1832
+ */
1833
+ on: WebSocket.Server["on"] & {
1834
+ <T extends string>(event: T, listener: WebSocketCustomListener<hmrPayload_InferCustomEventPayload<T>>): void;
1835
+ };
1836
+ /**
1837
+ * Unregister event listener.
1838
+ */
1839
+ off: WebSocket.Server["off"] & {
1840
+ (event: string, listener: Function): void;
1841
+ };
1842
+ /**
1843
+ * Listen on port and host
1844
+ */
1845
+ listen(): void;
1846
+ /**
1847
+ * Disconnect all clients and terminate the server.
1848
+ */
1849
+ close(): Promise<void>;
1850
+ [isWebSocketServer]: true;
1851
+ /**
1852
+ * Get all connected clients.
1853
+ */
1854
+ clients: Set<WebSocketClient>;
1855
+ }
1856
+ interface WebSocketClient extends NormalizedHotChannelClient {
1857
+ /**
1858
+ * The raw WebSocket instance
1859
+ * @advanced
1860
+ */
1861
+ socket: WebSocket;
1862
+ }
1863
+ //#endregion
1864
+ //#region src/node/server/environment.d.ts
1865
+ interface DevEnvironmentContext {
1866
+ hot: boolean;
1867
+ transport?: HotChannel | WebSocketServer;
1868
+ options?: EnvironmentOptions;
1869
+ remoteRunner?: {
1870
+ inlineSourceMap?: boolean;
1871
+ };
1872
+ depsOptimizer?: DepsOptimizer;
1873
+ }
1874
+ export declare class DevEnvironment extends BaseEnvironment {
1875
+ mode: "dev";
1876
+ moduleGraph: EnvironmentModuleGraph;
1877
+ depsOptimizer?: DepsOptimizer;
1878
+ get pluginContainer(): EnvironmentPluginContainer<DevEnvironment>;
1879
+ /**
1880
+ * Hot channel for this environment. If not provided or disabled,
1881
+ * it will be a noop channel that does nothing.
1882
+ *
1883
+ * @example
1884
+ * environment.hot.send({ type: 'full-reload' })
1885
+ */
1886
+ hot: NormalizedHotChannel;
1887
+ bundledDev?: BundledDev;
1888
+ constructor(name: string, config: ResolvedConfig, context: DevEnvironmentContext);
1889
+ init(options?: {
1890
+ watcher?: FSWatcher;
1891
+ /**
1892
+ * the previous instance used for the environment with the same name
1893
+ *
1894
+ * when using, the consumer should check if it's an instance generated from the same class or factory function
1895
+ */
1896
+ previousInstance?: DevEnvironment;
1897
+ }): Promise<void>;
1898
+ /**
1899
+ * When the dev server is restarted, the methods are called in the following order:
1900
+ * - new instance `init`
1901
+ * - previous instance `close`
1902
+ * - new instance `listen`
1903
+ */
1904
+ listen(server: ViteDevServer): Promise<void>;
1905
+ /**
1906
+ * Called by the module runner to retrieve information about the specified
1907
+ * module. Internally calls `transformRequest` and wraps the result in the
1908
+ * format that the module runner understands.
1909
+ * This method is not meant to be called manually.
1910
+ */
1911
+ fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
1912
+ reloadModule(module: EnvironmentModuleNode): Promise<void>;
1913
+ transformRequest(url: string): Promise<TransformResult | null>;
1914
+ warmupRequest(url: string): Promise<void>;
1915
+ protected invalidateModule(m: {
1916
+ path: string;
1917
+ message?: string;
1918
+ firstInvalidatedBy: string;
1919
+ }, _client: NormalizedHotChannelClient): void;
1920
+ close(): Promise<void>;
1921
+ /**
1922
+ * Calling `await environment.waitForRequestsIdle(id)` will wait until all static imports
1923
+ * are processed after the first transformRequest call. If called from a load or transform
1924
+ * plugin hook, the id needs to be passed as a parameter to avoid deadlocks.
1925
+ * Calling this function after the first static imports section of the module graph has been
1926
+ * processed will resolve immediately.
1927
+ * @experimental
1928
+ */
1929
+ waitForRequestsIdle(ignoredId?: string): Promise<void>;
1930
+ }
1931
+ //#endregion
1932
+ //#region src/node/optimizer/scan.d.ts
1933
+ declare class ScanEnvironment extends BaseEnvironment {
1934
+ mode: "scan";
1935
+ get pluginContainer(): EnvironmentPluginContainer;
1936
+ init(): Promise<void>;
1937
+ }
1938
+ //#endregion
1939
+ //#region src/node/environment.d.ts
1940
+ type Environment = DevEnvironment | BuildEnvironment | ScanEnvironment | UnknownEnvironment;
1941
+ /**
1942
+ * Creates a function that hides the complexities of a WeakMap with an initial value
1943
+ * to implement object metadata. Used by plugins to implement cross hooks per
1944
+ * environment metadata
1945
+ *
1946
+ * @experimental
1947
+ */
1948
+ export declare function perEnvironmentState<State>(initial: (environment: Environment) => State): (context: PluginContext) => State;
1949
+ //#endregion
1950
+ //#region src/node/plugins/html.d.ts
1951
+ interface HtmlTagDescriptor {
1952
+ tag: string;
1953
+ /**
1954
+ * attribute values will be escaped automatically if needed
1955
+ */
1956
+ attrs?: Record<string, string | boolean | undefined>;
1957
+ children?: string | HtmlTagDescriptor[];
1958
+ /**
1959
+ * default: 'head-prepend'
1960
+ */
1961
+ injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
1962
+ }
1963
+ type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
1964
+ html: string;
1965
+ tags: HtmlTagDescriptor[];
1966
+ };
1967
+ interface IndexHtmlTransformContext {
1968
+ /**
1969
+ * public path when served
1970
+ */
1971
+ path: string;
1972
+ /**
1973
+ * filename on disk
1974
+ */
1975
+ filename: string;
1976
+ server?: ViteDevServer;
1977
+ bundle?: OutputBundle;
1978
+ chunk?: OutputChunk;
1979
+ originalUrl?: string;
1980
+ }
1981
+ type IndexHtmlTransformHook = (this: MinimalPluginContextWithoutEnvironment, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
1982
+ type IndexHtmlTransform = IndexHtmlTransformHook | {
1983
+ order?: "pre" | "post" | null;
1984
+ handler: IndexHtmlTransformHook;
1985
+ };
1986
+ //#endregion
1987
+ //#region src/node/plugins/pluginFilter.d.ts
1988
+ type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
1989
+ include?: Value | Array<Value>;
1990
+ exclude?: Value | Array<Value>;
1991
+ };
1992
+ //#endregion
1993
+ //#region src/node/shortcuts.d.ts
1994
+ type BindCLIShortcutsOptions<Server = ViteDevServer | PreviewServer> = {
1995
+ /**
1996
+ * Print a one-line shortcuts "help" hint to the terminal
1997
+ */
1998
+ print?: boolean;
1999
+ /**
2000
+ * Custom shortcuts to run when a key is pressed. These shortcuts take priority
2001
+ * over the default shortcuts if they have the same keys (except the `h` key).
2002
+ * To disable a default shortcut, define the same key but with `action: undefined`.
2003
+ */
2004
+ customShortcuts?: CLIShortcut<Server>[];
2005
+ };
2006
+ type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
2007
+ key: string;
2008
+ description: string;
2009
+ action?(server: Server): void | Promise<void>;
2010
+ };
2011
+ //#endregion
2012
+ //#region src/node/typeUtils.d.ts
2013
+ type RequiredExceptFor<T, K extends keyof T> = Pick<T, K> & Required<Omit<T, K>>;
2014
+ //#endregion
2015
+ //#region src/node/preview.d.ts
2016
+ interface PreviewOptions extends CommonServerOptions {}
2017
+ interface ResolvedPreviewOptions extends RequiredExceptFor<PreviewOptions, "host" | "https" | "proxy"> {}
2018
+ interface PreviewServer {
2019
+ /**
2020
+ * The resolved vite config object
2021
+ */
2022
+ config: ResolvedConfig;
2023
+ /**
2024
+ * Stop the server.
2025
+ */
2026
+ close(): Promise<void>;
2027
+ /**
2028
+ * A connect app instance.
2029
+ * - Can be used to attach custom middlewares to the preview server.
2030
+ * - Can also be used as the handler function of a custom http server
2031
+ * or as a middleware in any connect-style Node.js frameworks
2032
+ *
2033
+ * https://github.com/senchalabs/connect#use-middleware
2034
+ */
2035
+ middlewares: Connect.Server;
2036
+ /**
2037
+ * native Node http server instance
2038
+ */
2039
+ httpServer: HttpServer;
2040
+ /**
2041
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
2042
+ * if the server is not listening on any port.
2043
+ */
2044
+ resolvedUrls: ResolvedServerUrls | null;
2045
+ /**
2046
+ * Print server urls
2047
+ */
2048
+ printUrls(): void;
2049
+ /**
2050
+ * Bind CLI shortcuts
2051
+ */
2052
+ bindCLIShortcuts(options?: BindCLIShortcutsOptions<PreviewServer>): void;
2053
+ }
2054
+ type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>;
2055
+ type ClosePreviewServerHook = (this: MinimalPluginContextWithoutEnvironment) => void | Promise<void>;
2056
+ /**
2057
+ * Starts the Vite server in preview mode, to simulate a production deployment
2058
+ */
2059
+ export declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
2060
+ //#endregion
2061
+ //#region src/node/plugin.d.ts
2062
+ /**
2063
+ * Vite plugins extends the Rollup plugin interface with a few extra
2064
+ * vite-specific options. A valid vite plugin is also a valid Rollup plugin.
2065
+ * On the contrary, a Rollup plugin may or may NOT be a valid vite universal
2066
+ * plugin, since some Rollup features do not make sense in an unbundled
2067
+ * dev server context. That said, as long as a rollup plugin doesn't have strong
2068
+ * coupling between its bundle phase and output phase hooks then it should
2069
+ * just work (that means, most of them).
2070
+ *
2071
+ * By default, the plugins are run during both serve and build. When a plugin
2072
+ * is applied during serve, it will only run **non output plugin hooks** (see
2073
+ * rollup type definition of {@link rollup#PluginHooks}). You can think of the
2074
+ * dev server as only running `const bundle = rollup.rollup()` but never calling
2075
+ * `bundle.generate()`.
2076
+ *
2077
+ * A plugin that expects to have different behavior depending on serve/build can
2078
+ * export a factory function that receives the command being run via options.
2079
+ *
2080
+ * If a plugin should be applied only for server or build, a function format
2081
+ * config file can be used to conditional determine the plugins to use.
2082
+ *
2083
+ * The current environment can be accessed from the context for the all non-global
2084
+ * hooks (it is not available in config, configResolved, configureServer, etc).
2085
+ * It can be a dev, build, or scan environment.
2086
+ * Plugins can use this.environment.mode === 'dev' to guard for dev specific APIs.
2087
+ */
2088
+ interface PluginContextExtension {
2089
+ /**
2090
+ * Vite-specific environment instance
2091
+ */
2092
+ environment: Environment;
2093
+ }
2094
+ interface PluginContextMetaExtension {
2095
+ viteVersion: string;
2096
+ }
2097
+ interface ConfigPluginContext extends Omit<MinimalPluginContext, "meta" | "environment"> {
2098
+ meta: Omit<PluginContextMeta, "watchMode">;
2099
+ }
2100
+ interface MinimalPluginContextWithoutEnvironment extends Omit<MinimalPluginContext, "environment"> {}
2101
+ declare module "rolldown" {
2102
+ interface MinimalPluginContext extends PluginContextExtension {}
2103
+ interface PluginContextMeta extends PluginContextMetaExtension {}
2104
+ }
2105
+ /**
2106
+ * There are two types of plugins in Vite. App plugins and environment plugins.
2107
+ * Environment Plugins are defined by a constructor function that will be called
2108
+ * once per each environment allowing users to have completely different plugins
2109
+ * for each of them. The constructor gets the resolved environment after the server
2110
+ * and builder has already been created simplifying config access and cache
2111
+ * management for environment specific plugins.
2112
+ * Environment Plugins are closer to regular rollup plugins. They can't define
2113
+ * app level hooks (like config, configResolved, configureServer, etc).
2114
+ */
2115
+ interface Plugin<A = any> extends Rolldown.Plugin<A> {
2116
+ /**
2117
+ * Perform custom handling of HMR updates.
2118
+ * The handler receives an options containing changed filename, timestamp, a
2119
+ * list of modules affected by the file change, and the dev server instance.
2120
+ *
2121
+ * - The hook can return a filtered list of modules to narrow down the update.
2122
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2123
+ * the descriptors.
2124
+ *
2125
+ * - The hook can also return an empty array and then perform custom updates
2126
+ * by sending a custom hmr payload via environment.hot.send().
2127
+ *
2128
+ * - If the hook doesn't return a value, the hmr update will be performed as
2129
+ * normal.
2130
+ */
2131
+ hotUpdate?: ObjectHook<(this: MinimalPluginContext & {
2132
+ environment: DevEnvironment;
2133
+ }, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>>;
2134
+ /**
2135
+ * extend hooks with ssr flag
2136
+ */
2137
+ resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
2138
+ kind?: ImportKind;
2139
+ custom?: CustomPluginOptions;
2140
+ ssr?: boolean | undefined;
2141
+
2142
+ isEntry: boolean;
2143
+ }) => Promise<ResolveIdResult> | ResolveIdResult, {
2144
+ filter?: {
2145
+ id?: StringFilter<RegExp>;
2146
+ };
2147
+ }>;
2148
+ load?: ObjectHook<(this: PluginContext, id: string, options?: {
2149
+ ssr?: boolean | undefined;
2150
+ }) => Promise<LoadResult> | LoadResult, {
2151
+ filter?: {
2152
+ id?: StringFilter;
2153
+ };
2154
+ }>;
2155
+ transform?: ObjectHook<(this: TransformPluginContext, code: string, id: string, options?: {
2156
+ moduleType: ModuleType;
2157
+ ssr?: boolean | undefined;
2158
+ }) => Promise<Rolldown.TransformResult> | Rolldown.TransformResult, {
2159
+ filter?: {
2160
+ id?: StringFilter;
2161
+ code?: StringFilter;
2162
+ moduleType?: ModuleTypeFilter;
2163
+ };
2164
+ }>;
2165
+ /**
2166
+ * Opt-in this plugin into the shared plugins pipeline.
2167
+ * For backward-compatibility, plugins are re-recreated for each environment
2168
+ * during `vite build --app`
2169
+ * We have an opt-in per plugin, and a general `builder.sharedPlugins`
2170
+ * In a future major, we'll flip the default to be shared by default
2171
+ * @experimental
2172
+ */
2173
+ sharedDuringBuild?: boolean;
2174
+ /**
2175
+ * Opt-in this plugin into per-environment buildStart and buildEnd during dev.
2176
+ * For backward-compatibility, the buildStart hook is called only once during
2177
+ * dev, for the client environment. Plugins can opt-in to be called
2178
+ * per-environment, aligning with the build hook behavior.
2179
+ * @experimental
2180
+ */
2181
+ perEnvironmentStartEndDuringDev?: boolean;
2182
+ /**
2183
+ * Opt-in this plugin into per-environment watchChange during dev.
2184
+ * For backward-compatibility, the watchChange hook is called only once during
2185
+ * dev, for the client environment. Plugins can opt-in to be called
2186
+ * per-environment, aligning with the watchChange hook behavior.
2187
+ * @experimental
2188
+ */
2189
+ perEnvironmentWatchChangeDuringDev?: boolean;
2190
+ /**
2191
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
2192
+ * is still subject to the `order` property in the hook object.
2193
+ *
2194
+ * Plugin invocation order:
2195
+ * - alias resolution
2196
+ * - `enforce: 'pre'` plugins
2197
+ * - vite core plugins
2198
+ * - normal plugins
2199
+ * - vite build plugins
2200
+ * - `enforce: 'post'` plugins
2201
+ * - vite build post plugins
2202
+ */
2203
+ enforce?: "pre" | "post";
2204
+ /**
2205
+ * Apply the plugin only for serve or build, or on certain conditions.
2206
+ */
2207
+ apply?: "serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean);
2208
+ /**
2209
+ * Define environments where this plugin should be active
2210
+ * By default, the plugin is active in all environments
2211
+ * @experimental
2212
+ */
2213
+ applyToEnvironment?: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption;
2214
+ /**
2215
+ * Modify vite config before it's resolved. The hook can either mutate the
2216
+ * passed-in config directly, or return a partial config object that will be
2217
+ * deeply merged into existing config.
2218
+ *
2219
+ * Note: User plugins are resolved before running this hook so injecting other
2220
+ * plugins inside the `config` hook will have no effect.
2221
+ */
2222
+ config?: ObjectHook<(this: ConfigPluginContext, config: UserConfig, env: ConfigEnv) => Omit<UserConfig, "plugins"> | null | void | Promise<Omit<UserConfig, "plugins"> | null | void>>;
2223
+ /**
2224
+ * Modify environment configs before it's resolved. The hook can either mutate the
2225
+ * passed-in environment config directly, or return a partial config object that will be
2226
+ * deeply merged into existing config.
2227
+ * This hook is called for each environment with a partially resolved environment config
2228
+ * that already accounts for the default environment config values set at the root level.
2229
+ * If plugins need to modify the config of a given environment, they should do it in this
2230
+ * hook instead of the config hook. Leaving the config hook only for modifying the root
2231
+ * default environment config.
2232
+ */
2233
+ configEnvironment?: ObjectHook<(this: ConfigPluginContext, name: string, config: EnvironmentOptions, env: ConfigEnv & {
2234
+ /**
2235
+ * Whether this environment is SSR environment and `ssr.target` is set to `'webworker'`.
2236
+ * Only intended to be used for backward compatibility.
2237
+ */
2238
+ isSsrTargetWebworker?: boolean;
2239
+ }) => EnvironmentOptions | null | void | Promise<EnvironmentOptions | null | void>>;
2240
+ /**
2241
+ * Use this hook to read and store the final resolved vite config.
2242
+ */
2243
+ configResolved?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, config: ResolvedConfig) => void | Promise<void>>;
2244
+ /**
2245
+ * Configure the vite server. The hook receives the {@link ViteDevServer}
2246
+ * instance. This can also be used to store a reference to the server
2247
+ * for use in other hooks.
2248
+ *
2249
+ * The hooks will be called before internal middlewares are applied. A hook
2250
+ * can return a post hook that will be called after internal middlewares
2251
+ * are applied. Hook can be async functions and will be called in series.
2252
+ */
2253
+ configureServer?: ObjectHook<ServerHook>;
2254
+ /**
2255
+ * Configure the preview server. The hook receives the {@link PreviewServer}
2256
+ * instance. This can also be used to store a reference to the server
2257
+ * for use in other hooks.
2258
+ *
2259
+ * The hooks are called before other middlewares are applied. A hook can
2260
+ * return a post hook that will be called after other middlewares are
2261
+ * applied. Hooks can be async functions and will be called in series.
2262
+ */
2263
+ configurePreviewServer?: ObjectHook<PreviewServerHook>;
2264
+ /**
2265
+ * Run logic when the server is restarted or closed. The hook receives a
2266
+ * `reason` that is `'restart'` when the server is restarting and `'close'`
2267
+ * when it is closing.
2268
+ *
2269
+ * The hooks are called after the server is torn down. Hooks can be async
2270
+ * functions and will be called in parallel.
2271
+ */
2272
+ closeServer?: ObjectHook<CloseServerHook>;
2273
+ /**
2274
+ * Same as `closeServer` but for the preview server. The preview server never
2275
+ * restarts, so no `reason` is provided.
2276
+ */
2277
+ closePreviewServer?: ObjectHook<ClosePreviewServerHook>;
2278
+ /**
2279
+ * Transform index.html.
2280
+ * The hook receives the following arguments:
2281
+ *
2282
+ * - html: string
2283
+ * - ctx: IndexHtmlTransformContext, which contains:
2284
+ * - path: public path when served
2285
+ * - filename: filename on disk
2286
+ * - server?: ViteDevServer (only present during serve)
2287
+ * - bundle?: rollup.OutputBundle (only present during build)
2288
+ * - chunk?: rollup.OutputChunk
2289
+ * - originalUrl?: string
2290
+ *
2291
+ * It can either return a transformed string, or a list of html tag
2292
+ * descriptors that will be injected into the `<head>` or `<body>`.
2293
+ *
2294
+ * By default the transform is applied **after** vite's internal html
2295
+ * transform. If you need to apply the transform before vite, use an object:
2296
+ * `{ order: 'pre', handler: hook }`
2297
+ */
2298
+ transformIndexHtml?: IndexHtmlTransform;
2299
+ /**
2300
+ * Build Environments
2301
+ *
2302
+ * @experimental
2303
+ */
2304
+ buildApp?: ObjectHook<BuildAppHook>;
2305
+ /**
2306
+ * Perform custom handling of HMR updates.
2307
+ * The handler receives a context containing changed filename, timestamp, a
2308
+ * list of modules affected by the file change, and the dev server instance.
2309
+ *
2310
+ * - The hook can return a filtered list of modules to narrow down the update.
2311
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2312
+ * the descriptors.
2313
+ *
2314
+ * - The hook can also return an empty array and then perform custom updates
2315
+ * by sending a custom hmr payload via server.ws.send().
2316
+ *
2317
+ * - If the hook doesn't return a value, the hmr update will be performed as
2318
+ * normal.
2319
+ */
2320
+ handleHotUpdate?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, ctx: HmrContext) => Array<ModuleNode> | void | Promise<Array<ModuleNode> | void>>;
2321
+ /**
2322
+ * This hook is not supported by Rolldown yet. But the type is declared for compatibility.
2323
+ *
2324
+ * @deprecated This hook is **not** deprecated. It is marked as deprecated just to make it clear that this hook is currently a no-op.
2325
+ */
2326
+ shouldTransformCachedModule?: ObjectHook<(this: PluginContext, options: {
2327
+ code: string;
2328
+ id: string;
2329
+ meta: CustomPluginOptions;
2330
+ moduleSideEffects: boolean | "no-treeshake";
2331
+ }) => boolean | null | void>;
2332
+ }
2333
+ type HookHandler<T> = T extends ObjectHook<infer H> ? H : T;
2334
+ type PluginWithRequiredHook<K extends keyof Plugin> = Plugin & { [P in K]: NonNullable<Plugin[P]>; };
2335
+ type Thenable<T> = T | Promise<T>;
2336
+ type FalsyPlugin = false | null | undefined;
2337
+ type PluginOption = Thenable<Plugin | {
2338
+ name: string;
2339
+ } | FalsyPlugin | PluginOption[]>;
2340
+ /**
2341
+ * @experimental
2342
+ */
2343
+ export declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption): Plugin;
2344
+ //#endregion
2345
+ //#region src/node/watch.d.ts
2346
+ /**
2347
+ * Watch options for the dev server. Accepts both chokidar options and Rolldown
2348
+ * watch options. The chokidar options are used by the chokidar watcher, while
2349
+ * the Rolldown options are used by the Rolldown file watcher when bundled dev
2350
+ * mode is enabled.
2351
+ */
2352
+ type ServerWatchOptions = WatchOptions & Omit<DevWatchOptions, "enabled" | "skipWrite">;
2353
+ //#endregion
2354
+ //#region src/node/server/index.d.ts
2355
+ interface ServerOptions$1 extends CommonServerOptions {
2356
+ /**
2357
+ * Configure HMR-specific options (port, host, path & protocol)
2358
+ */
2359
+ hmr?: HmrOptions | boolean;
2360
+ /**
2361
+ * Configure WebSocket connection options.
2362
+ * Set to `false` to disable the WebSocket server and connection.
2363
+ */
2364
+ ws?: WsOptions | false;
2365
+ /**
2366
+ * Warm-up files to transform and cache the results in advance. This improves the
2367
+ * initial page load during server starts and prevents transform waterfalls.
2368
+ */
2369
+ warmup?: {
2370
+ /**
2371
+ * The files to be transformed and used on the client-side. Supports glob patterns.
2372
+ */
2373
+ clientFiles?: string[];
2374
+ /**
2375
+ * The files to be transformed and used in SSR. Supports glob patterns.
2376
+ */
2377
+ ssrFiles?: string[];
2378
+ };
2379
+ /**
2380
+ * File system watcher options, or null to disable FS watching.
2381
+ *
2382
+ * Accepts chokidar options
2383
+ * (https://github.com/paulmillr/chokidar/tree/3.6.0#api), which are used by
2384
+ * the chokidar watcher, and Rolldown watch options, which are used by the
2385
+ * Rolldown file watcher when bundled dev mode is enabled.
2386
+ */
2387
+ watch?: ServerWatchOptions | null;
2388
+ /**
2389
+ * Create Vite dev server to be used as a middleware in an existing server
2390
+ * @default false
2391
+ */
2392
+ middlewareMode?: boolean | {
2393
+ /**
2394
+ * Parent server instance to attach to
2395
+ *
2396
+ * This is needed to proxy WebSocket connections to the parent server.
2397
+ */
2398
+ server: HttpServer;
2399
+ };
2400
+ /**
2401
+ * Options for files served via '/\@fs/'.
2402
+ */
2403
+ fs?: FileSystemServeOptions;
2404
+ /**
2405
+ * Origin for the generated asset URLs.
2406
+ *
2407
+ * @example `http://127.0.0.1:8080`
2408
+ */
2409
+ origin?: string;
2410
+ /**
2411
+ * Pre-transform known direct imports
2412
+ * @default true
2413
+ */
2414
+ preTransformRequests?: boolean;
2415
+ /**
2416
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
2417
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
2418
+ *
2419
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
2420
+ * disable this behavior, or, for full control, a function that takes the source path and
2421
+ * sourcemap path and returns whether to ignore the source path.
2422
+ */
2423
+ sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
2424
+ /**
2425
+ * Backward compatibility. The buildStart and buildEnd hooks were called only once for
2426
+ * the client environment. This option enables per-environment buildStart and buildEnd hooks.
2427
+ * @default false
2428
+ * @experimental
2429
+ */
2430
+ perEnvironmentStartEndDuringDev?: boolean;
2431
+ /**
2432
+ * Backward compatibility. The watchChange hook was called only once for the client environment.
2433
+ * This option enables per-environment watchChange hooks.
2434
+ * @default false
2435
+ * @experimental
2436
+ */
2437
+ perEnvironmentWatchChangeDuringDev?: boolean;
2438
+ /**
2439
+ * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2440
+ * @experimental
2441
+ */
2442
+ hotUpdateEnvironments?: (server: ViteDevServer, hmr: (environment: DevEnvironment) => Promise<void>) => Promise<void>;
2443
+ forwardConsole?: boolean | ForwardConsoleOptions;
2444
+ }
2445
+ interface ResolvedServerOptions extends Omit<RequiredExceptFor<ServerOptions$1, "host" | "https" | "proxy" | "hmr" | "ws" | "watch" | "origin" | "hotUpdateEnvironments">, "fs" | "middlewareMode" | "sourcemapIgnoreList" | "forwardConsole"> {
2446
+ fs: Required<FileSystemServeOptions>;
2447
+ middlewareMode: NonNullable<ServerOptions$1["middlewareMode"]>;
2448
+ sourcemapIgnoreList: Exclude<ServerOptions$1["sourcemapIgnoreList"], false | undefined>;
2449
+ forwardConsole: ResolvedForwardConsoleOptions;
2450
+ }
2451
+ interface FileSystemServeOptions {
2452
+ /**
2453
+ * Strictly restrict file accessing outside of allowing paths.
2454
+ *
2455
+ * Set to `false` to disable the warning
2456
+ *
2457
+ * @default true
2458
+ */
2459
+ strict?: boolean;
2460
+ /**
2461
+ * Restrict accessing files outside the allowed directories.
2462
+ *
2463
+ * Accepts absolute path or a path relative to project root.
2464
+ * Will try to search up for workspace root by default.
2465
+ */
2466
+ allow?: string[];
2467
+ /**
2468
+ * Restrict accessing files that matches the patterns.
2469
+ *
2470
+ * This will have higher priority than `allow`.
2471
+ * picomatch patterns are supported.
2472
+ *
2473
+ * @default ['.env', '.env.*', '*.{crt,pem,key,p12,pfx,cer,der}', '.npmrc', '.yarnrc.yml', '**\/.git/**']
2474
+ */
2475
+ deny?: string[];
2476
+ }
2477
+ type ServerHook = (this: MinimalPluginContextWithoutEnvironment, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
2478
+ interface CloseServerHookContext {
2479
+ /**
2480
+ * Whether the server is being restarted (e.g. a config change or
2481
+ * `server.restart()`) or closed (e.g. the `q` shortcut, SIGTERM, stdin
2482
+ * ending, or `server.close()`).
2483
+ */
2484
+ reason: "restart" | "close";
2485
+ }
2486
+ type CloseServerHook = (this: MinimalPluginContextWithoutEnvironment, context: CloseServerHookContext) => void | Promise<void>;
2487
+ type HttpServer = http.Server | Http2SecureServer;
2488
+ interface ViteDevServer {
2489
+ /**
2490
+ * The resolved vite config object
2491
+ */
2492
+ config: ResolvedConfig;
2493
+ /**
2494
+ * A connect app instance.
2495
+ * - Can be used to attach custom middlewares to the dev server.
2496
+ * - Can also be used as the handler function of a custom http server
2497
+ * or as a middleware in any connect-style Node.js frameworks
2498
+ *
2499
+ * https://github.com/senchalabs/connect#use-middleware
2500
+ */
2501
+ middlewares: Connect.Server;
2502
+ /**
2503
+ * native Node http server instance
2504
+ * will be null in middleware mode
2505
+ */
2506
+ httpServer: HttpServer | null;
2507
+ /**
2508
+ * Chokidar watcher instance. If `config.server.watch` is set to `null`,
2509
+ * it will not watch any files and calling `add` or `unwatch` will have no effect.
2510
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2511
+ */
2512
+ watcher: FSWatcher;
2513
+ /**
2514
+ * WebSocket server with `send(payload)` method
2515
+ */
2516
+ ws: WebSocketServer;
2517
+ /**
2518
+ * An alias to `server.environments.client.hot`.
2519
+ * If you want to interact with all environments, loop over `server.environments`.
2520
+ */
2521
+ hot: NormalizedHotChannel;
2522
+ /**
2523
+ * Rollup plugin container that can run plugin hooks on a given file
2524
+ */
2525
+ pluginContainer: PluginContainer;
2526
+ /**
2527
+ * Module execution environments attached to the Vite server.
2528
+ */
2529
+ environments: Record<"client" | "ssr" | (string & {}), DevEnvironment>;
2530
+ /**
2531
+ * Module graph that tracks the import relationships, url to file mapping
2532
+ * and hmr state.
2533
+ */
2534
+ moduleGraph: ModuleGraph;
2535
+ /**
2536
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
2537
+ * in middleware mode or if the server is not listening on any port.
2538
+ */
2539
+ resolvedUrls: ResolvedServerUrls | null;
2540
+ /**
2541
+ * Programmatically resolve, load and transform a URL and get the result
2542
+ * without going through the http request pipeline.
2543
+ */
2544
+ transformRequest(url: string, options?: TransformOptions): Promise<TransformResult | null>;
2545
+ /**
2546
+ * Same as `transformRequest` but only warm up the URLs so the next request
2547
+ * will already be cached. The function will never throw as it handles and
2548
+ * reports errors internally.
2549
+ */
2550
+ warmupRequest(url: string, options?: TransformOptions): Promise<void>;
2551
+ /**
2552
+ * Apply vite built-in HTML transforms and any plugin HTML transforms.
2553
+ */
2554
+ transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
2555
+ /**
2556
+ * Transform module code into SSR format.
2557
+ */
2558
+ ssrTransform(code: string, inMap: SourceMap | {
2559
+ mappings: "";
2560
+ } | null, url: string, originalCode?: string): Promise<TransformResult | null>;
2561
+ /**
2562
+ * Load a given URL as an instantiated module for SSR.
2563
+ */
2564
+ ssrLoadModule(url: string, opts?: {
2565
+ fixStacktrace?: boolean;
2566
+ }): Promise<Record<string, any>>;
2567
+ /**
2568
+ * Returns a fixed version of the given stack
2569
+ */
2570
+ ssrRewriteStacktrace(stack: string): string;
2571
+ /**
2572
+ * Mutates the given SSR error by rewriting the stacktrace
2573
+ */
2574
+ ssrFixStacktrace(e: Error): void;
2575
+ /**
2576
+ * Triggers HMR for a module in the module graph. You can use the `server.moduleGraph`
2577
+ * API to retrieve the module to be reloaded. If `hmr` is false, this is a no-op.
2578
+ */
2579
+ reloadModule(module: ModuleNode): Promise<void>;
2580
+ /**
2581
+ * Start the server.
2582
+ */
2583
+ listen(port?: number, isRestart?: boolean): Promise<ViteDevServer>;
2584
+ /**
2585
+ * Stop the server.
2586
+ */
2587
+ close(): Promise<void>;
2588
+ /**
2589
+ * Print server urls
2590
+ */
2591
+ printUrls(): void;
2592
+ /**
2593
+ * Bind CLI shortcuts
2594
+ */
2595
+ bindCLIShortcuts(options?: BindCLIShortcutsOptions<ViteDevServer>): void;
2596
+ /**
2597
+ * Restart the server.
2598
+ *
2599
+ * @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
2600
+ */
2601
+ restart(forceOptimize?: boolean): Promise<void>;
2602
+ /**
2603
+ * Open browser
2604
+ */
2605
+ openBrowser(): void;
2606
+ /**
2607
+ * Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
2608
+ * are processed. If called from a load or transform plugin hook, the id needs to be
2609
+ * passed as a parameter to avoid deadlocks. Calling this function after the first
2610
+ * static imports section of the module graph has been processed will resolve immediately.
2611
+ */
2612
+ waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
2613
+ }
2614
+ interface ResolvedServerUrls {
2615
+ local: string[];
2616
+ network: string[];
2617
+ /**
2618
+ * Names of the network interface that each {@link ResolvedServerUrls.network}
2619
+ * URL is bound to, in the same order as `network`. An entry is `undefined`
2620
+ * when the interface name is not known, for example when an explicit `host`
2621
+ * is set.
2622
+ */
2623
+ networkInterfaceNames?: (string | undefined)[];
2624
+ }
2625
+ export declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Promise<ViteDevServer>;
2626
+ //#endregion
2627
+ //#region src/node/logger.d.ts
2628
+ type LogType = "error" | "warn" | "info";
2629
+ type LogLevel = LogType | "silent";
2630
+ interface Logger {
2631
+ info(msg: string, options?: LogOptions): void;
2632
+ warn(msg: string, options?: LogOptions): void;
2633
+ warnOnce(msg: string, options?: LogOptions): void;
2634
+ error(msg: string, options?: LogErrorOptions): void;
2635
+ clearScreen(type: LogType): void;
2636
+ hasErrorLogged(error: Error | RollupError): boolean;
2637
+ hasWarned: boolean;
2638
+ }
2639
+ interface LogOptions {
2640
+ clear?: boolean;
2641
+ timestamp?: boolean;
2642
+ environment?: string;
2643
+ }
2644
+ interface LogErrorOptions extends LogOptions {
2645
+ error?: Error | RollupError | null;
2646
+ }
2647
+ interface LoggerOptions {
2648
+ prefix?: string;
2649
+ allowClearScreen?: boolean;
2650
+ customLogger?: Logger;
2651
+ console?: Console;
2652
+ }
2653
+ export declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
2654
+ //#endregion
2655
+ //#region src/node/baseEnvironment.d.ts
2656
+ declare class PartialEnvironment {
2657
+ name: string;
2658
+ getTopLevelConfig(): ResolvedConfig;
2659
+ config: ResolvedConfig & ResolvedEnvironmentOptions;
2660
+ logger: Logger;
2661
+ constructor(name: string, topLevelConfig: ResolvedConfig, options?: ResolvedEnvironmentOptions);
2662
+ }
2663
+ declare class BaseEnvironment extends PartialEnvironment {
2664
+ get plugins(): readonly Plugin[];
2665
+ constructor(name: string, config: ResolvedConfig, options?: ResolvedEnvironmentOptions);
2666
+ }
2667
+ /**
2668
+ * This class discourages users from inversely checking the `mode`
2669
+ * to determine the type of environment, e.g.
2670
+ *
2671
+ * ```js
2672
+ * const isDev = environment.mode !== 'build' // bad
2673
+ * const isDev = environment.mode === 'dev' // good
2674
+ * ```
2675
+ *
2676
+ * You should also not check against `"unknown"` specifically. It's
2677
+ * a placeholder for more possible environment types.
2678
+ */
2679
+ declare class UnknownEnvironment extends BaseEnvironment {
2680
+ mode: "unknown";
2681
+ }
2682
+ //#endregion
2683
+ //#region src/node/plugins/resolve.d.ts
2684
+ interface EnvironmentResolveOptions {
2685
+ /**
2686
+ * @default ['browser', 'module', 'jsnext:main', 'jsnext']
2687
+ */
2688
+ mainFields?: string[];
2689
+ conditions?: string[];
2690
+ externalConditions?: string[];
2691
+ /**
2692
+ * @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
2693
+ */
2694
+ extensions?: string[];
2695
+ dedupe?: string[];
2696
+ /**
2697
+ * Prevent listed dependencies from being externalized and will get bundled in build.
2698
+ * Only works in server environments for now. Previously this was `ssr.noExternal`.
2699
+ * @experimental
2700
+ */
2701
+ noExternal?: string | RegExp | (string | RegExp)[] | true;
2702
+ /**
2703
+ * Externalize the given dependencies and their transitive dependencies.
2704
+ * Only works in server environments for now. Previously this was `ssr.external`.
2705
+ * @experimental
2706
+ */
2707
+ external?: string[] | true;
2708
+ /**
2709
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
2710
+ */
2711
+ builtins?: (string | RegExp)[];
2712
+ }
2713
+ interface ResolveOptions extends EnvironmentResolveOptions {
2714
+ /**
2715
+ * @default false
2716
+ */
2717
+ preserveSymlinks?: boolean;
2718
+ /**
2719
+ * Enable tsconfig paths resolution
2720
+ *
2721
+ * @default false
2722
+ */
2723
+ tsconfigPaths?: boolean;
2724
+ }
2725
+ interface ResolvePluginOptions {
2726
+ root: string;
2727
+ isBuild: boolean;
2728
+ isProduction: boolean;
2729
+ packageCache?: PackageCache;
2730
+ /**
2731
+ * src code mode also attempts the following:
2732
+ * - resolving /xxx as URLs
2733
+ * - resolving bare imports from optimized deps
2734
+ */
2735
+ asSrc?: boolean;
2736
+ tryIndex?: boolean;
2737
+ tryPrefix?: string;
2738
+ preferRelative?: boolean;
2739
+ isRequire?: boolean;
2740
+ scan?: boolean;
2741
+ /**
2742
+ * Enable when `legacy.inconsistentCjsInterop` is true. See that option for more details.
2743
+ */
2744
+ legacyInconsistentCjsInterop?: boolean;
2745
+ }
2746
+ interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {}
2747
+ //#endregion
2748
+ //#region src/node/packages.d.ts
2749
+ /** Cache for package.json resolution and package.json contents */
2750
+ type PackageCache = Map<string, PackageData>;
2751
+ interface PackageData {
2752
+ dir: string;
2753
+ hasSideEffects: (id: string) => boolean | "no-treeshake" | null;
2754
+ setResolvedCache: (key: string, entry: string, options: InternalResolveOptions) => void;
2755
+ getResolvedCache: (key: string, options: InternalResolveOptions) => string | undefined;
2756
+ data: {
2757
+ [field: string]: any;
2758
+ name: string;
2759
+ type: string;
2760
+ version: string;
2761
+ main: string;
2762
+ module: string;
2763
+ browser: string | Record<string, string | false>;
2764
+ exports: string | Record<string, any> | string[];
2765
+ imports: Record<string, any>;
2766
+ dependencies: Record<string, string>;
2767
+ };
2768
+ }
2769
+ //#endregion
2770
+ //#region src/node/plugins/license.d.ts
2771
+ interface LicenseOptions {
2772
+ /**
2773
+ * The output file name of the license file relative to the output directory.
2774
+ * Specify a path that ends with `.json` to output the raw JSON metadata.
2775
+ *
2776
+ * @default '.vite/license.md'
2777
+ */
2778
+ fileName: string;
2779
+ }
2780
+ //#endregion
2781
+ //#region src/node/plugins/terser.d.ts
2782
+ interface TerserOptions extends TerserMinifyOptions {
2783
+ /**
2784
+ * Vite-specific option to specify the max number of workers to spawn
2785
+ * when minifying files with terser.
2786
+ *
2787
+ * @default number of CPUs minus 1
2788
+ */
2789
+ maxWorkers?: number;
2790
+ }
2791
+ //#endregion
2792
+ //#region src/node/build.d.ts
2793
+ interface BuildEnvironmentOptions {
2794
+ /**
2795
+ * Compatibility transform target. The transform is performed with esbuild
2796
+ * and the lowest supported target is es2015. Note this only handles
2797
+ * syntax transformation and does not cover polyfills
2798
+ *
2799
+ * Default: 'baseline-widely-available' - transpile targeting browsers that
2800
+ * are included in the Baseline Widely Available on 2026-01-01.
2801
+ * (Chrome 111+, Edge 111+, Firefox 114+, Safari 16.4+).
2802
+ *
2803
+ * Another special value is 'esnext' - which only performs minimal transpiling
2804
+ * (for minification compat).
2805
+ *
2806
+ * For custom targets, see https://esbuild.github.io/api/#target and
2807
+ * https://esbuild.github.io/content-types/#javascript for more details.
2808
+ * @default 'baseline-widely-available'
2809
+ */
2810
+ target?: "baseline-widely-available" | EsbuildTarget | false;
2811
+ /**
2812
+ * whether to inject module preload polyfill.
2813
+ * Note: does not apply to library mode.
2814
+ * @default true
2815
+ * @deprecated use `modulePreload.polyfill` instead
2816
+ */
2817
+ polyfillModulePreload?: boolean;
2818
+ /**
2819
+ * Configure module preload
2820
+ * Note: does not apply to library mode.
2821
+ * @default true
2822
+ */
2823
+ modulePreload?: boolean | ModulePreloadOptions;
2824
+ /**
2825
+ * Directory relative from `root` where build output will be placed. If the
2826
+ * directory exists, it will be removed before the build.
2827
+ * @default 'dist'
2828
+ */
2829
+ outDir?: string;
2830
+ /**
2831
+ * Directory relative from `outDir` where the built js/css/image assets will
2832
+ * be placed.
2833
+ * @default 'assets'
2834
+ */
2835
+ assetsDir?: string;
2836
+ /**
2837
+ * Static asset files smaller than this number (in bytes) will be inlined as
2838
+ * base64 strings. If a callback is passed, a boolean can be returned to opt-in
2839
+ * or opt-out of inlining. If nothing is returned the default logic applies.
2840
+ *
2841
+ * Default limit is `4096` (4 KiB). Set to `0` to disable.
2842
+ * @default 4096
2843
+ */
2844
+ assetsInlineLimit?: number | ((filePath: string, content: Buffer) => boolean | undefined);
2845
+ /**
2846
+ * Whether to code-split CSS. When enabled, CSS in async chunks will be
2847
+ * inlined as strings in the chunk and inserted via dynamically created
2848
+ * style tags when the chunk is loaded.
2849
+ * @default true
2850
+ */
2851
+ cssCodeSplit?: boolean;
2852
+ /**
2853
+ * An optional separate target for CSS minification.
2854
+ * As esbuild only supports configuring targets to mainstream
2855
+ * browsers, users may need this option when they are targeting
2856
+ * a niche browser that comes with most modern JavaScript features
2857
+ * but has poor CSS support, e.g. Android WeChat WebView, which
2858
+ * doesn't support the #RGBA syntax.
2859
+ * When `build.cssMinify` is `lightningcss` (the default), this
2860
+ * option takes precedence over `css.lightningcss.targets` for the
2861
+ * minification step.
2862
+ * @default target
2863
+ */
2864
+ cssTarget?: EsbuildTarget | false;
2865
+ /**
2866
+ * Override CSS minification specifically instead of defaulting to `build.minify`,
2867
+ * so you can configure minification for JS and CSS separately.
2868
+ * @default 'lightningcss', but false if build.minify is disabled for client build
2869
+ */
2870
+ cssMinify?: boolean | "lightningcss" | "esbuild";
2871
+ /**
2872
+ * If `true`, a separate sourcemap file will be created. If 'inline', the
2873
+ * sourcemap will be appended to the resulting output file as data URI.
2874
+ * 'hidden' works like `true` except that the corresponding sourcemap
2875
+ * comments in the bundled files are suppressed.
2876
+ * @default false
2877
+ */
2878
+ sourcemap?: boolean | "inline" | "hidden";
2879
+ /**
2880
+ * Set to `false` to disable minification, or specify the minifier to use.
2881
+ * Available options are 'oxc' or 'terser' or 'esbuild'.
2882
+ * @default 'oxc' for client build, false for SSR build
2883
+ */
2884
+ minify?: boolean | "oxc" | "terser" | "esbuild";
2885
+ /**
2886
+ * Options for terser
2887
+ * https://terser.org/docs/api-reference#minify-options
2888
+ *
2889
+ * In addition, you can also pass a `maxWorkers: number` option to specify the
2890
+ * max number of workers to spawn. Defaults to the number of CPUs minus 1.
2891
+ */
2892
+ terserOptions?: TerserOptions;
2893
+ /**
2894
+ * Whether to use import maps feature to optimize chunk caching efficiency.
2895
+ * @default false
2896
+ * @experimental
2897
+ */
2898
+ chunkImportMap?: boolean;
2899
+ /**
2900
+ * Alias to `rolldownOptions`
2901
+ * @deprecated Use `rolldownOptions` instead.
2902
+ */
2903
+ rollupOptions?: RolldownOptions;
2904
+ /**
2905
+ * Will be merged with internal rolldown options.
2906
+ * https://rolldown.rs/reference/Interface.RolldownOptions
2907
+ */
2908
+ rolldownOptions?: RolldownOptions;
2909
+ /**
2910
+ * Options to pass on to `@rollup/plugin-commonjs`
2911
+ * @deprecated This option is no-op and will be removed in future versions.
2912
+ */
2913
+ commonjsOptions?: RollupCommonJSOptions;
2914
+ /**
2915
+ * Options to pass on to `@rollup/plugin-dynamic-import-vars`
2916
+ */
2917
+ dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
2918
+ /**
2919
+ * Whether to write bundle to disk
2920
+ * @default true
2921
+ */
2922
+ write?: boolean;
2923
+ /**
2924
+ * Empty outDir on write.
2925
+ * @default true when outDir is a sub directory of project root
2926
+ */
2927
+ emptyOutDir?: boolean | null;
2928
+ /**
2929
+ * Copy the public directory to outDir on write.
2930
+ * @default true
2931
+ */
2932
+ copyPublicDir?: boolean;
2933
+ /**
2934
+ * Whether to emit a `.vite/license.md` file that includes all bundled dependencies'
2935
+ * licenses. Pass an object to customize the output file name.
2936
+ * @default false
2937
+ */
2938
+ license?: boolean | LicenseOptions;
2939
+ /**
2940
+ * Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
2941
+ * to their hashed versions. Useful when you want to generate your own HTML
2942
+ * instead of using the one generated by Vite.
2943
+ *
2944
+ * Example:
2945
+ *
2946
+ * ```json
2947
+ * {
2948
+ * "main.js": {
2949
+ * "file": "main.68fe3fad.js",
2950
+ * "css": "main.e6b63442.css",
2951
+ * "imports": [...],
2952
+ * "dynamicImports": [...]
2953
+ * }
2954
+ * }
2955
+ * ```
2956
+ * @default false
2957
+ */
2958
+ manifest?: boolean | string;
2959
+ /**
2960
+ * Build in library mode. The value should be the global name of the lib in
2961
+ * UMD mode. This will produce esm + cjs + umd bundle formats with default
2962
+ * configurations that are suitable for distributing libraries.
2963
+ * @default false
2964
+ */
2965
+ lib?: LibraryOptions | false;
2966
+ /**
2967
+ * Produce SSR oriented build. Note this requires specifying SSR entry via
2968
+ * `rolldownOptions.input`.
2969
+ * @default false
2970
+ */
2971
+ ssr?: boolean | string;
2972
+ /**
2973
+ * Generate SSR manifest for determining style links and asset preload
2974
+ * directives in production.
2975
+ * @default false
2976
+ */
2977
+ ssrManifest?: boolean | string;
2978
+ /**
2979
+ * Emit assets during SSR.
2980
+ * @default false
2981
+ */
2982
+ ssrEmitAssets?: boolean;
2983
+ /**
2984
+ * Emit assets during build. Frameworks can set environments.ssr.build.emitAssets
2985
+ * By default, it is true for the client and false for other environments.
2986
+ */
2987
+ emitAssets?: boolean;
2988
+ /**
2989
+ * Set to false to disable reporting compressed chunk sizes.
2990
+ * Can slightly improve build speed.
2991
+ * @default true
2992
+ */
2993
+ reportCompressedSize?: boolean;
2994
+ /**
2995
+ * Adjust chunk size warning limit (in kB).
2996
+ * @default 500
2997
+ */
2998
+ chunkSizeWarningLimit?: number;
2999
+ /**
3000
+ * Rollup watch options
3001
+ * https://rollupjs.org/configuration-options/#watch
3002
+ * @default null
3003
+ */
3004
+ watch?: WatcherOptions | null;
3005
+ /**
3006
+ * create the Build Environment instance
3007
+ */
3008
+ createEnvironment?: (name: string, config: ResolvedConfig) => Promise<BuildEnvironment> | BuildEnvironment;
3009
+ }
3010
+ type BuildOptions = BuildEnvironmentOptions;
3011
+ interface LibraryOptions {
3012
+ /**
3013
+ * Path of library entry.
3014
+ * Defaults to the top-level `input` option when omitted.
3015
+ */
3016
+ entry?: InputOption;
3017
+ /**
3018
+ * The name of the exposed global variable. Required when the `formats` option includes
3019
+ * `umd` or `iife`
3020
+ */
3021
+ name?: string;
3022
+ /**
3023
+ * Output bundle formats. Defaults to `['es', 'umd']` for a single entry, or
3024
+ * `['es', 'cjs']` for multiple entries (`umd` and `iife` do not support
3025
+ * multiple entries).
3026
+ * @default ['es', 'umd']
3027
+ */
3028
+ formats?: LibraryFormats[];
3029
+ /**
3030
+ * The name of the package file output. The default file name is the name option
3031
+ * of the project package.json. It can also be defined as a function taking the
3032
+ * format as an argument.
3033
+ */
3034
+ fileName?: string | ((format: ModuleFormat, entryName: string) => string);
3035
+ /**
3036
+ * The name of the CSS file output if the library imports CSS. Defaults to the
3037
+ * same value as `build.lib.fileName` if it's set a string, otherwise it falls
3038
+ * back to the name option of the project package.json.
3039
+ */
3040
+ cssFileName?: string;
3041
+ }
3042
+ type LibraryFormats = "es" | "cjs" | "umd" | "iife";
3043
+ interface ModulePreloadOptions {
3044
+ /**
3045
+ * Whether to inject a module preload polyfill.
3046
+ * Note: does not apply to library mode.
3047
+ * @default true
3048
+ */
3049
+ polyfill?: boolean;
3050
+ /**
3051
+ * Resolve the list of dependencies to preload for a given dynamic import
3052
+ * @experimental
3053
+ */
3054
+ resolveDependencies?: ResolveModulePreloadDependenciesFn;
3055
+ }
3056
+ interface ResolvedModulePreloadOptions {
3057
+ polyfill: boolean;
3058
+ resolveDependencies?: ResolveModulePreloadDependenciesFn;
3059
+ }
3060
+ type ResolveModulePreloadDependenciesFn = (filename: string, deps: string[], context: {
3061
+ hostId: string;
3062
+ hostType: "html" | "js";
3063
+ }) => string[];
3064
+ interface ResolvedBuildEnvironmentOptions extends Required<Omit<BuildEnvironmentOptions, "polyfillModulePreload">> {
3065
+ modulePreload: false | ResolvedModulePreloadOptions;
3066
+ }
3067
+ interface ResolvedBuildOptions extends Required<Omit<BuildOptions, "polyfillModulePreload">> {
3068
+ modulePreload: false | ResolvedModulePreloadOptions;
3069
+ }
3070
+ /**
3071
+ * Bundles a single environment for production.
3072
+ * Returns a Promise containing the build result.
3073
+ */
3074
+ export declare function build(inlineConfig?: InlineConfig): Promise<RolldownOutput | RolldownOutput[] | RolldownWatcher>;
3075
+ type RenderBuiltAssetUrl = (filename: string, type: {
3076
+ type: "asset" | "public";
3077
+ hostId: string;
3078
+ hostType: "js" | "css" | "html";
3079
+ ssr: boolean;
3080
+ }) => string | {
3081
+ relative?: boolean;
3082
+ runtime?: string;
3083
+ } | undefined;
3084
+ export declare class BuildEnvironment extends BaseEnvironment {
3085
+ mode: "build";
3086
+ isBuilt: boolean;
3087
+ constructor(name: string, config: ResolvedConfig, setup?: {
3088
+ options?: EnvironmentOptions;
3089
+ });
3090
+ init(): Promise<void>;
3091
+ }
3092
+ interface ViteBuilder {
3093
+ environments: Record<string, BuildEnvironment>;
3094
+ config: ResolvedConfig;
3095
+ buildApp(): Promise<void>;
3096
+ build(environment: BuildEnvironment): Promise<RolldownOutput | RolldownOutput[] | RolldownWatcher>;
3097
+ runDevTools(): Promise<void>;
3098
+ }
3099
+ interface BuilderOptions {
3100
+ /**
3101
+ * Whether to share the config instance among environments to align with the behavior of dev server.
3102
+ *
3103
+ * @default false
3104
+ * @experimental
3105
+ */
3106
+ sharedConfigBuild?: boolean;
3107
+ /**
3108
+ * Whether to share the plugin instances among environments to align with the behavior of dev server.
3109
+ *
3110
+ * @default false
3111
+ * @experimental
3112
+ */
3113
+ sharedPlugins?: boolean;
3114
+ buildApp?: (builder: ViteBuilder) => Promise<void>;
3115
+ }
3116
+ type ResolvedBuilderOptions = Required<BuilderOptions>;
3117
+ /**
3118
+ * Creates a ViteBuilder to orchestrate building multiple environments.
3119
+ * @experimental
3120
+ */
3121
+ export declare function createBuilder(inlineConfig?: InlineConfig, useLegacyBuilder?: null | boolean): Promise<ViteBuilder>;
3122
+ type BuildAppHook = (this: MinimalPluginContextWithoutEnvironment, builder: ViteBuilder) => Promise<void>;
3123
+ //#endregion
3124
+ //#region src/node/idResolver.d.ts
3125
+ type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
3126
+ /**
3127
+ * Create an internal resolver to be used in special scenarios, e.g.
3128
+ * optimizer and handling css @imports
3129
+ */
3130
+ export declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
3131
+ //#endregion
3132
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.28_tsx@4.23.13_yaml@2.9.0/node_modules/postcss-load-config/src/index.d.ts
3133
+ type ConfigPlugin = Transformer | PostCSS.Plugin | Processor;
3134
+ interface Config {
3135
+ parser?: string | ProcessOptions['parser'] | false;
3136
+ stringifier?: string | ProcessOptions['stringifier'] | false;
3137
+ syntax?: string | ProcessOptions['syntax'] | false;
3138
+ map?: string | false;
3139
+ from?: string;
3140
+ to?: string;
3141
+ plugins?: Array<ConfigPlugin | false> | Record<string, object | false>;
3142
+ }
3143
+ //#endregion
3144
+ //#region src/node/plugins/css.d.ts
3145
+ interface CSSOptions {
3146
+ /**
3147
+ * Using lightningcss is an experimental option to handle CSS modules,
3148
+ * assets and imports via Lightning CSS. It requires to install it as a
3149
+ * peer dependency.
3150
+ *
3151
+ * @default 'postcss'
3152
+ * @experimental
3153
+ */
3154
+ transformer?: "postcss" | "lightningcss";
3155
+ /**
3156
+ * https://github.com/css-modules/postcss-modules
3157
+ */
3158
+ modules?: CSSModulesOptions | false;
3159
+ /**
3160
+ * Options for preprocessors.
3161
+ *
3162
+ * In addition to options specific to each processors, Vite supports `additionalData` option.
3163
+ * The `additionalData` option can be used to inject extra code for each style content.
3164
+ */
3165
+ preprocessorOptions?: {
3166
+ scss?: SassPreprocessorOptions;
3167
+ sass?: SassPreprocessorOptions;
3168
+ less?: LessPreprocessorOptions;
3169
+ styl?: StylusPreprocessorOptions;
3170
+ stylus?: StylusPreprocessorOptions;
3171
+ };
3172
+ /**
3173
+ * If this option is set, preprocessors will run in workers when possible.
3174
+ * `true` means the number of CPUs minus 1.
3175
+ *
3176
+ * @default true
3177
+ */
3178
+ preprocessorMaxWorkers?: number | true;
3179
+ postcss?: string | (PostCSS.ProcessOptions & {
3180
+ plugins?: PostCSS.AcceptedPlugin[];
3181
+ });
3182
+ /**
3183
+ * Enables css sourcemaps during dev
3184
+ * @default false
3185
+ * @experimental
3186
+ */
3187
+ devSourcemap?: boolean;
3188
+ /**
3189
+ * @experimental
3190
+ */
3191
+ lightningcss?: lightningcssOptions_LightningCSSOptions;
3192
+ }
3193
+ interface CSSModulesOptions {
3194
+ getJSON?: (cssFileName: string, json: Record<string, string>, outputFileName: string) => void;
3195
+ scopeBehaviour?: "global" | "local";
3196
+ globalModulePaths?: RegExp[];
3197
+ exportGlobals?: boolean;
3198
+ generateScopedName?: string | ((name: string, filename: string, css: string) => string);
3199
+ hashPrefix?: string;
3200
+ /**
3201
+ * default: undefined
3202
+ */
3203
+ localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly" | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
3204
+ }
3205
+ type ResolvedCSSOptions = Omit<CSSOptions, "lightningcss"> & Required<Pick<CSSOptions, "transformer" | "devSourcemap">> & {
3206
+ lightningcss?: lightningcssOptions_LightningCSSOptions;
3207
+ };
3208
+ interface PreprocessCSSResult {
3209
+ code: string;
3210
+ map?: SourceMapInput;
3211
+ modules?: Record<string, string>;
3212
+ deps?: Set<string>;
3213
+ }
3214
+ /**
3215
+ * @experimental
3216
+ */
3217
+ export declare function preprocessCSS(code: string, filename: string, config: ResolvedConfig): Promise<PreprocessCSSResult>;
3218
+ export declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
3219
+ type PreprocessorAdditionalDataResult = string | {
3220
+ content: string;
3221
+ map?: ExistingRawSourceMap;
3222
+ };
3223
+ type PreprocessorAdditionalData = string | ((source: string, filename: string) => PreprocessorAdditionalDataResult | Promise<PreprocessorAdditionalDataResult>);
3224
+ type SassPreprocessorOptions = {
3225
+ additionalData?: PreprocessorAdditionalData;
3226
+ } & SassModernPreprocessBaseOptions;
3227
+ type LessPreprocessorOptions = {
3228
+ additionalData?: PreprocessorAdditionalData;
3229
+ } & LessPreprocessorBaseOptions;
3230
+ type StylusPreprocessorOptions = {
3231
+ additionalData?: PreprocessorAdditionalData;
3232
+ } & StylusPreprocessorBaseOptions;
3233
+ //#endregion
3234
+ //#region src/node/plugins/esbuild.d.ts
3235
+ interface ESBuildOptions extends esbuildOptions_EsbuildTransformOptions {
3236
+ include?: string | RegExp | ReadonlyArray<string | RegExp>;
3237
+ exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3238
+ jsxInject?: string;
3239
+ /**
3240
+ * This option is not respected. Use `build.minify` instead.
3241
+ */
3242
+ minify?: never;
3243
+ }
3244
+ type ESBuildTransformResult = Omit<EsbuildTransformResult, "map"> & {
3245
+ map: SourceMap;
3246
+ };
3247
+ export declare function transformWithEsbuild(code: string, filename: string, options?: esbuildOptions_EsbuildTransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher, ignoreEsbuildWarning?: boolean): Promise<ESBuildTransformResult>;
3248
+ //#endregion
3249
+ //#region src/node/plugins/json.d.ts
3250
+ interface JsonOptions {
3251
+ /**
3252
+ * Generate a named export for every property of the JSON object
3253
+ * @default true
3254
+ */
3255
+ namedExports?: boolean;
3256
+ /**
3257
+ * Generate performant output as JSON.parse("stringified").
3258
+ *
3259
+ * When set to 'auto', the data will be stringified only if the data is bigger than 10kB.
3260
+ * @default 'auto'
3261
+ */
3262
+ stringify?: boolean | "auto";
3263
+ }
3264
+ //#endregion
3265
+ //#region src/node/plugins/oxc.d.ts
3266
+ interface OxcOptions extends Omit<rolldown_utils_TransformOptions, "cwd" | "sourceType" | "lang" | "sourcemap" | "helpers" | "inject" | "tsconfig" | "inputMap"> {
3267
+ include?: string | RegExp | ReadonlyArray<string | RegExp>;
3268
+ exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3269
+ jsxInject?: string;
3270
+ jsxRefreshInclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3271
+ jsxRefreshExclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3272
+ }
3273
+ export declare function transformWithOxc(code: string, filename: string, options?: rolldown_utils_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<Omit<rolldown_utils_TransformResult, "errors">>;
3274
+ //#endregion
3275
+ //#region src/node/ssr/index.d.ts
3276
+ type SSRTarget = "node" | "webworker";
3277
+ type SsrDepOptimizationConfig = DepOptimizationConfig;
3278
+ interface SSROptions {
3279
+ noExternal?: string | RegExp | (string | RegExp)[] | true;
3280
+ external?: string[] | true;
3281
+ /**
3282
+ * Define the target for the ssr build. The browser field in package.json
3283
+ * is ignored for node but used if webworker is the target
3284
+ * This option will be removed in a future major version
3285
+ * @default 'node'
3286
+ */
3287
+ target?: SSRTarget;
3288
+ /**
3289
+ * Control over which dependencies are optimized during SSR and esbuild options
3290
+ * During build:
3291
+ * no external CJS dependencies are optimized by default
3292
+ * During dev:
3293
+ * explicit no external CJS dependencies are optimized by default
3294
+ * @experimental
3295
+ */
3296
+ optimizeDeps?: SsrDepOptimizationConfig;
3297
+ resolve?: {
3298
+ /**
3299
+ * Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
3300
+ *
3301
+ * Use this to override the default ssr conditions for the ssr build.
3302
+ *
3303
+ * @default rootConfig.resolve.conditions
3304
+ */
3305
+ conditions?: string[];
3306
+ /**
3307
+ * Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
3308
+ *
3309
+ * @default ['node', 'module-sync']
3310
+ */
3311
+ externalConditions?: string[];
3312
+ mainFields?: string[];
3313
+ };
3314
+ }
3315
+ interface ResolvedSSROptions extends SSROptions {
3316
+ target: SSRTarget;
3317
+ optimizeDeps: SsrDepOptimizationConfig;
3318
+ }
3319
+ //#endregion
3320
+ //#region src/node/config.d.ts
3321
+ interface ConfigEnv {
3322
+ /**
3323
+ * 'serve': during dev (`vite` command)
3324
+ * 'build': when building for production (`vite build` command)
3325
+ */
3326
+ command: "build" | "serve";
3327
+ mode: string;
3328
+ isSsrBuild?: boolean;
3329
+ isPreview?: boolean;
3330
+ }
3331
+ /**
3332
+ * spa: include SPA fallback middleware and configure sirv with `single: true` in preview
3333
+ *
3334
+ * mpa: only include non-SPA HTML middlewares
3335
+ *
3336
+ * custom: don't include HTML middlewares
3337
+ */
3338
+ type AppType = "spa" | "mpa" | "custom";
3339
+ type UserConfigFnObject = (env: ConfigEnv) => UserConfig;
3340
+ type UserConfigFnPromise = (env: ConfigEnv) => Promise<UserConfig>;
3341
+ type UserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>;
3342
+ type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
3343
+ /**
3344
+ * Type helper to make it easier to use vite.config.ts
3345
+ * accepts a direct {@link UserConfig} object, or a function that returns it.
3346
+ * The function receives a {@link ConfigEnv} object.
3347
+ */
3348
+ export declare function defineConfig(config: UserConfig): UserConfig;
3349
+ export declare function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;
3350
+ export declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
3351
+ export declare function defineConfig(config: UserConfigFnPromise): UserConfigFnPromise;
3352
+ export declare function defineConfig(config: UserConfigFn): UserConfigFn;
3353
+ export declare function defineConfig(config: UserConfigExport): UserConfigExport;
3354
+ interface CreateDevEnvironmentContext {
3355
+ ws: WebSocketServer;
3356
+ }
3357
+ interface DevEnvironmentOptions {
3358
+ /**
3359
+ * Files to be pre-transformed. Supports glob patterns.
3360
+ */
3361
+ warmup?: string[];
3362
+ /**
3363
+ * Pre-transform known direct imports
3364
+ * defaults to true for the client environment, false for the rest
3365
+ */
3366
+ preTransformRequests?: boolean;
3367
+ /**
3368
+ * Enables sourcemaps during dev
3369
+ * @default { js: true }
3370
+ * @experimental
3371
+ */
3372
+ sourcemap?: boolean | {
3373
+ js?: boolean;
3374
+ css?: boolean;
3375
+ };
3376
+ /**
3377
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
3378
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
3379
+ *
3380
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
3381
+ * disable this behavior, or, for full control, a function that takes the source path and
3382
+ * sourcemap path and returns whether to ignore the source path.
3383
+ */
3384
+ sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
3385
+ /**
3386
+ * create the Dev Environment instance
3387
+ */
3388
+ createEnvironment?: (name: string, config: ResolvedConfig, context: CreateDevEnvironmentContext) => Promise<DevEnvironment> | DevEnvironment;
3389
+ /**
3390
+ * For environments that support a full-reload, like the client, we can short-circuit when
3391
+ * restarting the server throwing early to stop processing current files. We avoided this for
3392
+ * SSR requests. Maybe this is no longer needed.
3393
+ * @experimental
3394
+ */
3395
+ recoverable?: boolean;
3396
+ /**
3397
+ * For environments associated with a module runner.
3398
+ * By default, it is false for the client environment and true for non-client environments.
3399
+ * This option can also be used instead of the removed config.experimental.skipSsrTransform.
3400
+ */
3401
+ moduleRunnerTransform?: boolean;
3402
+ }
3403
+ type ResolvedDevEnvironmentOptions = Omit<Required<DevEnvironmentOptions>, "sourcemapIgnoreList"> & {
3404
+ sourcemapIgnoreList: Exclude<DevEnvironmentOptions["sourcemapIgnoreList"], false | undefined>;
3405
+ };
3406
+ type AllResolveOptions = ResolveOptions & {
3407
+ alias?: AliasOptions;
3408
+ };
3409
+ interface SharedEnvironmentOptions {
3410
+ /**
3411
+ * Entry points of the application.
3412
+ *
3413
+ * Paths are resolved relative to the project root.
3414
+ */
3415
+ input?: InputOption;
3416
+ /**
3417
+ * Define global variable replacements.
3418
+ * Entries will be defined on `window` during dev and replaced during build.
3419
+ */
3420
+ define?: Record<string, any>;
3421
+ /**
3422
+ * Configure resolver
3423
+ */
3424
+ resolve?: EnvironmentResolveOptions;
3425
+ /**
3426
+ * Define if this environment is used for Server-Side Rendering
3427
+ * @default 'server' if it isn't the client environment
3428
+ */
3429
+ consumer?: "client" | "server";
3430
+ /**
3431
+ * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
3432
+ * Otherwise, it is statically replaced as an empty object.
3433
+ */
3434
+ keepProcessEnv?: boolean;
3435
+ /**
3436
+ * Optimize deps config
3437
+ */
3438
+ optimizeDeps?: DepOptimizationOptions;
3439
+ /**
3440
+ * Whether this environment produces a bundled output.
3441
+ *
3442
+ * During `build`, this defaults to `true` for every environment.
3443
+ * During `serve`, this defaults to `true` only for the client environment
3444
+ * when `experimental.bundledDev` is enabled, and `false` otherwise.
3445
+ * Setting this explicitly on an environment always overrides the default.
3446
+ *
3447
+ * @experimental
3448
+ */
3449
+ isBundled?: boolean;
3450
+ }
3451
+ interface EnvironmentOptions extends SharedEnvironmentOptions {
3452
+ /**
3453
+ * Dev specific options
3454
+ */
3455
+ dev?: DevEnvironmentOptions;
3456
+ /**
3457
+ * Build specific options
3458
+ */
3459
+ build?: BuildEnvironmentOptions;
3460
+ }
3461
+ type ResolvedResolveOptions = Required<ResolveOptions>;
3462
+ type ResolvedEnvironmentOptions = {
3463
+ input?: InputOption;
3464
+ define?: Record<string, any>;
3465
+ resolve: ResolvedResolveOptions;
3466
+ consumer: "client" | "server";
3467
+ keepProcessEnv?: boolean;
3468
+ optimizeDeps: DepOptimizationOptions;
3469
+ dev: ResolvedDevEnvironmentOptions;
3470
+ build: ResolvedBuildEnvironmentOptions;
3471
+ isBundled: boolean;
3472
+ plugins: readonly Plugin[];
3473
+ };
3474
+ type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve" | "keepProcessEnv"> & {
3475
+ resolve?: AllResolveOptions;
3476
+ };
3477
+ interface UserConfig extends DefaultEnvironmentOptions {
3478
+ /**
3479
+ * Project root directory. Can be an absolute path, or a path relative from
3480
+ * the location of the config file itself.
3481
+ * @default process.cwd()
3482
+ */
3483
+ root?: string;
3484
+ /**
3485
+ * Path to the TypeScript configuration file. Relative paths are resolved
3486
+ * from the project root.
3487
+ */
3488
+ tsconfig?: string;
3489
+ /**
3490
+ * Base public path when served in development or production.
3491
+ * @default '/'
3492
+ */
3493
+ base?: string;
3494
+ /**
3495
+ * Directory to serve as plain static assets. Files in this directory are
3496
+ * served and copied to build dist dir as-is without transform. The value
3497
+ * can be either an absolute file system path or a path relative to project root.
3498
+ *
3499
+ * Set to `false` or an empty string to disable copied static assets to build dist dir.
3500
+ * @default 'public'
3501
+ */
3502
+ publicDir?: string | false;
3503
+ /**
3504
+ * Directory to save cache files. Files in this directory are pre-bundled
3505
+ * deps or some other cache files that generated by vite, which can improve
3506
+ * the performance. You can use `--force` flag or manually delete the directory
3507
+ * to regenerate the cache files. The value can be either an absolute file
3508
+ * system path or a path relative to project root.
3509
+ * Default to `.vite` when neither a `package.json` nor a `node_modules` directory is detected.
3510
+ * @default 'node_modules/.vite'
3511
+ */
3512
+ cacheDir?: string;
3513
+ /**
3514
+ * Explicitly set a mode to run in. This will override the default mode for
3515
+ * each command, and can be overridden by the command line --mode option.
3516
+ */
3517
+ mode?: string;
3518
+ /**
3519
+ * Array of vite plugins to use.
3520
+ */
3521
+ plugins?: PluginOption[];
3522
+ /**
3523
+ * HTML related options
3524
+ */
3525
+ html?: HTMLOptions;
3526
+ /**
3527
+ * CSS related options (preprocessors and CSS modules)
3528
+ */
3529
+ css?: CSSOptions;
3530
+ /**
3531
+ * JSON loading options
3532
+ */
3533
+ json?: JsonOptions;
3534
+ /**
3535
+ * Transform options to pass to esbuild.
3536
+ * Or set to `false` to disable esbuild.
3537
+ *
3538
+ * @deprecated Use `oxc` option instead.
3539
+ */
3540
+ esbuild?: ESBuildOptions | false;
3541
+ /**
3542
+ * Transform options to pass to Oxc.
3543
+ * Or set to `false` to disable Oxc.
3544
+ */
3545
+ oxc?: OxcOptions | false;
3546
+ /**
3547
+ * Specify additional picomatch patterns to be treated as static assets.
3548
+ */
3549
+ assetsInclude?: string | RegExp | (string | RegExp)[];
3550
+ /**
3551
+ * Builder specific options
3552
+ * @experimental
3553
+ */
3554
+ builder?: BuilderOptions;
3555
+ /**
3556
+ * Server specific options, e.g. host, port, https...
3557
+ */
3558
+ server?: ServerOptions$1;
3559
+ /**
3560
+ * Preview specific options, e.g. host, port, https...
3561
+ */
3562
+ preview?: PreviewOptions;
3563
+ /**
3564
+ * Experimental features
3565
+ *
3566
+ * Features under this field could change in the future and might NOT follow semver.
3567
+ * Please be careful and always pin Vite's version when using them.
3568
+ * @experimental
3569
+ */
3570
+ experimental?: ExperimentalOptions;
3571
+ /**
3572
+ * Options to opt-in to future behavior
3573
+ */
3574
+ future?: FutureOptions | "warn";
3575
+ /**
3576
+ * Legacy options
3577
+ *
3578
+ * Features under this field only follow semver for patches, they could be removed in a
3579
+ * future minor version. Please always pin Vite's version to a minor when using them.
3580
+ */
3581
+ legacy?: LegacyOptions;
3582
+ /**
3583
+ * Log level.
3584
+ * @default 'info'
3585
+ */
3586
+ logLevel?: LogLevel;
3587
+ /**
3588
+ * Custom logger.
3589
+ */
3590
+ customLogger?: Logger;
3591
+ /**
3592
+ * @default true
3593
+ */
3594
+ clearScreen?: boolean;
3595
+ /**
3596
+ * Environment files directory. Can be an absolute path, or a path relative from
3597
+ * root.
3598
+ * @default root
3599
+ */
3600
+ envDir?: string | false;
3601
+ /**
3602
+ * Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
3603
+ * @default 'VITE_'
3604
+ */
3605
+ envPrefix?: string | string[];
3606
+ /**
3607
+ * Worker bundle options
3608
+ */
3609
+ worker?: {
3610
+ /**
3611
+ * Output format for worker bundle
3612
+ * @default 'iife'
3613
+ */
3614
+ format?: "es" | "iife";
3615
+ /**
3616
+ * Vite plugins that apply to worker bundle. The plugins returned by this function
3617
+ * should be new instances every time it is called, because they are used for each
3618
+ * rolldown worker bundling process.
3619
+ */
3620
+ plugins?: () => PluginOption[];
3621
+ /**
3622
+ * Alias to `rolldownOptions`.
3623
+ * @deprecated Use `rolldownOptions` instead.
3624
+ */
3625
+ rollupOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3626
+ /**
3627
+ * Rolldown options to build worker bundle
3628
+ */
3629
+ rolldownOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3630
+ };
3631
+ /**
3632
+ * Dep optimization options
3633
+ */
3634
+ optimizeDeps?: DepOptimizationOptions;
3635
+ /**
3636
+ * SSR specific options
3637
+ * We could make SSROptions be a EnvironmentOptions if we can abstract
3638
+ * external/noExternal for environments in general.
3639
+ */
3640
+ ssr?: SSROptions;
3641
+ /**
3642
+ * Environment overrides
3643
+ */
3644
+ environments?: Record<string, EnvironmentOptions>;
3645
+ /**
3646
+ * Whether your application is a Single Page Application (SPA),
3647
+ * a Multi-Page Application (MPA), or Custom Application (SSR
3648
+ * and frameworks with custom HTML handling)
3649
+ * @default 'spa'
3650
+ */
3651
+ appType?: AppType;
3652
+ /**
3653
+ * Enable devtools integration. Ensure that `@vitejs/devtools` is installed as a dependency.
3654
+ * @experimental
3655
+ * @default false
3656
+ */
3657
+ devtools?: boolean | DevToolsConfig;
3658
+ }
3659
+ interface HTMLOptions {
3660
+ /**
3661
+ * A nonce value placeholder that will be used when generating script/style tags.
3662
+ *
3663
+ * Make sure that this placeholder will be replaced with a unique value for each request by the server.
3664
+ */
3665
+ cspNonce?: string;
3666
+ /**
3667
+ * Define additional HTML elements and attributes to be treated as asset sources.
3668
+ * This extends the built-in list that includes standard elements like `<img src>`, `<video src>`, etc.
3669
+ *
3670
+ * @example
3671
+ * ```ts
3672
+ * html: {
3673
+ * additionalAssetSources: {
3674
+ * // Custom web component
3675
+ * 'html-import': { srcAttributes: ['src'] },
3676
+ * // Add data-* attributes to existing element
3677
+ * 'img': { srcAttributes: ['data-src-dark', 'data-src-light'] }
3678
+ * }
3679
+ * }
3680
+ * ```
3681
+ */
3682
+ additionalAssetSources?: Record<string, HtmlAssetSource>;
3683
+ }
3684
+ interface FutureOptions {
3685
+ removePluginHookHandleHotUpdate?: "warn";
3686
+ removePluginHookSsrArgument?: "warn";
3687
+ removeServerModuleGraph?: "warn";
3688
+ removeServerReloadModule?: "warn";
3689
+ removeServerPluginContainer?: "warn";
3690
+ removeServerHot?: "warn";
3691
+ removeServerTransformRequest?: "warn";
3692
+ removeServerWarmupRequest?: "warn";
3693
+ removeSsrLoadModule?: "warn";
3694
+ }
3695
+ interface ExperimentalOptions {
3696
+ /**
3697
+ * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
3698
+ *
3699
+ * @experimental
3700
+ * @default false
3701
+ */
3702
+ importGlobRestoreExtension?: boolean;
3703
+ /**
3704
+ * Allow finegrain control over assets and public files paths
3705
+ *
3706
+ * @experimental
3707
+ */
3708
+ renderBuiltUrl?: RenderBuiltAssetUrl;
3709
+ /**
3710
+ * Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
3711
+ *
3712
+ * @experimental
3713
+ * @default false
3714
+ */
3715
+ hmrPartialAccept?: boolean;
3716
+ /**
3717
+ * Enable full bundle mode during `serve`.
3718
+ *
3719
+ * This seeds the default for the client environment's `isBundled` option.
3720
+ * Other environments default to `false` during `serve`. Any environment
3721
+ * can override its `isBundled` value via `environments[name].isBundled`.
3722
+ *
3723
+ * This is highly experimental.
3724
+ *
3725
+ * HMR semantics under full bundle mode differ from the middleware-based dev server
3726
+ * in two ways (boundaries are computed in the browser from runtime state, not
3727
+ * statically on the server):
3728
+ *
3729
+ * - Acceptance counts only when it executed: an `import.meta.hot.accept()` that
3730
+ * is in a dead branch does not suppress the update and falls back to a full reload.
3731
+ * - `hot.invalidate()` is handled fully client-side.
3732
+ *
3733
+ * @experimental
3734
+ * @default false
3735
+ */
3736
+ bundledDev?: boolean;
3737
+ }
3738
+ interface LegacyOptions {
3739
+ /**
3740
+ * In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
3741
+ * that could be exploited by a malicious web page.
3742
+ *
3743
+ * In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
3744
+ * But this may break some plugins and frameworks that connects to the WebSocket server
3745
+ * on their own. Enabling this option will make Vite skip the token check.
3746
+ *
3747
+ * **We do not recommend enabling this option unless you are sure that you are fine with
3748
+ * that security weakness.**
3749
+ */
3750
+ skipWebSocketTokenCheck?: boolean;
3751
+ /**
3752
+ * Opt-in to the pre-Vite 8 CJS interop behavior, which was inconsistent.
3753
+ *
3754
+ * In pre-Vite 8 versions, Vite had inconsistent CJS interop behavior. This was due to
3755
+ * the different behavior of esbuild and the Rollup commonjs plugin.
3756
+ * Vite 8+ uses Rolldown for both the dependency optimization in dev and the production build,
3757
+ * which aligns the behavior to esbuild.
3758
+ *
3759
+ * See the Vite 8 migration guide for more details.
3760
+ */
3761
+ inconsistentCjsInterop?: boolean;
3762
+ }
3763
+ interface ResolvedWorkerOptions {
3764
+ format: "es" | "iife";
3765
+ plugins: (bundleChain: string[]) => Promise<ResolvedConfig>;
3766
+ /**
3767
+ * @deprecated Use `rolldownOptions` instead.
3768
+ */
3769
+ rollupOptions: RolldownOptions;
3770
+ rolldownOptions: RolldownOptions;
3771
+ }
3772
+ interface InlineConfig extends UserConfig {
3773
+ configFile?: string | false;
3774
+ /** @experimental */
3775
+ configLoader?: "bundle" | "runner" | "native";
3776
+ /** @deprecated */
3777
+ envFile?: false;
3778
+ forceOptimizeDeps?: boolean;
3779
+ }
3780
+ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "json" | "assetsInclude" | "optimizeDeps" | "worker" | "build" | "dev" | "environments" | "experimental" | "future" | "server" | "preview" | "devtools"> & {
3781
+ configFile: string | undefined;
3782
+ configFileDependencies: string[];
3783
+ inlineConfig: InlineConfig;
3784
+ root: string;
3785
+ base: string;
3786
+ publicDir: string;
3787
+ cacheDir: string;
3788
+ command: "build" | "serve";
3789
+ mode: string;
3790
+ isWorker: boolean;
3791
+ isProduction: boolean;
3792
+ envDir: string | false;
3793
+ env: Record<string, any>;
3794
+ resolve: Required<ResolveOptions> & {
3795
+ alias: Alias[];
3796
+ };
3797
+ plugins: readonly Plugin[];
3798
+ css: ResolvedCSSOptions;
3799
+ json: Required<JsonOptions>;
3800
+ /** @deprecated Use `oxc` option instead. */
3801
+ esbuild: ESBuildOptions | false;
3802
+ oxc: OxcOptions | false;
3803
+ server: ResolvedServerOptions;
3804
+ dev: ResolvedDevEnvironmentOptions;
3805
+ /** @experimental */
3806
+ builder: ResolvedBuilderOptions | undefined;
3807
+ build: ResolvedBuildOptions;
3808
+ devtools: ResolvedDevToolsConfig | false;
3809
+ preview: ResolvedPreviewOptions;
3810
+ ssr: ResolvedSSROptions;
3811
+ assetsInclude: (file: string) => boolean;
3812
+ rawAssetsInclude: (string | RegExp)[];
3813
+ logger: Logger;
3814
+ /**
3815
+ * Create an internal resolver to be used in special scenarios, e.g.
3816
+ * optimizer & handling css `@imports`.
3817
+ *
3818
+ * This API is deprecated. It only works for the client and ssr
3819
+ * environments. The `aliasOnly` option is also not being used anymore.
3820
+ * Plugins should move to `createIdResolver(environment.config)` instead.
3821
+ *
3822
+ * @deprecated Use `createIdResolver` from `vite` instead.
3823
+ */
3824
+ createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
3825
+ optimizeDeps: DepOptimizationOptions;
3826
+ worker: ResolvedWorkerOptions;
3827
+ appType: AppType;
3828
+ experimental: RequiredExceptFor<ExperimentalOptions, "renderBuiltUrl">;
3829
+ future: FutureOptions | undefined;
3830
+ environments: Record<string, ResolvedEnvironmentOptions>;
3831
+ /**
3832
+ * The token to connect to the WebSocket server from browsers.
3833
+ *
3834
+ * We recommend using `import.meta.hot` rather than connecting
3835
+ * to the WebSocket server directly.
3836
+ * If you have a usecase that requires connecting to the WebSocket
3837
+ * server, please create an issue so that we can discuss.
3838
+ *
3839
+ * @deprecated
3840
+ */
3841
+ webSocketToken: string;
3842
+ } & PluginHookUtils> {}
3843
+ interface PluginHookUtils {
3844
+ getSortedPlugins: <K extends keyof Plugin>(hookName: K) => PluginWithRequiredHook<K>[];
3845
+ getSortedPluginHooks: <K extends keyof Plugin>(hookName: K) => NonNullable<HookHandler<Plugin[K]>>[];
3846
+ }
3847
+ type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
3848
+ export 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>;
3849
+ export declare function sortUserPlugins(plugins: (Plugin | Plugin[])[] | undefined): [Plugin[], Plugin[], Plugin[]];
3850
+ export declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, configRoot?: string, logLevel?: LogLevel, customLogger?: Logger, configLoader?: "bundle" | "runner" | "native"): Promise<{
3851
+ path: string;
3852
+ config: UserConfig;
3853
+ dependencies: string[];
3854
+ } | null>;
3855
+ //#endregion
3856
+ //#region src/node/server/middlewares/error.d.ts
3857
+ export declare function buildErrorMessage(err: RollupError, args?: string[], includeStack?: boolean): string;
3858
+ //#endregion
3859
+ //#region src/node/ssr/runtime/serverModuleRunner.d.ts
3860
+ /**
3861
+ * @experimental
3862
+ */
3863
+ interface ServerModuleRunnerOptions extends Omit<ModuleRunnerOptions, "root" | "fetchModule" | "hmr" | "transport"> {
3864
+ /**
3865
+ * Disable HMR or configure HMR logger.
3866
+ */
3867
+ hmr?: false | {
3868
+ logger?: ModuleRunnerHmr["logger"];
3869
+ };
3870
+ /**
3871
+ * Provide a custom module evaluator. This controls how the code is executed.
3872
+ */
3873
+ evaluator?: ModuleEvaluator;
3874
+ }
3875
+ export declare const createServerModuleRunnerTransport: (options: {
3876
+ channel: NormalizedServerHotChannel;
3877
+ }) => ModuleRunnerTransport;
3878
+ /**
3879
+ * Create an instance of the Vite SSR runtime that support HMR.
3880
+ * @experimental
3881
+ */
3882
+ export declare function createServerModuleRunner(environment: DevEnvironment, options?: ServerModuleRunnerOptions): ModuleRunner;
3883
+ //#endregion
3884
+ //#region src/node/server/environments/runnableEnvironment.d.ts
3885
+ export declare function createRunnableDevEnvironment(name: string, config: ResolvedConfig, context?: RunnableDevEnvironmentContext): RunnableDevEnvironment;
3886
+ interface RunnableDevEnvironmentContext extends Omit<DevEnvironmentContext, "hot"> {
3887
+ runner?: (environment: RunnableDevEnvironment, options?: ServerModuleRunnerOptions) => ModuleRunner;
3888
+ runnerOptions?: ServerModuleRunnerOptions;
3889
+ hot?: boolean;
3890
+ }
3891
+ export declare function isRunnableDevEnvironment(environment: Environment): environment is RunnableDevEnvironment;
3892
+ declare class RunnableDevEnvironment extends DevEnvironment {
3893
+ private _runner;
3894
+ private _runnerFactory;
3895
+ private _runnerOptions;
3896
+ constructor(name: string, config: ResolvedConfig, context: RunnableDevEnvironmentContext);
3897
+ get runner(): ModuleRunner;
3898
+ override close(): Promise<void>;
3899
+ }
3900
+ //#endregion
3901
+ //#region src/node/server/environments/fetchableEnvironments.d.ts
3902
+ interface FetchableDevEnvironmentContext extends DevEnvironmentContext {
3903
+ handleRequest(request: Request): Promise<Response> | Response;
3904
+ }
3905
+ export declare function createFetchableDevEnvironment(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext): FetchableDevEnvironment;
3906
+ export declare function isFetchableDevEnvironment(environment: Environment): environment is FetchableDevEnvironment;
3907
+ declare class FetchableDevEnvironment extends DevEnvironment {
3908
+ private _handleRequest;
3909
+ constructor(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext);
3910
+ dispatchFetch(request: Request): Promise<Response>;
3911
+ }
3912
+ //#endregion
3913
+ //#region src/node/ssr/runnerImport.d.ts
3914
+ interface RunnerImportResult<T> {
3915
+ module: T;
3916
+ dependencies: string[];
3917
+ }
3918
+ /**
3919
+ * Import any file using the default Vite environment.
3920
+ * @experimental
3921
+ */
3922
+ export declare function runnerImport<T>(moduleId: string, inlineConfig?: InlineConfig): Promise<RunnerImportResult<T>>;
3923
+ //#endregion
3924
+ //#region src/node/ssr/fetchModule.d.ts
3925
+ interface FetchModuleOptions {
3926
+ cached?: boolean;
3927
+ inlineSourceMap?: boolean;
3928
+ startOffset?: number;
3929
+ }
3930
+ /**
3931
+ * Fetch module information for Vite module runner.
3932
+ * @experimental
3933
+ */
3934
+ export declare function fetchModule(environment: DevEnvironment, url: string, importer?: string, options?: FetchModuleOptions): Promise<moduleRunner_FetchResult>;
3935
+ //#endregion
3936
+ //#region src/node/ssr/ssrTransform.d.ts
3937
+ interface ModuleRunnerTransformOptions {
3938
+ json?: {
3939
+ stringify?: boolean;
3940
+ };
3941
+ }
3942
+ declare function ssrTransform(code: string, inMap: SourceMap | {
3943
+ mappings: "";
3944
+ } | null, url: string, originalCode: string, options?: ModuleRunnerTransformOptions): Promise<TransformResult | null>;
3945
+ //#endregion
3946
+ //#region src/node/constants.d.ts
3947
+ declare const VERSION: string;
3948
+ declare const DEFAULT_CLIENT_MAIN_FIELDS: readonly string[];
3949
+ declare const DEFAULT_SERVER_MAIN_FIELDS: readonly string[];
3950
+ declare const DEFAULT_CLIENT_CONDITIONS: readonly string[];
3951
+ declare const DEFAULT_SERVER_CONDITIONS: readonly string[];
3952
+ declare const DEFAULT_EXTERNAL_CONDITIONS: readonly string[];
3953
+ export declare const defaultAllowedOrigins: RegExp;
3954
+ //#endregion
3955
+ //#region src/node/utils.d.ts
3956
+ /**
3957
+ * Inlined to keep `@rollup/pluginutils` in devDependencies
3958
+ */
3959
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
3960
+ export declare const createFilter: (include?: FilterPattern, exclude?: FilterPattern, options?: {
3961
+ resolve?: string | false | null;
3962
+ }) => (id: unknown) => boolean;
3963
+ export declare const rollupVersion = "4.23.0";
3964
+ export declare function normalizePath(id: string): string;
3965
+ export declare const isCSSRequest: (request: string) => boolean;
3966
+ export declare function mergeConfig<D extends Record<string, any>, O extends Record<string, any>>(defaults: D extends Function ? never : D, overrides: O extends Function ? never : O, isRoot?: boolean): Record<string, any>;
3967
+ export declare function mergeAlias(a?: AliasOptions, b?: AliasOptions): AliasOptions | undefined;
3968
+ //#endregion
3969
+ //#region src/node/server/send.d.ts
3970
+ interface SendOptions {
3971
+ etag?: string;
3972
+ cacheControl?: string;
3973
+ headers?: OutgoingHttpHeaders;
3974
+ map?: SourceMap | {
3975
+ mappings: "";
3976
+ } | null;
3977
+ }
3978
+ export declare function send(req: http.IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, options: SendOptions): void;
3979
+ //#endregion
3980
+ //#region src/node/server/searchRoot.d.ts
3981
+ /**
3982
+ * Search up for the nearest workspace root
3983
+ */
3984
+ export declare function searchForWorkspaceRoot(current: string, root?: string): string;
3985
+ //#endregion
3986
+ //#region src/node/server/middlewares/static.d.ts
3987
+ /**
3988
+ * Check if the url is allowed to be served, via the `server.fs` config.
3989
+ * @deprecated Use the `isFileLoadingAllowed` function instead.
3990
+ */
3991
+ export declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
3992
+ export declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
3993
+ /**
3994
+ * Warning: parameters are not validated, only works with normalized absolute paths
3995
+ */
3996
+ export declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
3997
+ //#endregion
3998
+ //#region src/node/env.d.ts
3999
+ /**
4000
+ * Load `.env` files within the `envDir` and merge them with the matching
4001
+ * variables already present in `process.env`.
4002
+ */
4003
+ export declare function loadEnv(mode: string, envDir: string | false, prefixes?: string | string[]): Record<string, string>;
4004
+ export declare function resolveEnvPrefix({ envPrefix }: UserConfig): string[];
4005
+ //#endregion
4006
+ //#region src/node/plugins/manifest.d.ts
4007
+ type Manifest = Record<string, ManifestChunk>;
4008
+ interface ManifestChunk {
4009
+ /**
4010
+ * The input file name of this chunk / asset if known
4011
+ */
4012
+ src?: string;
4013
+ /**
4014
+ * The output file name of this chunk / asset
4015
+ */
4016
+ file: string;
4017
+ /**
4018
+ * The list of CSS files imported by this chunk
4019
+ */
4020
+ css?: string[];
4021
+ /**
4022
+ * The list of asset files imported by this chunk, excluding CSS files
4023
+ */
4024
+ assets?: string[];
4025
+ /**
4026
+ * Whether this chunk or asset is an entry point
4027
+ */
4028
+ isEntry?: boolean;
4029
+ /**
4030
+ * The name of this chunk / asset if known
4031
+ */
4032
+ name?: string;
4033
+ /**
4034
+ * Whether this chunk is a dynamic entry point
4035
+ *
4036
+ * This field is only present in JS chunks.
4037
+ */
4038
+ isDynamicEntry?: boolean;
4039
+ /**
4040
+ * The list of statically imported chunks by this chunk
4041
+ *
4042
+ * The values are the keys of the manifest. This field is only present in JS chunks.
4043
+ */
4044
+ imports?: string[];
4045
+ /**
4046
+ * The list of dynamically imported chunks by this chunk
4047
+ *
4048
+ * The values are the keys of the manifest. This field is only present in JS chunks.
4049
+ */
4050
+ dynamicImports?: string[];
4051
+ }
4052
+ //#endregion
4053
+ //#region src/node/index.d.ts
4054
+ /** @deprecated - use `parseSync` instead */
4055
+ export declare const parseAst: typeof parseAst$1;
4056
+ /** @deprecated - use `parse` instead */
4057
+ export declare const parseAstAsync: typeof parseAstAsync$1;
4058
+ export declare const esbuildVersion = "0.25.0";
4059
+ //#endregion
4060
+ export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESTree, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlAssetSource, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type KnownQueryTypeMap, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, type MinifyOptions, type MinifyResult, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type OxcOptions, type ParseResult, type ParserOptions, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type Config as PostcssUserConfig, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedDevToolsConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type Rolldown, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type ServerWatchOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, Visitor, type VisitorObject, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, type WsOptions, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, esmExternalRequirePlugin, minify, minifySync, ssrTransform as moduleRunnerTransform, parse, parseSync, rolldownVersion, VERSION as version, withFilter };