vite 7.0.0-beta.0 → 7.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/vite.js +4 -4
- package/dist/client/client.mjs +14 -14
- package/dist/node/chunks/{dep-Ccq9jQdz.js → dep-3PhSlasG.js} +1 -1
- package/dist/node/chunks/{dep-RiwDEHuV.js → dep-BO5GbxpL.js} +3 -3
- package/dist/node/chunks/{dep-D_UgUiRQ.js → dep-BaSfMtGz.js} +1 -1
- package/dist/node/chunks/{dep-P8c3Tybu.js → dep-Bb92EWrU.js} +1 -1
- package/dist/node/chunks/{dep-3jlWaCfC.js → dep-C9KS6hrN.js} +1 -1
- package/dist/node/chunks/{dep-bvBD1i2C.js → dep-Da5Rc_CS.js} +656 -625
- package/dist/node/chunks/{dep-CCzsqxOh.js → dep-Dg4W3IAQ.js} +49 -49
- package/dist/node/chunks/{dep-FHYvcJhE.js → dep-uSUFJk9A.js} +20 -20
- package/dist/node/cli.js +6 -6
- package/dist/node/index.d.ts +9 -58
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.d.ts +9 -12
- package/dist/node/module-runner.js +27 -22
- package/dist/node/{moduleRunnerTransport-CnL9s_k9.d.ts → moduleRunnerTransport-BWUZBVLX.d.ts} +2 -2
- package/package.json +8 -9
- package/types/importGlob.d.ts +4 -0
- package/types/internal/cssPreprocessorOptions.d.ts +3 -3
package/dist/node/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import { ModuleRunnerTransport } from "./moduleRunnerTransport-
|
2
|
+
import { ModuleRunnerTransport } from "./moduleRunnerTransport-BWUZBVLX.js";
|
3
3
|
import { ConnectedPayload, CustomPayload, CustomPayload as hmrPayload_CustomPayload, ErrorPayload, FullReloadPayload, HMRPayload, HotPayload, HotPayload as hmrPayload_HotPayload, PrunePayload, Update, UpdatePayload } from "../../types/hmrPayload.js";
|
4
4
|
import { CustomEventMap, InferCustomEventPayload, InferCustomEventPayload as hmrPayload_InferCustomEventPayload, InvalidatePayload } from "../../types/customEvent.js";
|
5
5
|
import * as Rollup from "rollup";
|
@@ -60,13 +60,11 @@ interface ResolverObject {
|
|
60
60
|
type AliasOptions = readonly Alias[] | {
|
61
61
|
[find: string]: string;
|
62
62
|
};
|
63
|
-
|
64
63
|
//#endregion
|
65
64
|
//#region src/types/anymatch.d.ts
|
66
65
|
type AnymatchFn = (testString: string) => boolean;
|
67
66
|
type AnymatchPattern = string | RegExp | AnymatchFn;
|
68
67
|
type AnymatchMatcher = AnymatchPattern | AnymatchPattern[];
|
69
|
-
|
70
68
|
//#endregion
|
71
69
|
//#region src/types/chokidar.d.ts
|
72
70
|
declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
@@ -249,12 +247,13 @@ interface AwaitWriteFinishOptions {
|
|
249
247
|
* File size polling interval.
|
250
248
|
*/
|
251
249
|
pollInterval?: number;
|
252
|
-
}
|
253
|
-
//#region src/types/connect.d.ts
|
250
|
+
}
|
254
251
|
|
255
252
|
/**
|
256
253
|
* produces an instance of `FSWatcher`.
|
257
254
|
*/
|
255
|
+
//#endregion
|
256
|
+
//#region src/types/connect.d.ts
|
258
257
|
declare namespace Connect {
|
259
258
|
export type ServerHandle = HandleFunction | http_3.Server;
|
260
259
|
export class IncomingMessage extends http_3.IncomingMessage {
|
@@ -324,7 +323,6 @@ declare namespace Connect {
|
|
324
323
|
listen(handle: any, listeningListener?: Function): http_3.Server;
|
325
324
|
}
|
326
325
|
}
|
327
|
-
|
328
326
|
//#endregion
|
329
327
|
//#region src/types/http-proxy.d.ts
|
330
328
|
declare namespace HttpProxy {
|
@@ -479,7 +477,8 @@ declare namespace HttpProxy {
|
|
479
477
|
/** Buffer */
|
480
478
|
buffer?: stream.Stream | undefined;
|
481
479
|
}
|
482
|
-
}
|
480
|
+
}
|
481
|
+
//#endregion
|
483
482
|
//#region src/node/server/middlewares/proxy.d.ts
|
484
483
|
interface ProxyOptions extends HttpProxy.ServerOptions {
|
485
484
|
/**
|
@@ -502,7 +501,6 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
|
|
502
501
|
*/
|
503
502
|
rewriteWsOrigin?: boolean | undefined;
|
504
503
|
}
|
505
|
-
|
506
504
|
//#endregion
|
507
505
|
//#region src/node/logger.d.ts
|
508
506
|
type LogType = 'error' | 'warn' | 'info';
|
@@ -531,7 +529,6 @@ interface LoggerOptions {
|
|
531
529
|
console?: Console;
|
532
530
|
}
|
533
531
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
534
|
-
|
535
532
|
//#endregion
|
536
533
|
//#region src/node/http.d.ts
|
537
534
|
interface CommonServerOptions {
|
@@ -632,11 +629,9 @@ interface CorsOptions {
|
|
632
629
|
optionsSuccessStatus?: number;
|
633
630
|
}
|
634
631
|
type CorsOrigin = boolean | string | RegExp | (string | RegExp)[];
|
635
|
-
|
636
632
|
//#endregion
|
637
633
|
//#region src/node/typeUtils.d.ts
|
638
634
|
type RequiredExceptFor<T, K extends keyof T> = Pick<T, K> & Required<Omit<T, K>>;
|
639
|
-
|
640
635
|
//#endregion
|
641
636
|
//#region src/node/preview.d.ts
|
642
637
|
interface PreviewOptions extends CommonServerOptions {}
|
@@ -682,7 +677,6 @@ type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server:
|
|
682
677
|
* Starts the Vite server in preview mode, to simulate a production deployment
|
683
678
|
*/
|
684
679
|
declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
|
685
|
-
|
686
680
|
//#endregion
|
687
681
|
//#region src/node/shortcuts.d.ts
|
688
682
|
type BindCLIShortcutsOptions<Server = ViteDevServer | PreviewServer> = {
|
@@ -702,7 +696,6 @@ type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
|
|
702
696
|
description: string;
|
703
697
|
action?(server: Server): void | Promise<void>;
|
704
698
|
};
|
705
|
-
|
706
699
|
//#endregion
|
707
700
|
//#region src/node/baseEnvironment.d.ts
|
708
701
|
declare class PartialEnvironment {
|
@@ -731,7 +724,6 @@ declare class BaseEnvironment extends PartialEnvironment {
|
|
731
724
|
declare class UnknownEnvironment extends BaseEnvironment {
|
732
725
|
mode: "unknown";
|
733
726
|
}
|
734
|
-
|
735
727
|
//#endregion
|
736
728
|
//#region src/node/optimizer/scan.d.ts
|
737
729
|
declare class ScanEnvironment extends BaseEnvironment {
|
@@ -739,7 +731,6 @@ declare class ScanEnvironment extends BaseEnvironment {
|
|
739
731
|
get pluginContainer(): EnvironmentPluginContainer;
|
740
732
|
init(): Promise<void>;
|
741
733
|
}
|
742
|
-
|
743
734
|
//#endregion
|
744
735
|
//#region src/node/optimizer/index.d.ts
|
745
736
|
type ExportsData = {
|
@@ -909,7 +900,6 @@ interface DepOptimizationMetadata {
|
|
909
900
|
* @deprecated the optimization process runs automatically and does not need to be called
|
910
901
|
*/
|
911
902
|
declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean): Promise<DepOptimizationMetadata>;
|
912
|
-
|
913
903
|
//#endregion
|
914
904
|
//#region src/node/server/transformRequest.d.ts
|
915
905
|
interface TransformResult {
|
@@ -928,7 +918,6 @@ interface TransformOptions {
|
|
928
918
|
*/
|
929
919
|
ssr?: boolean;
|
930
920
|
}
|
931
|
-
|
932
921
|
//#endregion
|
933
922
|
//#region src/node/server/moduleGraph.d.ts
|
934
923
|
declare class EnvironmentModuleNode {
|
@@ -991,7 +980,6 @@ declare class EnvironmentModuleGraph {
|
|
991
980
|
updateModuleTransformResult(mod: EnvironmentModuleNode, result: TransformResult | null): void;
|
992
981
|
getModuleByEtag(etag: string): EnvironmentModuleNode | undefined;
|
993
982
|
}
|
994
|
-
|
995
983
|
//#endregion
|
996
984
|
//#region src/node/server/mixedModuleGraph.d.ts
|
997
985
|
declare class ModuleNode {
|
@@ -1062,7 +1050,6 @@ declare class ModuleGraph {
|
|
1062
1050
|
getBackwardCompatibleModuleNodeDual(clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode): ModuleNode;
|
1063
1051
|
}
|
1064
1052
|
type ModuleSetNames = 'acceptedHmrDeps' | 'importedModules';
|
1065
|
-
|
1066
1053
|
//#endregion
|
1067
1054
|
//#region src/node/server/hmr.d.ts
|
1068
1055
|
interface HmrOptions {
|
@@ -1168,7 +1155,6 @@ type ServerHotChannelApi = {
|
|
1168
1155
|
type ServerHotChannel = HotChannel<ServerHotChannelApi>;
|
1169
1156
|
type NormalizedServerHotChannel = NormalizedHotChannel<ServerHotChannelApi>;
|
1170
1157
|
declare function createServerHotChannel(): ServerHotChannel;
|
1171
|
-
|
1172
1158
|
//#endregion
|
1173
1159
|
//#region src/types/ws.d.ts
|
1174
1160
|
// WebSocket socket.
|
@@ -1455,9 +1441,9 @@ declare namespace WebSocket {
|
|
1455
1441
|
function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
|
1456
1442
|
}
|
1457
1443
|
|
1444
|
+
// export = WebSocket
|
1458
1445
|
//#endregion
|
1459
1446
|
//#region src/node/server/ws.d.ts
|
1460
|
-
// export = WebSocket
|
1461
1447
|
type WebSocketCustomListener<T> = (data: T, client: WebSocketClient, invoke?: 'send' | `send:${string}`) => void;
|
1462
1448
|
declare const isWebSocketServer: unique symbol;
|
1463
1449
|
interface WebSocketServer extends NormalizedHotChannel {
|
@@ -1494,7 +1480,6 @@ interface WebSocketClient extends NormalizedHotChannelClient {
|
|
1494
1480
|
*/
|
1495
1481
|
socket: WebSocket;
|
1496
1482
|
}
|
1497
|
-
|
1498
1483
|
//#endregion
|
1499
1484
|
//#region src/node/server/environment.d.ts
|
1500
1485
|
interface DevEnvironmentContext {
|
@@ -1551,7 +1536,6 @@ declare class DevEnvironment extends BaseEnvironment {
|
|
1551
1536
|
*/
|
1552
1537
|
waitForRequestsIdle(ignoredId?: string): Promise<void>;
|
1553
1538
|
}
|
1554
|
-
|
1555
1539
|
//#endregion
|
1556
1540
|
//#region src/types/commonjs.d.ts
|
1557
1541
|
|
@@ -1769,7 +1753,6 @@ interface RollupCommonJSOptions {
|
|
1769
1753
|
*/
|
1770
1754
|
dynamicRequireRoot?: string;
|
1771
1755
|
}
|
1772
|
-
|
1773
1756
|
//#endregion
|
1774
1757
|
//#region src/types/dynamicImportVars.d.ts
|
1775
1758
|
interface RollupDynamicImportVarsOptions {
|
@@ -1789,7 +1772,6 @@ interface RollupDynamicImportVarsOptions {
|
|
1789
1772
|
*/
|
1790
1773
|
warnOnError?: boolean;
|
1791
1774
|
}
|
1792
|
-
|
1793
1775
|
//#endregion
|
1794
1776
|
//#region src/types/terser.d.ts
|
1795
1777
|
// Modified and inlined to avoid extra dependency
|
@@ -1996,7 +1978,6 @@ declare namespace Terser {
|
|
1996
1978
|
url?: string | 'inline';
|
1997
1979
|
}
|
1998
1980
|
}
|
1999
|
-
|
2000
1981
|
//#endregion
|
2001
1982
|
//#region src/node/plugins/terser.d.ts
|
2002
1983
|
interface TerserOptions extends Terser.MinifyOptions {
|
@@ -2008,7 +1989,6 @@ interface TerserOptions extends Terser.MinifyOptions {
|
|
2008
1989
|
*/
|
2009
1990
|
maxWorkers?: number;
|
2010
1991
|
}
|
2011
|
-
|
2012
1992
|
//#endregion
|
2013
1993
|
//#region src/node/plugins/resolve.d.ts
|
2014
1994
|
interface EnvironmentResolveOptions {
|
@@ -2064,7 +2044,6 @@ interface ResolvePluginOptions {
|
|
2064
2044
|
scan?: boolean;
|
2065
2045
|
}
|
2066
2046
|
interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {}
|
2067
|
-
|
2068
2047
|
//#endregion
|
2069
2048
|
//#region src/node/packages.d.ts
|
2070
2049
|
/** Cache for package.json resolution and package.json contents */
|
@@ -2087,7 +2066,6 @@ interface PackageData {
|
|
2087
2066
|
dependencies: Record<string, string>;
|
2088
2067
|
};
|
2089
2068
|
}
|
2090
|
-
|
2091
2069
|
//#endregion
|
2092
2070
|
//#region src/node/build.d.ts
|
2093
2071
|
interface BuildEnvironmentOptions {
|
@@ -2395,7 +2373,6 @@ type ResolvedBuilderOptions = Required<BuilderOptions>;
|
|
2395
2373
|
*/
|
2396
2374
|
declare function createBuilder(inlineConfig?: InlineConfig, useLegacyBuilder?: null | boolean): Promise<ViteBuilder>;
|
2397
2375
|
type BuildAppHook = (this: MinimalPluginContextWithoutEnvironment, builder: ViteBuilder) => Promise<void>;
|
2398
|
-
|
2399
2376
|
//#endregion
|
2400
2377
|
//#region src/node/environment.d.ts
|
2401
2378
|
type Environment = DevEnvironment | BuildEnvironment | UnknownEnvironment;
|
@@ -2407,7 +2384,6 @@ type Environment = DevEnvironment | BuildEnvironment | UnknownEnvironment;
|
|
2407
2384
|
* @experimental
|
2408
2385
|
*/
|
2409
2386
|
declare function perEnvironmentState<State>(initial: (environment: Environment) => State): (context: PluginContext) => State;
|
2410
|
-
|
2411
2387
|
//#endregion
|
2412
2388
|
//#region src/node/server/pluginContainer.d.ts
|
2413
2389
|
type SkipInformation = {
|
@@ -2513,9 +2489,6 @@ declare class PluginContainer {
|
|
2513
2489
|
}>;
|
2514
2490
|
close(): Promise<void>;
|
2515
2491
|
}
|
2516
|
-
|
2517
|
-
//#endregion
|
2518
|
-
//#region src/node/server/index.d.ts
|
2519
2492
|
/**
|
2520
2493
|
* server.pluginContainer compatibility
|
2521
2494
|
*
|
@@ -2525,6 +2498,8 @@ declare class PluginContainer {
|
|
2525
2498
|
* an environment. The defaultEnvironment in the main pluginContainer in the server should be
|
2526
2499
|
* the client environment for backward compatibility.
|
2527
2500
|
**/
|
2501
|
+
//#endregion
|
2502
|
+
//#region src/node/server/index.d.ts
|
2528
2503
|
interface ServerOptions$1 extends CommonServerOptions {
|
2529
2504
|
/**
|
2530
2505
|
* Configure HMR-specific options (port, host, path & protocol)
|
@@ -2767,7 +2742,6 @@ interface ResolvedServerUrls {
|
|
2767
2742
|
network: string[];
|
2768
2743
|
}
|
2769
2744
|
declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Promise<ViteDevServer>;
|
2770
|
-
|
2771
2745
|
//#endregion
|
2772
2746
|
//#region src/node/plugins/html.d.ts
|
2773
2747
|
interface HtmlTagDescriptor {
|
@@ -2802,14 +2776,12 @@ type IndexHtmlTransform = IndexHtmlTransformHook | {
|
|
2802
2776
|
order?: 'pre' | 'post' | null;
|
2803
2777
|
handler: IndexHtmlTransformHook;
|
2804
2778
|
};
|
2805
|
-
|
2806
2779
|
//#endregion
|
2807
2780
|
//#region src/node/plugins/pluginFilter.d.ts
|
2808
2781
|
type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
|
2809
2782
|
include?: Value | Array<Value>;
|
2810
2783
|
exclude?: Value | Array<Value>;
|
2811
2784
|
};
|
2812
|
-
|
2813
2785
|
//#endregion
|
2814
2786
|
//#region src/node/plugin.d.ts
|
2815
2787
|
/**
|
@@ -3056,7 +3028,6 @@ type PluginOption = Thenable<Plugin$1 | FalsyPlugin | PluginOption[]>;
|
|
3056
3028
|
* @experimental
|
3057
3029
|
*/
|
3058
3030
|
declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption): Plugin$1;
|
3059
|
-
|
3060
3031
|
//#endregion
|
3061
3032
|
//#region src/node/plugins/css.d.ts
|
3062
3033
|
interface CSSOptions {
|
@@ -3147,7 +3118,6 @@ type LessPreprocessorOptions = {
|
|
3147
3118
|
type StylusPreprocessorOptions = {
|
3148
3119
|
additionalData?: PreprocessorAdditionalData;
|
3149
3120
|
} & StylusPreprocessorBaseOptions;
|
3150
|
-
|
3151
3121
|
//#endregion
|
3152
3122
|
//#region src/node/plugins/esbuild.d.ts
|
3153
3123
|
interface ESBuildOptions extends esbuild_TransformOptions {
|
@@ -3163,7 +3133,6 @@ type ESBuildTransformResult = Omit<esbuild_TransformResult, 'map'> & {
|
|
3163
3133
|
map: SourceMap;
|
3164
3134
|
};
|
3165
3135
|
declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<ESBuildTransformResult>;
|
3166
|
-
|
3167
3136
|
//#endregion
|
3168
3137
|
//#region src/node/plugins/json.d.ts
|
3169
3138
|
interface JsonOptions {
|
@@ -3180,7 +3149,6 @@ interface JsonOptions {
|
|
3180
3149
|
*/
|
3181
3150
|
stringify?: boolean | 'auto';
|
3182
3151
|
}
|
3183
|
-
|
3184
3152
|
//#endregion
|
3185
3153
|
//#region src/node/ssr/index.d.ts
|
3186
3154
|
type SSRTarget = 'node' | 'webworker';
|
@@ -3226,7 +3194,6 @@ interface ResolvedSSROptions extends SSROptions {
|
|
3226
3194
|
target: SSRTarget;
|
3227
3195
|
optimizeDeps: SsrDepOptimizationConfig;
|
3228
3196
|
}
|
3229
|
-
|
3230
3197
|
//#endregion
|
3231
3198
|
//#region src/node/config.d.ts
|
3232
3199
|
interface ConfigEnv {
|
@@ -3665,7 +3632,6 @@ declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, c
|
|
3665
3632
|
config: UserConfig;
|
3666
3633
|
dependencies: string[];
|
3667
3634
|
} | null>;
|
3668
|
-
|
3669
3635
|
//#endregion
|
3670
3636
|
//#region src/node/idResolver.d.ts
|
3671
3637
|
type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
|
@@ -3680,11 +3646,9 @@ type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: stri
|
|
3680
3646
|
* optimizer and handling css @imports
|
3681
3647
|
*/
|
3682
3648
|
declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
|
3683
|
-
|
3684
3649
|
//#endregion
|
3685
3650
|
//#region src/node/server/middlewares/error.d.ts
|
3686
3651
|
declare function buildErrorMessage(err: RollupError, args?: string[], includeStack?: boolean): string;
|
3687
|
-
|
3688
3652
|
//#endregion
|
3689
3653
|
//#region src/node/ssr/runtime/serverModuleRunner.d.ts
|
3690
3654
|
/**
|
@@ -3710,7 +3674,6 @@ declare const createServerModuleRunnerTransport: (options: {
|
|
3710
3674
|
* @experimental
|
3711
3675
|
*/
|
3712
3676
|
declare function createServerModuleRunner(environment: DevEnvironment, options?: ServerModuleRunnerOptions): ModuleRunner;
|
3713
|
-
|
3714
3677
|
//#endregion
|
3715
3678
|
//#region src/node/server/environments/runnableEnvironment.d.ts
|
3716
3679
|
declare function createRunnableDevEnvironment(name: string, config: ResolvedConfig, context?: RunnableDevEnvironmentContext): RunnableDevEnvironment;
|
@@ -3728,7 +3691,6 @@ declare class RunnableDevEnvironment extends DevEnvironment {
|
|
3728
3691
|
get runner(): ModuleRunner;
|
3729
3692
|
close(): Promise<void>;
|
3730
3693
|
}
|
3731
|
-
|
3732
3694
|
//#endregion
|
3733
3695
|
//#region src/node/server/environments/fetchableEnvironments.d.ts
|
3734
3696
|
interface FetchableDevEnvironmentContext extends DevEnvironmentContext {
|
@@ -3741,7 +3703,6 @@ declare class FetchableDevEnvironment extends DevEnvironment {
|
|
3741
3703
|
constructor(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext);
|
3742
3704
|
dispatchFetch(request: Request): Promise<Response>;
|
3743
3705
|
}
|
3744
|
-
|
3745
3706
|
//#endregion
|
3746
3707
|
//#region src/node/ssr/runnerImport.d.ts
|
3747
3708
|
interface RunnerImportResult<T> {
|
@@ -3753,7 +3714,6 @@ interface RunnerImportResult<T> {
|
|
3753
3714
|
* @experimental
|
3754
3715
|
*/
|
3755
3716
|
declare function runnerImport<T>(moduleId: string, inlineConfig?: InlineConfig): Promise<RunnerImportResult<T>>;
|
3756
|
-
|
3757
3717
|
//#endregion
|
3758
3718
|
//#region src/node/ssr/fetchModule.d.ts
|
3759
3719
|
interface FetchModuleOptions {
|
@@ -3766,7 +3726,6 @@ interface FetchModuleOptions {
|
|
3766
3726
|
* @experimental
|
3767
3727
|
*/
|
3768
3728
|
declare function fetchModule(environment: DevEnvironment, url: string, importer?: string, options?: FetchModuleOptions): Promise<moduleRunner_FetchResult>;
|
3769
|
-
|
3770
3729
|
//#endregion
|
3771
3730
|
//#region src/node/ssr/ssrTransform.d.ts
|
3772
3731
|
interface ModuleRunnerTransformOptions {
|
@@ -3777,7 +3736,6 @@ interface ModuleRunnerTransformOptions {
|
|
3777
3736
|
declare function ssrTransform(code: string, inMap: SourceMap | {
|
3778
3737
|
mappings: '';
|
3779
3738
|
} | null, url: string, originalCode: string, options?: ModuleRunnerTransformOptions): Promise<TransformResult | null>;
|
3780
|
-
|
3781
3739
|
//#endregion
|
3782
3740
|
//#region src/node/constants.d.ts
|
3783
3741
|
declare const VERSION: string;
|
@@ -3799,7 +3757,6 @@ declare const DEFAULT_SERVER_CONDITIONS: readonly string[];
|
|
3799
3757
|
*/
|
3800
3758
|
|
3801
3759
|
declare const defaultAllowedOrigins: RegExp;
|
3802
|
-
|
3803
3760
|
//#endregion
|
3804
3761
|
//#region src/node/utils.d.ts
|
3805
3762
|
/**
|
@@ -3814,7 +3771,6 @@ declare function normalizePath(id: string): string;
|
|
3814
3771
|
declare const isCSSRequest: (request: string) => boolean;
|
3815
3772
|
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>;
|
3816
3773
|
declare function mergeAlias(a?: AliasOptions, b?: AliasOptions): AliasOptions | undefined;
|
3817
|
-
|
3818
3774
|
//#endregion
|
3819
3775
|
//#region src/node/server/send.d.ts
|
3820
3776
|
interface SendOptions {
|
@@ -3826,14 +3782,12 @@ interface SendOptions {
|
|
3826
3782
|
} | null;
|
3827
3783
|
}
|
3828
3784
|
declare function send(req: http.IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, options: SendOptions): void;
|
3829
|
-
|
3830
3785
|
//#endregion
|
3831
3786
|
//#region src/node/server/searchRoot.d.ts
|
3832
3787
|
/**
|
3833
3788
|
* Search up for the nearest workspace root
|
3834
3789
|
*/
|
3835
3790
|
declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
3836
|
-
|
3837
3791
|
//#endregion
|
3838
3792
|
//#region src/node/server/middlewares/static.d.ts
|
3839
3793
|
/**
|
@@ -3843,14 +3797,12 @@ declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
|
3843
3797
|
declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
|
3844
3798
|
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
3845
3799
|
declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
|
3846
|
-
|
3847
3800
|
//#endregion
|
3848
3801
|
//#region src/node/env.d.ts
|
3849
3802
|
declare function loadEnv(mode: string, envDir: string | false, prefixes?: string | string[]): Record<string, string>;
|
3850
3803
|
declare function resolveEnvPrefix({
|
3851
3804
|
envPrefix
|
3852
3805
|
}: UserConfig): string[];
|
3853
|
-
|
3854
3806
|
//#endregion
|
3855
3807
|
//#region src/node/plugins/manifest.d.ts
|
3856
3808
|
type Manifest = Record<string, ManifestChunk>;
|
@@ -3866,6 +3818,5 @@ interface ManifestChunk {
|
|
3866
3818
|
imports?: string[];
|
3867
3819
|
dynamicImports?: string[];
|
3868
3820
|
}
|
3869
|
-
|
3870
3821
|
//#endregion
|
3871
3822
|
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 };
|
package/dist/node/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
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-
|
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-Da5Rc_CS.js";
|
3
3
|
import { DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, VERSION, defaultAllowedOrigins } from "./chunks/dep-Ctugieod.js";
|
4
4
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
5
5
|
import { version as esbuildVersion } from "esbuild";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ExternalFetchResult, FetchFunctionOptions, FetchResult, ModuleRunnerTransport, ModuleRunnerTransportHandlers, NormalizedModuleRunnerTransport, ViteFetchResult, createWebSocketModuleRunnerTransport } from "./moduleRunnerTransport-
|
1
|
+
import { ExternalFetchResult, FetchFunctionOptions, FetchResult, ModuleRunnerTransport, ModuleRunnerTransportHandlers, NormalizedModuleRunnerTransport, ViteFetchResult, createWebSocketModuleRunnerTransport } from "./moduleRunnerTransport-BWUZBVLX.js";
|
2
2
|
import { ModuleNamespace, ViteHotContext } from "../../types/hot.js";
|
3
3
|
import { HotPayload, Update } from "../../types/hmrPayload.js";
|
4
4
|
import { InferCustomEventPayload } from "../../types/customEvent.js";
|
@@ -26,7 +26,8 @@ interface Stats {
|
|
26
26
|
lastKey: number;
|
27
27
|
lastNeedle: number;
|
28
28
|
lastIndex: number;
|
29
|
-
}
|
29
|
+
}
|
30
|
+
//#endregion
|
30
31
|
//#region src/shared/hmr.d.ts
|
31
32
|
type CustomListenersMap = Map<string, ((data: any) => void)[]>;
|
32
33
|
interface HotModule {
|
@@ -67,7 +68,8 @@ declare class HMRClient {
|
|
67
68
|
*/
|
68
69
|
queueUpdate(payload: Update): Promise<void>;
|
69
70
|
private fetchUpdate;
|
70
|
-
}
|
71
|
+
}
|
72
|
+
//#endregion
|
71
73
|
//#region src/shared/ssrTransform.d.ts
|
72
74
|
interface DefineImportMetadata {
|
73
75
|
/**
|
@@ -84,20 +86,19 @@ interface DefineImportMetadata {
|
|
84
86
|
interface SSRImportMetadata extends DefineImportMetadata {
|
85
87
|
isDynamicImport?: boolean;
|
86
88
|
}
|
87
|
-
|
88
|
-
//#endregion
|
89
|
-
//#region src/module-runner/constants.d.ts
|
90
89
|
/**
|
91
90
|
* Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
|
92
91
|
* Top-level imports and dynamic imports work slightly differently in Node.js.
|
93
92
|
* This function normalizes the differences so it matches prod behaviour.
|
94
93
|
*/
|
94
|
+
//#endregion
|
95
|
+
//#region src/module-runner/constants.d.ts
|
95
96
|
declare const ssrModuleExportsKey = "__vite_ssr_exports__";
|
96
97
|
declare const ssrImportKey = "__vite_ssr_import__";
|
97
98
|
declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
|
98
99
|
declare const ssrExportAllKey = "__vite_ssr_exportAll__";
|
100
|
+
declare const ssrExportNameKey = "__vite_ssr_exportName__";
|
99
101
|
declare const ssrImportMetaKey = "__vite_ssr_import_meta__";
|
100
|
-
|
101
102
|
//#endregion
|
102
103
|
//#region src/module-runner/runner.d.ts
|
103
104
|
interface ModuleRunnerDebugger {
|
@@ -140,7 +141,6 @@ declare class ModuleRunner {
|
|
140
141
|
private getModuleInformation;
|
141
142
|
protected directRequest(url: string, mod: EvaluatedModuleNode, _callstack: string[]): Promise<any>;
|
142
143
|
}
|
143
|
-
|
144
144
|
//#endregion
|
145
145
|
//#region src/module-runner/sourcemap/interceptor.d.ts
|
146
146
|
interface RetrieveFileHandler {
|
@@ -156,7 +156,6 @@ interface InterceptorOptions {
|
|
156
156
|
retrieveFile?: RetrieveFileHandler;
|
157
157
|
retrieveSourceMap?: RetrieveSourceMapHandler;
|
158
158
|
}
|
159
|
-
|
160
159
|
//#endregion
|
161
160
|
//#region src/module-runner/types.d.ts
|
162
161
|
interface ModuleRunnerImportMeta extends ImportMeta {
|
@@ -170,6 +169,7 @@ interface ModuleRunnerContext {
|
|
170
169
|
[ssrImportKey]: (id: string, metadata?: DefineImportMetadata) => Promise<any>;
|
171
170
|
[ssrDynamicImportKey]: (id: string, options?: ImportCallOptions) => Promise<any>;
|
172
171
|
[ssrExportAllKey]: (obj: any) => void;
|
172
|
+
[ssrExportNameKey]: (name: string, getter: () => unknown) => void;
|
173
173
|
[ssrImportMetaKey]: ModuleRunnerImportMeta;
|
174
174
|
}
|
175
175
|
interface ModuleEvaluator {
|
@@ -231,7 +231,6 @@ interface ImportMetaEnv {
|
|
231
231
|
PROD: boolean;
|
232
232
|
SSR: boolean;
|
233
233
|
}
|
234
|
-
|
235
234
|
//#endregion
|
236
235
|
//#region src/module-runner/evaluatedModules.d.ts
|
237
236
|
declare class EvaluatedModuleNode {
|
@@ -289,7 +288,6 @@ declare class EvaluatedModules {
|
|
289
288
|
getModuleSourceMapById(id: string): DecodedMap | null;
|
290
289
|
clear(): void;
|
291
290
|
}
|
292
|
-
|
293
291
|
//#endregion
|
294
292
|
//#region src/module-runner/esmEvaluator.d.ts
|
295
293
|
declare class ESModulesEvaluator implements ModuleEvaluator {
|
@@ -297,6 +295,5 @@ declare class ESModulesEvaluator implements ModuleEvaluator {
|
|
297
295
|
runInlinedModule(context: ModuleRunnerContext, code: string): Promise<any>;
|
298
296
|
runExternalModule(filepath: string): Promise<any>;
|
299
297
|
}
|
300
|
-
|
301
298
|
//#endregion
|
302
299
|
export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunction, FetchFunctionOptions, FetchResult, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunner, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ModuleRunnerTransport, ModuleRunnerTransportHandlers, ResolvedResult, SSRImportMetadata, createWebSocketModuleRunnerTransport, ssrDynamicImportKey, ssrExportAllKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
|