vite 7.0.5 → 7.1.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.
- package/LICENSE.md +53 -79
- package/bin/openChrome.js +68 -0
- package/dist/client/client.mjs +111 -22
- package/dist/node/chunks/{dep-Ctugieod.js → dep-BDCsDwBr.js} +2 -1
- package/dist/node/chunks/{dep-BO5GbxpL.js → dep-BeiFehmI.js} +14 -14
- package/dist/node/chunks/{dep-DPmIzJpk.js → dep-C3Gi22Hg.js} +2 -2
- package/dist/node/chunks/{dep-EUZWNfwr.js → dep-CVQJZ3QI.js} +2 -2
- package/dist/node/chunks/{dep-Bg4HVnP5.js → dep-CYKWp2mZ.js} +2473 -2256
- package/dist/node/chunks/{dep-Dunozww-.js → dep-DQ3EcyiN.js} +2 -2
- package/dist/node/chunks/{dep-Bkky1B58.js → dep-KxHho39H.js} +2 -2
- package/dist/node/cli.js +6 -6
- package/dist/node/constants.js +2 -2
- package/dist/node/index.d.ts +218 -172
- package/dist/node/index.js +3 -3
- package/dist/node/module-runner.d.ts +14 -2
- package/dist/node/module-runner.js +95 -46
- package/package.json +10 -9
- package/types/metadata.d.ts +0 -2
- package/bin/openChrome.applescript +0 -95
package/dist/node/index.d.ts
CHANGED
@@ -9,17 +9,14 @@ import * as http from "node:http";
|
|
9
9
|
import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders, ServerResponse } from "node:http";
|
10
10
|
import { Http2SecureServer } from "node:http2";
|
11
11
|
import * as fs from "node:fs";
|
12
|
-
import * as events from "node:events";
|
13
12
|
import { EventEmitter } from "node:events";
|
14
13
|
import { Server as HttpsServer, ServerOptions as HttpsServerOptions } from "node:https";
|
15
14
|
import * as net from "node:net";
|
16
|
-
import
|
17
|
-
import { URL } from "node:url";
|
18
|
-
import * as stream from "node:stream";
|
19
|
-
import { Duplex, DuplexOptions } from "node:stream";
|
15
|
+
import { Duplex, DuplexOptions, Stream } from "node:stream";
|
20
16
|
import { FetchFunction, FetchFunctionOptions, FetchResult, FetchResult as moduleRunner_FetchResult, ModuleEvaluator, ModuleRunner, ModuleRunnerHmr, ModuleRunnerOptions } from "vite/module-runner";
|
21
17
|
import { BuildOptions as esbuild_BuildOptions, TransformOptions as EsbuildTransformOptions, TransformOptions as esbuild_TransformOptions, TransformResult as esbuild_TransformResult, version as esbuildVersion } from "esbuild";
|
22
18
|
import { SecureContextOptions } from "node:tls";
|
19
|
+
import { URL as url_URL } from "node:url";
|
23
20
|
import { ZlibOptions } from "node:zlib";
|
24
21
|
import { Terser, TerserMinifyOptions } from "../../types/internal/terserOptions.js";
|
25
22
|
import * as PostCSS from "postcss";
|
@@ -28,8 +25,10 @@ import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPre
|
|
28
25
|
import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap } from "../../types/importGlob.js";
|
29
26
|
import { ChunkMetadata, CustomPluginOptionsVite } from "../../types/metadata.js";
|
30
27
|
|
31
|
-
//#region
|
28
|
+
//#region rolldown:runtime
|
32
29
|
|
30
|
+
//#endregion
|
31
|
+
//#region src/types/alias.d.ts
|
33
32
|
interface Alias {
|
34
33
|
find: string | RegExp;
|
35
34
|
replacement: string;
|
@@ -323,163 +322,201 @@ declare namespace Connect {
|
|
323
322
|
}
|
324
323
|
}
|
325
324
|
//#endregion
|
326
|
-
//#region
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
325
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.20.10/node_modules/http-proxy-3/dist/lib/http-proxy/index.d.ts
|
326
|
+
interface ProxyTargetDetailed {
|
327
|
+
host: string;
|
328
|
+
port: number;
|
329
|
+
protocol?: string;
|
330
|
+
hostname?: string;
|
331
|
+
socketPath?: string;
|
332
|
+
key?: string;
|
333
|
+
passphrase?: string;
|
334
|
+
pfx?: Buffer | string;
|
335
|
+
cert?: string;
|
336
|
+
ca?: string;
|
337
|
+
ciphers?: string;
|
338
|
+
secureProtocol?: string;
|
339
|
+
}
|
340
|
+
type ProxyType = "ws" | "web";
|
341
|
+
type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
|
342
|
+
type ProxyTargetUrl = URL | string | {
|
343
|
+
port: number;
|
344
|
+
host: string;
|
345
|
+
protocol?: string;
|
346
|
+
};
|
347
|
+
type NormalizeProxyTarget<T extends ProxyTargetUrl> = Exclude<T, string> | URL;
|
348
|
+
interface ServerOptions$3 {
|
349
|
+
/** URL string to be parsed with the url module. */
|
350
|
+
target?: ProxyTarget;
|
351
|
+
/** URL string to be parsed with the url module or a URL object. */
|
352
|
+
forward?: ProxyTargetUrl;
|
353
|
+
/** Object to be passed to http(s).request. */
|
354
|
+
agent?: any;
|
355
|
+
/** Object to be passed to https.createServer(). */
|
356
|
+
ssl?: any;
|
357
|
+
/** If you want to proxy websockets. */
|
358
|
+
ws?: boolean;
|
359
|
+
/** Adds x- forward headers. */
|
360
|
+
xfwd?: boolean;
|
361
|
+
/** Verify SSL certificate. */
|
362
|
+
secure?: boolean;
|
363
|
+
/** Explicitly specify if we are proxying to another proxy. */
|
364
|
+
toProxy?: boolean;
|
365
|
+
/** Specify whether you want to prepend the target's path to the proxy path. */
|
366
|
+
prependPath?: boolean;
|
367
|
+
/** Specify whether you want to ignore the proxy path of the incoming request. */
|
368
|
+
ignorePath?: boolean;
|
369
|
+
/** Local interface string to bind for outgoing connections. */
|
370
|
+
localAddress?: string;
|
371
|
+
/** Changes the origin of the host header to the target URL. */
|
372
|
+
changeOrigin?: boolean;
|
373
|
+
/** specify whether you want to keep letter case of response header key */
|
374
|
+
preserveHeaderKeyCase?: boolean;
|
375
|
+
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
|
376
|
+
auth?: string;
|
377
|
+
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
|
378
|
+
hostRewrite?: string;
|
379
|
+
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
|
380
|
+
autoRewrite?: boolean;
|
381
|
+
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
|
382
|
+
protocolRewrite?: string;
|
383
|
+
/** rewrites domain of set-cookie headers. */
|
384
|
+
cookieDomainRewrite?: false | string | {
|
385
|
+
[oldDomain: string]: string;
|
386
|
+
};
|
387
|
+
/** rewrites path of set-cookie headers. Default: false */
|
388
|
+
cookiePathRewrite?: false | string | {
|
389
|
+
[oldPath: string]: string;
|
390
|
+
};
|
391
|
+
/** object with extra headers to be added to target requests. */
|
392
|
+
headers?: {
|
393
|
+
[header: string]: string | string[] | undefined;
|
394
|
+
};
|
395
|
+
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
396
|
+
proxyTimeout?: number;
|
397
|
+
/** Timeout (in milliseconds) for incoming requests */
|
398
|
+
timeout?: number;
|
399
|
+
/** Specify whether you want to follow redirects. Default: false */
|
400
|
+
followRedirects?: boolean;
|
401
|
+
/** 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 */
|
402
|
+
selfHandleResponse?: boolean;
|
403
|
+
/** Buffer */
|
404
|
+
buffer?: Stream;
|
405
|
+
/** Explicitly set the method type of the ProxyReq */
|
406
|
+
method?: string;
|
407
|
+
/**
|
408
|
+
* Optionally override the trusted CA certificates.
|
409
|
+
* This is passed to https.request.
|
410
|
+
*/
|
411
|
+
ca?: string;
|
412
|
+
}
|
413
|
+
interface NormalizedServerOptions extends ServerOptions$3 {
|
414
|
+
target?: NormalizeProxyTarget<ProxyTarget>;
|
415
|
+
forward?: NormalizeProxyTarget<ProxyTargetUrl>;
|
416
|
+
}
|
417
|
+
type ErrorCallback = (err: Error, req: http.IncomingMessage, res: http.ServerResponse | net.Socket, target?: ProxyTargetUrl) => void;
|
418
|
+
type ProxyServerEventMap = {
|
419
|
+
error: Parameters<ErrorCallback>;
|
420
|
+
start: [req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl];
|
421
|
+
open: [socket: net.Socket];
|
422
|
+
proxyReq: [proxyReq: http.ClientRequest, req: http.IncomingMessage, res: http.ServerResponse, options: ServerOptions$3, socket: net.Socket];
|
423
|
+
proxyRes: [proxyRes: http.IncomingMessage, req: http.IncomingMessage, res: http.ServerResponse];
|
424
|
+
proxyReqWs: [proxyReq: http.ClientRequest, req: http.IncomingMessage, socket: net.Socket, options: ServerOptions$3, head: any];
|
425
|
+
econnreset: [err: Error, req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl];
|
426
|
+
end: [req: http.IncomingMessage, res: http.ServerResponse, proxyRes: http.IncomingMessage];
|
427
|
+
close: [proxyRes: http.IncomingMessage, proxySocket: net.Socket, proxyHead: any];
|
428
|
+
};
|
429
|
+
type ProxyMethodArgs = {
|
430
|
+
ws: [req: http.IncomingMessage, socket: any, head: any, ...args: [options?: ServerOptions$3, callback?: ErrorCallback] | [callback?: ErrorCallback]];
|
431
|
+
web: [req: http.IncomingMessage, res: http.ServerResponse, ...args: [options: ServerOptions$3, callback?: ErrorCallback] | [callback?: ErrorCallback]];
|
432
|
+
};
|
433
|
+
type PassFunctions = {
|
434
|
+
ws: (req: http.IncomingMessage, socket: net.Socket, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer, cb?: ErrorCallback) => unknown;
|
435
|
+
web: (req: http.IncomingMessage, res: http.ServerResponse, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer, cb?: ErrorCallback) => unknown;
|
436
|
+
};
|
437
|
+
declare class ProxyServer extends EventEmitter<ProxyServerEventMap> {
|
438
|
+
/**
|
439
|
+
* Used for proxying WS(S) requests
|
440
|
+
* @param req - Client request.
|
441
|
+
* @param socket - Client socket.
|
442
|
+
* @param head - Client head.
|
443
|
+
* @param options - Additional options.
|
444
|
+
*/
|
445
|
+
readonly ws: (...args: ProxyMethodArgs["ws"]) => void;
|
446
|
+
/**
|
447
|
+
* Used for proxying regular HTTP(S) requests
|
448
|
+
* @param req - Client request.
|
449
|
+
* @param res - Client response.
|
450
|
+
* @param options - Additional options.
|
451
|
+
*/
|
452
|
+
readonly web: (...args: ProxyMethodArgs["web"]) => void;
|
453
|
+
private options;
|
454
|
+
private webPasses;
|
455
|
+
private wsPasses;
|
456
|
+
private _server?;
|
457
|
+
/**
|
458
|
+
* Creates the proxy server with specified options.
|
459
|
+
* @param options - Config object passed to the proxy
|
460
|
+
*/
|
461
|
+
constructor(options?: ServerOptions$3);
|
462
|
+
/**
|
463
|
+
* Creates the proxy server with specified options.
|
464
|
+
* @param options Config object passed to the proxy
|
465
|
+
* @returns Proxy object with handlers for `ws` and `web` requests
|
466
|
+
*/
|
467
|
+
static createProxyServer(options?: ServerOptions$3): ProxyServer;
|
468
|
+
/**
|
469
|
+
* Creates the proxy server with specified options.
|
470
|
+
* @param options Config object passed to the proxy
|
471
|
+
* @returns Proxy object with handlers for `ws` and `web` requests
|
472
|
+
*/
|
473
|
+
static createServer(options?: ServerOptions$3): ProxyServer;
|
474
|
+
/**
|
475
|
+
* Creates the proxy server with specified options.
|
476
|
+
* @param options Config object passed to the proxy
|
477
|
+
* @returns Proxy object with handlers for `ws` and `web` requests
|
478
|
+
*/
|
479
|
+
static createProxy(options?: ServerOptions$3): ProxyServer;
|
480
|
+
createRightProxy: <PT extends ProxyType>(type: PT) => Function;
|
481
|
+
onError: (err: Error) => void;
|
482
|
+
/**
|
483
|
+
* A function that wraps the object in a webserver, for your convenience
|
484
|
+
* @param port - Port to listen on
|
485
|
+
* @param hostname - The hostname to listen on
|
486
|
+
*/
|
487
|
+
listen: (port: number, hostname?: string) => this;
|
488
|
+
address: () => string | net.AddressInfo | null | undefined;
|
489
|
+
/**
|
490
|
+
* A function that closes the inner webserver and stops listening on given port
|
491
|
+
*/
|
492
|
+
close: (cb?: Function) => void;
|
493
|
+
before: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions[PT]) => void;
|
494
|
+
after: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions[PT]) => void;
|
495
|
+
}
|
496
|
+
//#endregion
|
497
|
+
//#region ../../node_modules/.pnpm/http-proxy-3@1.20.10/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.d.ts
|
498
|
+
declare function numOpenSockets(): number;
|
499
|
+
declare namespace index_d_exports {
|
500
|
+
export { ErrorCallback, ProxyServer, ProxyTarget, ProxyTargetUrl, ServerOptions$3 as ServerOptions, createProxyServer as createProxy, createProxyServer, createProxyServer as createServer, ProxyServer as default, numOpenSockets };
|
479
501
|
}
|
502
|
+
/**
|
503
|
+
* Creates the proxy server.
|
504
|
+
*
|
505
|
+
* Examples:
|
506
|
+
*
|
507
|
+
* httpProxy.createProxyServer({ .. }, 8000)
|
508
|
+
* // => '{ web: [Function], ws: [Function] ... }'
|
509
|
+
*
|
510
|
+
* @param {Object} Options Config object passed to the proxy
|
511
|
+
*
|
512
|
+
* @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests
|
513
|
+
*
|
514
|
+
* @api public
|
515
|
+
*/
|
516
|
+
declare function createProxyServer(options?: ServerOptions$3): ProxyServer;
|
480
517
|
//#endregion
|
481
518
|
//#region src/node/server/middlewares/proxy.d.ts
|
482
|
-
interface ProxyOptions extends
|
519
|
+
interface ProxyOptions extends ServerOptions$3 {
|
483
520
|
/**
|
484
521
|
* rewrite path
|
485
522
|
*/
|
@@ -487,7 +524,7 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
|
|
487
524
|
/**
|
488
525
|
* configure the proxy server (e.g. listen to events)
|
489
526
|
*/
|
490
|
-
configure?: (proxy:
|
527
|
+
configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
|
491
528
|
/**
|
492
529
|
* webpack-dev-server style bypass function
|
493
530
|
*/
|
@@ -570,8 +607,8 @@ interface CommonServerOptions {
|
|
570
607
|
/**
|
571
608
|
* Configure custom proxy rules for the dev server. Expects an object
|
572
609
|
* of `{ key: options }` pairs.
|
573
|
-
* Uses [`http-proxy`](https://github.com/
|
574
|
-
* Full options [here](https://github.com/
|
610
|
+
* Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
|
611
|
+
* Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
|
575
612
|
*
|
576
613
|
* Example `vite.config.js`:
|
577
614
|
* ``` js
|
@@ -917,6 +954,7 @@ interface TransformOptions {
|
|
917
954
|
*/
|
918
955
|
ssr?: boolean;
|
919
956
|
}
|
957
|
+
interface TransformOptionsInternal {}
|
920
958
|
//#endregion
|
921
959
|
//#region src/node/server/moduleGraph.d.ts
|
922
960
|
declare class EnvironmentModuleNode {
|
@@ -930,7 +968,7 @@ declare class EnvironmentModuleNode {
|
|
930
968
|
*/
|
931
969
|
id: string | null;
|
932
970
|
file: string | null;
|
933
|
-
type: 'js' | 'css';
|
971
|
+
type: 'js' | 'css' | 'asset';
|
934
972
|
info?: ModuleInfo;
|
935
973
|
meta?: Record<string, any>;
|
936
974
|
importers: Set<EnvironmentModuleNode>;
|
@@ -998,7 +1036,7 @@ declare class ModuleNode {
|
|
998
1036
|
set id(value: string | null);
|
999
1037
|
get file(): string | null;
|
1000
1038
|
set file(value: string | null);
|
1001
|
-
get type(): 'js' | 'css';
|
1039
|
+
get type(): 'js' | 'css' | 'asset';
|
1002
1040
|
get info(): ModuleInfo | undefined;
|
1003
1041
|
get meta(): Record<string, any> | undefined;
|
1004
1042
|
get importers(): Set<ModuleNode>;
|
@@ -1189,8 +1227,8 @@ declare class WebSocket extends EventEmitter {
|
|
1189
1227
|
onclose: ((event: WebSocket.CloseEvent) => void) | null;
|
1190
1228
|
onmessage: ((event: WebSocket.MessageEvent) => void) | null;
|
1191
1229
|
constructor(address: null);
|
1192
|
-
constructor(address: string |
|
1193
|
-
constructor(address: string |
|
1230
|
+
constructor(address: string | url_URL, options?: WebSocket.ClientOptions | ClientRequestArgs);
|
1231
|
+
constructor(address: string | url_URL, protocols?: string | string[], options?: WebSocket.ClientOptions | ClientRequestArgs);
|
1194
1232
|
close(code?: number, data?: string | Buffer): void;
|
1195
1233
|
ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
|
1196
1234
|
pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
|
@@ -1522,7 +1560,7 @@ declare class DevEnvironment extends BaseEnvironment {
|
|
1522
1560
|
listen(server: ViteDevServer): Promise<void>;
|
1523
1561
|
fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
|
1524
1562
|
reloadModule(module: EnvironmentModuleNode): Promise<void>;
|
1525
|
-
transformRequest(url: string): Promise<TransformResult | null>;
|
1563
|
+
transformRequest(url: string, ): Promise<TransformResult | null>;
|
1526
1564
|
warmupRequest(url: string): Promise<void>;
|
1527
1565
|
close(): Promise<void>;
|
1528
1566
|
/**
|
@@ -2977,7 +3015,7 @@ interface SSROptions {
|
|
2977
3015
|
/**
|
2978
3016
|
* Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
|
2979
3017
|
*
|
2980
|
-
* @default []
|
3018
|
+
* @default ['node', 'module-sync']
|
2981
3019
|
*/
|
2982
3020
|
externalConditions?: string[];
|
2983
3021
|
mainFields?: string[];
|
@@ -3211,7 +3249,7 @@ interface UserConfig extends DefaultEnvironmentOptions {
|
|
3211
3249
|
/**
|
3212
3250
|
* Options to opt-in to future behavior
|
3213
3251
|
*/
|
3214
|
-
future?: FutureOptions;
|
3252
|
+
future?: FutureOptions | 'warn';
|
3215
3253
|
/**
|
3216
3254
|
* Legacy options
|
3217
3255
|
*
|
@@ -3297,8 +3335,11 @@ interface FutureOptions {
|
|
3297
3335
|
removePluginHookHandleHotUpdate?: 'warn';
|
3298
3336
|
removePluginHookSsrArgument?: 'warn';
|
3299
3337
|
removeServerModuleGraph?: 'warn';
|
3338
|
+
removeServerReloadModule?: 'warn';
|
3339
|
+
removeServerPluginContainer?: 'warn';
|
3300
3340
|
removeServerHot?: 'warn';
|
3301
3341
|
removeServerTransformRequest?: 'warn';
|
3342
|
+
removeServerWarmupRequest?: 'warn';
|
3302
3343
|
removeSsrLoadModule?: 'warn';
|
3303
3344
|
}
|
3304
3345
|
interface ExperimentalOptions {
|
@@ -3350,7 +3391,7 @@ interface InlineConfig extends UserConfig {
|
|
3350
3391
|
envFile?: false;
|
3351
3392
|
forceOptimizeDeps?: boolean;
|
3352
3393
|
}
|
3353
|
-
interface ResolvedConfig extends Readonly<Omit<UserConfig, 'plugins' | 'css' | 'json' | 'assetsInclude' | 'optimizeDeps' | 'worker' | 'build' | 'dev' | 'environments' | 'experimental' | 'server' | 'preview'> & {
|
3394
|
+
interface ResolvedConfig extends Readonly<Omit<UserConfig, 'plugins' | 'css' | 'json' | 'assetsInclude' | 'optimizeDeps' | 'worker' | 'build' | 'dev' | 'environments' | 'experimental' | 'future' | 'server' | 'preview'> & {
|
3354
3395
|
configFile: string | undefined;
|
3355
3396
|
configFileDependencies: string[];
|
3356
3397
|
inlineConfig: InlineConfig;
|
@@ -3395,6 +3436,7 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, 'plugins' | 'css' | '
|
|
3395
3436
|
worker: ResolvedWorkerOptions;
|
3396
3437
|
appType: AppType;
|
3397
3438
|
experimental: RequiredExceptFor<ExperimentalOptions, 'renderBuiltUrl'>;
|
3439
|
+
future: FutureOptions | undefined;
|
3398
3440
|
environments: Record<string, ResolvedEnvironmentOptions>;
|
3399
3441
|
/**
|
3400
3442
|
* The token to connect to the WebSocket server from browsers.
|
@@ -3541,6 +3583,7 @@ declare const DEFAULT_SERVER_MAIN_FIELDS: readonly string[];
|
|
3541
3583
|
|
3542
3584
|
declare const DEFAULT_CLIENT_CONDITIONS: readonly string[];
|
3543
3585
|
declare const DEFAULT_SERVER_CONDITIONS: readonly string[];
|
3586
|
+
declare const DEFAULT_EXTERNAL_CONDITIONS: readonly string[];
|
3544
3587
|
/**
|
3545
3588
|
* The browser versions that are included in the Baseline Widely Available on 2025-05-01.
|
3546
3589
|
*
|
@@ -3589,6 +3632,9 @@ declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
|
3589
3632
|
*/
|
3590
3633
|
declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
|
3591
3634
|
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
3635
|
+
/**
|
3636
|
+
* Warning: parameters are not validated, only works with normalized absolute paths
|
3637
|
+
*/
|
3592
3638
|
declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
|
3593
3639
|
//#endregion
|
3594
3640
|
//#region src/node/env.d.ts
|
@@ -3612,4 +3658,4 @@ interface ManifestChunk {
|
|
3612
3658
|
dynamicImports?: string[];
|
3613
3659
|
}
|
3614
3660
|
//#endregion
|
3615
|
-
export { Alias, AliasOptions, AnymatchFn, AnymatchPattern, AppType, BindCLIShortcutsOptions, BuildAppHook, BuildEnvironment, BuildEnvironmentOptions, BuildOptions, BuilderOptions, CLIShortcut, CSSModulesOptions, CSSOptions, ChunkMetadata, CommonServerOptions, ConfigEnv, ConfigPluginContext, Connect, ConnectedPayload, CorsOptions, CorsOrigin, CustomEventMap, CustomPayload, CustomPluginOptionsVite, DepOptimizationConfig, DepOptimizationMetadata, DepOptimizationOptions, DevEnvironment, DevEnvironmentContext, DevEnvironmentOptions, ESBuildOptions, ESBuildTransformResult, Environment, EnvironmentModuleGraph, EnvironmentModuleNode, EnvironmentOptions, ErrorPayload, EsbuildTransformOptions, ExperimentalOptions, ExportsData, FSWatcher, FetchFunction, FetchModuleOptions, FetchResult, FetchableDevEnvironment, FetchableDevEnvironmentContext, FileSystemServeOptions, FilterPattern, FullReloadPayload, GeneralImportGlobOptions, HMRPayload, HTMLOptions, HmrContext, HmrOptions, HookHandler, HotChannel, HotChannelClient, HotChannelListener, HotPayload, HotUpdateOptions, HtmlTagDescriptor, HttpProxy, HttpServer, ImportGlobFunction, ImportGlobOptions, IndexHtmlTransform, IndexHtmlTransformContext, IndexHtmlTransformHook, IndexHtmlTransformResult, InferCustomEventPayload, InlineConfig, InternalResolveOptions, InvalidatePayload, JsonOptions, KnownAsTypeMap, LegacyOptions, LessPreprocessorOptions, LibraryFormats, LibraryOptions, LightningCSSOptions, LogErrorOptions, LogLevel, LogOptions, LogType, Logger, LoggerOptions, Manifest, ManifestChunk, MapToFunction, AnymatchMatcher as Matcher, MinimalPluginContextWithoutEnvironment, ModuleGraph, ModuleNode, ModulePreloadOptions, ModuleRunnerTransformOptions, NormalizedHotChannel, NormalizedHotChannelClient, NormalizedServerHotChannel, OptimizedDepInfo, Plugin$1 as Plugin, PluginContainer, PluginHookUtils, PluginOption, PreprocessCSSResult, PreviewOptions, PreviewServer, PreviewServerHook, ProxyOptions, PrunePayload, RenderBuiltAssetUrl, ResolveFn, ResolveModulePreloadDependenciesFn, ResolveOptions, ResolvedBuildEnvironmentOptions, ResolvedBuildOptions, ResolvedCSSOptions, ResolvedConfig, ResolvedDevEnvironmentOptions, ResolvedModulePreloadOptions, ResolvedPreviewOptions, ResolvedSSROptions, ResolvedServerOptions, ResolvedServerUrls, ResolvedUrl, ResolvedWorkerOptions, ResolverFunction, ResolverObject, Rollup, RollupCommonJSOptions, RollupDynamicImportVarsOptions, RunnableDevEnvironment, RunnableDevEnvironmentContext, SSROptions, SSRTarget, SassPreprocessorOptions, SendOptions, ServerHook, ServerHotChannel, ServerModuleRunnerOptions, ServerOptions$1 as ServerOptions, SkipInformation, SsrDepOptimizationConfig, StylusPreprocessorOptions, Terser, TerserOptions, TransformOptions, TransformResult, Update, UpdatePayload, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise, ViteBuilder, ViteDevServer, WatchOptions, WebSocket, WebSocketAlias, WebSocketClient, WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };
|
3661
|
+
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, 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, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESBuildTransformResult, 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 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 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 MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type Plugin$1 as Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, 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 ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, 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 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, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, 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, defineConfig, esbuildVersion, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { createRequire as ___createRequire } from 'module'; const require = ___createRequire(import.meta.url);
|
2
|
-
import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-
|
3
|
-
import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, defaultAllowedOrigins } from "./chunks/dep-
|
2
|
+
import { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, ssrTransform, transformWithEsbuild } from "./chunks/dep-CYKWp2mZ.js";
|
3
|
+
import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_EXTERNAL_CONDITIONS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, defaultAllowedOrigins } from "./chunks/dep-BDCsDwBr.js";
|
4
4
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
5
5
|
import { version as esbuildVersion } from "esbuild";
|
6
6
|
|
@@ -28,4 +28,4 @@ var FetchableDevEnvironment = class extends DevEnvironment {
|
|
28
28
|
};
|
29
29
|
|
30
30
|
//#endregion
|
31
|
-
export { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };
|
31
|
+
export { BuildEnvironment, DevEnvironment, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, 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, defineConfig, esbuildVersion, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };
|
@@ -110,7 +110,6 @@ declare class ModuleRunner {
|
|
110
110
|
private debug?;
|
111
111
|
evaluatedModules: EvaluatedModules;
|
112
112
|
hmrClient?: HMRClient;
|
113
|
-
private readonly envProxy;
|
114
113
|
private readonly transport;
|
115
114
|
private readonly resetSourceMapSupport?;
|
116
115
|
private readonly concurrentModuleNodePromises;
|
@@ -218,6 +217,12 @@ interface ModuleRunnerOptions {
|
|
218
217
|
* @default true
|
219
218
|
*/
|
220
219
|
hmr?: boolean | ModuleRunnerHmr;
|
220
|
+
/**
|
221
|
+
* Create import.meta object for the module.
|
222
|
+
*
|
223
|
+
* @default createDefaultImportMeta
|
224
|
+
*/
|
225
|
+
createImportMeta?: (modulePath: string) => ModuleRunnerImportMeta | Promise<ModuleRunnerImportMeta>;
|
221
226
|
/**
|
222
227
|
* Custom module cache. If not provided, creates a separate module cache for each ModuleRunner instance.
|
223
228
|
*/
|
@@ -297,4 +302,11 @@ declare class ESModulesEvaluator implements ModuleEvaluator {
|
|
297
302
|
runExternalModule(filepath: string): Promise<any>;
|
298
303
|
}
|
299
304
|
//#endregion
|
300
|
-
|
305
|
+
//#region src/module-runner/createImportMeta.d.ts
|
306
|
+
declare function createDefaultImportMeta(modulePath: string): ModuleRunnerImportMeta;
|
307
|
+
/**
|
308
|
+
* Create import.meta object for Node.js.
|
309
|
+
*/
|
310
|
+
declare function createNodeImportMeta(modulePath: string): Promise<ModuleRunnerImportMeta>;
|
311
|
+
//#endregion
|
312
|
+
export { ESModulesEvaluator, type EvaluatedModuleNode, EvaluatedModules, type FetchFunction, type FetchFunctionOptions, type FetchResult, type HMRLogger, type InterceptorOptions, type ModuleEvaluator, ModuleRunner, type ModuleRunnerContext, type ModuleRunnerHmr, type ModuleRunnerImportMeta, type ModuleRunnerOptions, type ModuleRunnerTransport, type ModuleRunnerTransportHandlers, type ResolvedResult, type SSRImportMetadata, createDefaultImportMeta, createNodeImportMeta, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
|