vite 6.0.0-alpha.18 → 6.0.0-alpha.19
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 +111 -144
- package/client.d.ts +4 -0
- package/dist/client/client.mjs +614 -612
- package/dist/client/env.mjs +18 -24
- package/dist/node/chunks/{dep-DXWVQosX.js → dep-BWEMV5Th.js} +49165 -46447
- package/dist/node/chunks/{dep-CrWVpuYf.js → dep-D-7KCb9p.js} +32 -2
- package/dist/node/chunks/{dep-70g8Z1cd.js → dep-MbEgMyUv.js} +10 -14
- package/dist/node/chunks/{dep-DlhHXrzk.js → dep-bCS_cgqC.js} +1 -1
- package/dist/node/cli.js +253 -263
- package/dist/node/constants.js +105 -108
- package/dist/node/index.d.ts +75 -74
- package/dist/node/index.js +125 -143
- package/dist/node/module-runner.d.ts +3 -0
- package/dist/node/module-runner.js +173 -108
- package/dist/node-cjs/publicUtils.cjs +536 -606
- package/package.json +16 -17
- package/dist/client/client.mjs.map +0 -1
- package/dist/client/env.mjs.map +0 -1
package/dist/node/index.d.ts
CHANGED
@@ -4,7 +4,7 @@ import * as rollup from 'rollup';
|
|
4
4
|
export { rollup as Rollup };
|
5
5
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
6
6
|
import * as http from 'node:http';
|
7
|
-
import { OutgoingHttpHeaders,
|
7
|
+
import { OutgoingHttpHeaders, ClientRequestArgs, IncomingMessage, ClientRequest, Agent, Server, ServerResponse } from 'node:http';
|
8
8
|
import { Http2SecureServer } from 'node:http2';
|
9
9
|
import * as fs from 'node:fs';
|
10
10
|
import * as events from 'node:events';
|
@@ -412,6 +412,7 @@ declare namespace HttpProxy {
|
|
412
412
|
* @param req - Client request.
|
413
413
|
* @param res - Client response.
|
414
414
|
* @param options - Additional options.
|
415
|
+
* @param callback - Error callback.
|
415
416
|
*/
|
416
417
|
web(
|
417
418
|
req: http.IncomingMessage,
|
@@ -426,6 +427,7 @@ declare namespace HttpProxy {
|
|
426
427
|
* @param socket - Client socket.
|
427
428
|
* @param head - Client head.
|
428
429
|
* @param options - Additional options.
|
430
|
+
* @param callback - Error callback.
|
429
431
|
*/
|
430
432
|
ws(
|
431
433
|
req: http.IncomingMessage,
|
@@ -616,6 +618,12 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
|
|
616
618
|
* webpack-dev-server style bypass function
|
617
619
|
*/
|
618
620
|
bypass?: (req: http.IncomingMessage, res: http.ServerResponse, options: ProxyOptions) => void | null | undefined | false | string;
|
621
|
+
/**
|
622
|
+
* rewrite the Origin header of a WebSocket request to match the the target
|
623
|
+
*
|
624
|
+
* **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
|
625
|
+
*/
|
626
|
+
rewriteWsOrigin?: boolean | undefined;
|
619
627
|
}
|
620
628
|
|
621
629
|
type LogType = 'error' | 'warn' | 'info';
|
@@ -785,10 +793,15 @@ type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
|
|
785
793
|
|
786
794
|
declare class PartialEnvironment {
|
787
795
|
name: string;
|
788
|
-
|
789
|
-
|
796
|
+
getTopLevelConfig(): ResolvedConfig;
|
797
|
+
config: ResolvedConfig & ResolvedEnvironmentOptions;
|
798
|
+
/**
|
799
|
+
* @deprecated use environment.config instead
|
800
|
+
**/
|
801
|
+
get options(): ResolvedEnvironmentOptions;
|
802
|
+
_options: ResolvedEnvironmentOptions;
|
790
803
|
logger: Logger;
|
791
|
-
constructor(name: string,
|
804
|
+
constructor(name: string, topLevelConfig: ResolvedConfig, options?: ResolvedEnvironmentOptions);
|
792
805
|
}
|
793
806
|
declare class BaseEnvironment extends PartialEnvironment {
|
794
807
|
get plugins(): Plugin[];
|
@@ -998,7 +1011,7 @@ interface TransformResult {
|
|
998
1011
|
}
|
999
1012
|
interface TransformOptions {
|
1000
1013
|
/**
|
1001
|
-
* @deprecated
|
1014
|
+
* @deprecated inferred from environment
|
1002
1015
|
*/
|
1003
1016
|
ssr?: boolean;
|
1004
1017
|
/**
|
@@ -1123,30 +1136,18 @@ declare class ModuleGraph {
|
|
1123
1136
|
client: () => EnvironmentModuleGraph;
|
1124
1137
|
ssr: () => EnvironmentModuleGraph;
|
1125
1138
|
});
|
1126
|
-
/** @deprecated */
|
1127
1139
|
getModuleById(id: string): ModuleNode | undefined;
|
1128
|
-
/** @deprecated */
|
1129
1140
|
getModuleByUrl(url: string, ssr?: boolean): Promise<ModuleNode | undefined>;
|
1130
|
-
/** @deprecated */
|
1131
1141
|
getModulesByFile(file: string): Set<ModuleNode> | undefined;
|
1132
|
-
/** @deprecated */
|
1133
1142
|
onFileChange(file: string): void;
|
1134
|
-
/** @deprecated */
|
1135
1143
|
onFileDelete(file: string): void;
|
1136
|
-
/** @deprecated */
|
1137
1144
|
invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean,
|
1138
1145
|
): void;
|
1139
|
-
/** @deprecated */
|
1140
1146
|
invalidateAll(): void;
|
1141
|
-
/** @deprecated */
|
1142
1147
|
ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
|
1143
|
-
/** @deprecated */
|
1144
1148
|
createFileOnlyEntry(file: string): ModuleNode;
|
1145
|
-
/** @deprecated */
|
1146
1149
|
resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
|
1147
|
-
/** @deprecated */
|
1148
1150
|
updateModuleTransformResult(mod: ModuleNode, result: TransformResult | null, ssr?: boolean): void;
|
1149
|
-
/** @deprecated */
|
1150
1151
|
getModuleByEtag(etag: string): ModuleNode | undefined;
|
1151
1152
|
getBackwardCompatibleBrowserModuleNode(clientModule: EnvironmentModuleNode): ModuleNode;
|
1152
1153
|
getBackwardCompatibleServerModuleNode(ssrModule: EnvironmentModuleNode): ModuleNode;
|
@@ -1163,21 +1164,20 @@ interface HmrOptions {
|
|
1163
1164
|
path?: string;
|
1164
1165
|
timeout?: number;
|
1165
1166
|
overlay?: boolean;
|
1166
|
-
server?:
|
1167
|
+
server?: HttpServer;
|
1167
1168
|
}
|
1168
|
-
interface
|
1169
|
+
interface HotUpdateOptions {
|
1169
1170
|
type: 'create' | 'update' | 'delete';
|
1170
1171
|
file: string;
|
1171
1172
|
timestamp: number;
|
1172
1173
|
modules: Array<EnvironmentModuleNode>;
|
1173
1174
|
read: () => string | Promise<string>;
|
1174
1175
|
server: ViteDevServer;
|
1176
|
+
/**
|
1177
|
+
* @deprecated use this.environment in the hotUpdate hook instead
|
1178
|
+
**/
|
1175
1179
|
environment: DevEnvironment;
|
1176
1180
|
}
|
1177
|
-
/**
|
1178
|
-
* @deprecated
|
1179
|
-
* Used by handleHotUpdate for backward compatibility with mixed client and ssr moduleGraph
|
1180
|
-
**/
|
1181
1181
|
interface HmrContext {
|
1182
1182
|
file: string;
|
1183
1183
|
timestamp: number;
|
@@ -1195,6 +1195,8 @@ interface HotChannelClient {
|
|
1195
1195
|
*/
|
1196
1196
|
send(event: string, payload?: CustomPayload['data']): void;
|
1197
1197
|
}
|
1198
|
+
/** @deprecated use `HotChannelClient` instead */
|
1199
|
+
type HMRBroadcasterClient = HotChannelClient;
|
1198
1200
|
interface HotChannel {
|
1199
1201
|
/**
|
1200
1202
|
* Broadcast events to all clients
|
@@ -1222,12 +1224,28 @@ interface HotChannel {
|
|
1222
1224
|
*/
|
1223
1225
|
close(): void;
|
1224
1226
|
}
|
1227
|
+
/** @deprecated use `HotChannel` instead */
|
1228
|
+
type HMRChannel = HotChannel;
|
1225
1229
|
interface ServerHotChannel extends HotChannel {
|
1226
1230
|
api: {
|
1227
1231
|
innerEmitter: EventEmitter;
|
1228
1232
|
outsideEmitter: EventEmitter;
|
1229
1233
|
};
|
1230
1234
|
}
|
1235
|
+
/** @deprecated use `ServerHotChannel` instead */
|
1236
|
+
type ServerHMRChannel = ServerHotChannel;
|
1237
|
+
/** @deprecated use `environment.hot` instead */
|
1238
|
+
interface HotBroadcaster extends HotChannel {
|
1239
|
+
readonly channels: HotChannel[];
|
1240
|
+
/**
|
1241
|
+
* A noop.
|
1242
|
+
* @deprecated
|
1243
|
+
*/
|
1244
|
+
addChannel(channel: HotChannel): HotBroadcaster;
|
1245
|
+
close(): Promise<unknown[]>;
|
1246
|
+
}
|
1247
|
+
/** @deprecated use `environment.hot` instead */
|
1248
|
+
type HMRBroadcaster = HotBroadcaster;
|
1231
1249
|
|
1232
1250
|
declare class RemoteEnvironmentTransport {
|
1233
1251
|
private readonly options;
|
@@ -1527,6 +1545,9 @@ interface RollupDynamicImportVarsOptions {
|
|
1527
1545
|
declare namespace Terser {
|
1528
1546
|
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
1529
1547
|
|
1548
|
+
export type ConsoleProperty = keyof typeof console
|
1549
|
+
type DropConsoleOption = boolean | ConsoleProperty[]
|
1550
|
+
|
1530
1551
|
export interface ParseOptions {
|
1531
1552
|
bare_returns?: boolean
|
1532
1553
|
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
@@ -1547,7 +1568,7 @@ declare namespace Terser {
|
|
1547
1568
|
dead_code?: boolean
|
1548
1569
|
defaults?: boolean
|
1549
1570
|
directives?: boolean
|
1550
|
-
drop_console?:
|
1571
|
+
drop_console?: DropConsoleOption
|
1551
1572
|
drop_debugger?: boolean
|
1552
1573
|
ecma?: ECMA
|
1553
1574
|
evaluate?: boolean
|
@@ -1570,6 +1591,7 @@ declare namespace Terser {
|
|
1570
1591
|
passes?: number
|
1571
1592
|
properties?: boolean
|
1572
1593
|
pure_funcs?: string[]
|
1594
|
+
pure_new?: boolean
|
1573
1595
|
pure_getters?: boolean | 'strict'
|
1574
1596
|
reduce_funcs?: boolean
|
1575
1597
|
reduce_vars?: boolean
|
@@ -1619,7 +1641,7 @@ declare namespace Terser {
|
|
1619
1641
|
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
1620
1642
|
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
1621
1643
|
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
1622
|
-
* @param n
|
1644
|
+
* @param n The ordinal of the identifier.
|
1623
1645
|
*/
|
1624
1646
|
get(n: number): string
|
1625
1647
|
}
|
@@ -1631,8 +1653,8 @@ declare namespace Terser {
|
|
1631
1653
|
/**
|
1632
1654
|
* Modifies the internal weighting of the input characters by the specified delta.
|
1633
1655
|
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
1634
|
-
* @param chars
|
1635
|
-
* @param delta
|
1656
|
+
* @param chars The characters to modify the weighting of.
|
1657
|
+
* @param delta The numeric weight to add to the characters.
|
1636
1658
|
*/
|
1637
1659
|
consider(chars: string, delta: number): number
|
1638
1660
|
/**
|
@@ -1715,7 +1737,7 @@ declare namespace Terser {
|
|
1715
1737
|
module?: boolean
|
1716
1738
|
nameCache?: object
|
1717
1739
|
format?: FormatOptions
|
1718
|
-
/** @deprecated
|
1740
|
+
/** @deprecated */
|
1719
1741
|
output?: FormatOptions
|
1720
1742
|
parse?: ParseOptions
|
1721
1743
|
safari10?: boolean
|
@@ -1735,6 +1757,7 @@ declare namespace Terser {
|
|
1735
1757
|
includeSources?: boolean
|
1736
1758
|
filename?: string
|
1737
1759
|
root?: string
|
1760
|
+
asObject?: boolean
|
1738
1761
|
url?: string | 'inline'
|
1739
1762
|
}
|
1740
1763
|
}
|
@@ -1930,7 +1953,6 @@ interface BuildEnvironmentOptions {
|
|
1930
1953
|
/**
|
1931
1954
|
* Emit assets during SSR.
|
1932
1955
|
* @default false
|
1933
|
-
* @deprecated use emitAssets
|
1934
1956
|
*/
|
1935
1957
|
ssrEmitAssets?: boolean;
|
1936
1958
|
/**
|
@@ -2717,7 +2739,6 @@ interface ServerOptions extends CommonServerOptions {
|
|
2717
2739
|
/**
|
2718
2740
|
* Warm-up files to transform and cache the results in advance. This improves the
|
2719
2741
|
* initial page load during server starts and prevents transform waterfalls.
|
2720
|
-
* @deprecated use dev.warmup / environment.ssr.dev.warmup
|
2721
2742
|
*/
|
2722
2743
|
warmup?: {
|
2723
2744
|
/**
|
@@ -2744,7 +2765,7 @@ interface ServerOptions extends CommonServerOptions {
|
|
2744
2765
|
*
|
2745
2766
|
* This is needed to proxy WebSocket connections to the parent server.
|
2746
2767
|
*/
|
2747
|
-
server:
|
2768
|
+
server: HttpServer;
|
2748
2769
|
};
|
2749
2770
|
/**
|
2750
2771
|
* Options for files served via '/\@fs/'.
|
@@ -2759,7 +2780,6 @@ interface ServerOptions extends CommonServerOptions {
|
|
2759
2780
|
/**
|
2760
2781
|
* Pre-transform known direct imports
|
2761
2782
|
* @default true
|
2762
|
-
* @deprecated use dev.preTransformRequests
|
2763
2783
|
*/
|
2764
2784
|
preTransformRequests?: boolean;
|
2765
2785
|
/**
|
@@ -2769,7 +2789,6 @@ interface ServerOptions extends CommonServerOptions {
|
|
2769
2789
|
* By default, it excludes all paths containing `node_modules`. You can pass `false` to
|
2770
2790
|
* disable this behavior, or, for full control, a function that takes the source path and
|
2771
2791
|
* sourcemap path and returns whether to ignore the source path.
|
2772
|
-
* @deprecated use dev.sourcemapIgnoreList
|
2773
2792
|
*/
|
2774
2793
|
sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
|
2775
2794
|
/**
|
@@ -2844,12 +2863,17 @@ interface ViteDevServer {
|
|
2844
2863
|
watcher: FSWatcher;
|
2845
2864
|
/**
|
2846
2865
|
* web socket server with `send(payload)` method
|
2847
|
-
* @deprecated use `environment.hot` instead
|
2848
2866
|
*/
|
2849
2867
|
ws: WebSocketServer;
|
2868
|
+
/**
|
2869
|
+
* HMR broadcaster that can be used to send custom HMR messages to the client
|
2870
|
+
*
|
2871
|
+
* Always sends a message to at least a WebSocket client. Any third party can
|
2872
|
+
* add a channel to the broadcaster to process messages
|
2873
|
+
*/
|
2874
|
+
hot: HotBroadcaster;
|
2850
2875
|
/**
|
2851
2876
|
* Rollup plugin container that can run plugin hooks on a given file
|
2852
|
-
* @deprecated use `environment.pluginContainer` instead
|
2853
2877
|
*/
|
2854
2878
|
pluginContainer: PluginContainer;
|
2855
2879
|
/**
|
@@ -2859,7 +2883,6 @@ interface ViteDevServer {
|
|
2859
2883
|
/**
|
2860
2884
|
* Module graph that tracks the import relationships, url to file mapping
|
2861
2885
|
* and hmr state.
|
2862
|
-
* @deprecated use `environment.moduleGraph` instead
|
2863
2886
|
*/
|
2864
2887
|
moduleGraph: ModuleGraph;
|
2865
2888
|
/**
|
@@ -2870,14 +2893,12 @@ interface ViteDevServer {
|
|
2870
2893
|
/**
|
2871
2894
|
* Programmatically resolve, load and transform a URL and get the result
|
2872
2895
|
* without going through the http request pipeline.
|
2873
|
-
* @deprecated use environment.transformRequest
|
2874
2896
|
*/
|
2875
2897
|
transformRequest(url: string, options?: TransformOptions): Promise<TransformResult | null>;
|
2876
2898
|
/**
|
2877
2899
|
* Same as `transformRequest` but only warm up the URLs so the next request
|
2878
2900
|
* will already be cached. The function will never throw as it handles and
|
2879
2901
|
* reports errors internally.
|
2880
|
-
* @deprecated use environment.warmupRequest
|
2881
2902
|
*/
|
2882
2903
|
warmupRequest(url: string, options?: TransformOptions): Promise<void>;
|
2883
2904
|
/**
|
@@ -2946,8 +2967,6 @@ interface ViteDevServer {
|
|
2946
2967
|
* are processed. If called from a load or transform plugin hook, the id needs to be
|
2947
2968
|
* passed as a parameter to avoid deadlocks. Calling this function after the first
|
2948
2969
|
* static imports section of the module graph has been processed will resolve immediately.
|
2949
|
-
* @experimental
|
2950
|
-
* @deprecated use environment.waitForRequestsIdle()
|
2951
2970
|
*/
|
2952
2971
|
waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
|
2953
2972
|
}
|
@@ -3030,7 +3049,7 @@ interface ResolvePluginOptions {
|
|
3030
3049
|
scan?: boolean;
|
3031
3050
|
ssrOptimizeCheck?: boolean;
|
3032
3051
|
/**
|
3033
|
-
* @deprecated environment.
|
3052
|
+
* @deprecated environment.config are used instead
|
3034
3053
|
*/
|
3035
3054
|
ssrConfig?: SSROptions;
|
3036
3055
|
}
|
@@ -3089,6 +3108,7 @@ type LightningCSSOptions = {
|
|
3089
3108
|
pseudoClasses?: PseudoClasses
|
3090
3109
|
unusedSymbols?: string[]
|
3091
3110
|
cssModules?: CSSModulesConfig
|
3111
|
+
errorRecovery?: boolean
|
3092
3112
|
}
|
3093
3113
|
|
3094
3114
|
interface CSSOptions {
|
@@ -3127,7 +3147,6 @@ interface CSSOptions {
|
|
3127
3147
|
* Enables css sourcemaps during dev
|
3128
3148
|
* @default false
|
3129
3149
|
* @experimental
|
3130
|
-
* @deprecated use dev.sourcemap instead
|
3131
3150
|
*/
|
3132
3151
|
devSourcemap?: boolean;
|
3133
3152
|
/**
|
@@ -3246,6 +3265,9 @@ interface PluginContextExtension {
|
|
3246
3265
|
*/
|
3247
3266
|
environment: Environment;
|
3248
3267
|
}
|
3268
|
+
interface HotUpdatePluginContext {
|
3269
|
+
environment: DevEnvironment;
|
3270
|
+
}
|
3249
3271
|
interface PluginContext extends rollup.PluginContext, PluginContextExtension {
|
3250
3272
|
}
|
3251
3273
|
interface ResolveIdPluginContext extends rollup.PluginContext, PluginContextExtension {
|
@@ -3269,7 +3291,7 @@ declare module 'rollup' {
|
|
3269
3291
|
interface Plugin<A = any> extends rollup.Plugin<A> {
|
3270
3292
|
/**
|
3271
3293
|
* Perform custom handling of HMR updates.
|
3272
|
-
* The handler receives
|
3294
|
+
* The handler receives an options containing changed filename, timestamp, a
|
3273
3295
|
* list of modules affected by the file change, and the dev server instance.
|
3274
3296
|
*
|
3275
3297
|
* - The hook can return a filtered list of modules to narrow down the update.
|
@@ -3277,34 +3299,25 @@ interface Plugin<A = any> extends rollup.Plugin<A> {
|
|
3277
3299
|
* the descriptors.
|
3278
3300
|
*
|
3279
3301
|
* - The hook can also return an empty array and then perform custom updates
|
3280
|
-
* by sending a custom hmr payload via
|
3302
|
+
* by sending a custom hmr payload via environment.hot.send().
|
3281
3303
|
*
|
3282
3304
|
* - If the hook doesn't return a value, the hmr update will be performed as
|
3283
3305
|
* normal.
|
3284
3306
|
*/
|
3285
|
-
hotUpdate?: ObjectHook<(this:
|
3307
|
+
hotUpdate?: ObjectHook<(this: HotUpdatePluginContext, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>>;
|
3286
3308
|
/**
|
3287
3309
|
* extend hooks with ssr flag
|
3288
3310
|
*/
|
3289
3311
|
resolveId?: ObjectHook<(this: ResolveIdPluginContext, source: string, importer: string | undefined, options: {
|
3290
3312
|
attributes: Record<string, string>;
|
3291
3313
|
custom?: CustomPluginOptions;
|
3292
|
-
/**
|
3293
|
-
* @deprecated use this.environment
|
3294
|
-
*/
|
3295
3314
|
ssr?: boolean;
|
3296
3315
|
isEntry: boolean;
|
3297
3316
|
}) => Promise<ResolveIdResult> | ResolveIdResult>;
|
3298
3317
|
load?: ObjectHook<(this: PluginContext, id: string, options?: {
|
3299
|
-
/**
|
3300
|
-
* @deprecated use this.environment
|
3301
|
-
*/
|
3302
3318
|
ssr?: boolean;
|
3303
3319
|
}) => Promise<LoadResult> | LoadResult>;
|
3304
3320
|
transform?: ObjectHook<(this: TransformPluginContext, code: string, id: string, options?: {
|
3305
|
-
/**
|
3306
|
-
* @deprecated use this.environment
|
3307
|
-
*/
|
3308
3321
|
ssr?: boolean;
|
3309
3322
|
}) => Promise<rollup.TransformResult> | rollup.TransformResult>;
|
3310
3323
|
/**
|
@@ -3400,7 +3413,6 @@ interface Plugin<A = any> extends rollup.Plugin<A> {
|
|
3400
3413
|
*/
|
3401
3414
|
transformIndexHtml?: IndexHtmlTransform;
|
3402
3415
|
/**
|
3403
|
-
* @deprecated
|
3404
3416
|
* Perform custom handling of HMR updates.
|
3405
3417
|
* The handler receives a context containing changed filename, timestamp, a
|
3406
3418
|
* list of modules affected by the file change, and the dev server instance.
|
@@ -3441,17 +3453,8 @@ interface JsonOptions {
|
|
3441
3453
|
|
3442
3454
|
type SSRTarget = 'node' | 'webworker';
|
3443
3455
|
type SsrDepOptimizationConfig = DepOptimizationConfig;
|
3444
|
-
/**
|
3445
|
-
* @deprecated use environments.ssr
|
3446
|
-
*/
|
3447
3456
|
interface SSROptions {
|
3448
|
-
/**
|
3449
|
-
* @deprecated use environment.resolve.noExternal
|
3450
|
-
*/
|
3451
3457
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
3452
|
-
/**
|
3453
|
-
* @deprecated use environment.resolve.external
|
3454
|
-
*/
|
3455
3458
|
external?: string[] | true;
|
3456
3459
|
/**
|
3457
3460
|
* Define the target for the ssr build. The browser field in package.json
|
@@ -3464,7 +3467,6 @@ interface SSROptions {
|
|
3464
3467
|
* }
|
3465
3468
|
*
|
3466
3469
|
* @default 'node'
|
3467
|
-
* @deprecated use environment.webCompatible
|
3468
3470
|
*/
|
3469
3471
|
target?: SSRTarget;
|
3470
3472
|
/**
|
@@ -3474,12 +3476,8 @@ interface SSROptions {
|
|
3474
3476
|
* During dev:
|
3475
3477
|
* explicit no external CJS dependencies are optimized by default
|
3476
3478
|
* @experimental
|
3477
|
-
* @deprecated
|
3478
3479
|
*/
|
3479
3480
|
optimizeDeps?: SsrDepOptimizationConfig;
|
3480
|
-
/**
|
3481
|
-
* @deprecated
|
3482
|
-
*/
|
3483
3481
|
resolve?: {
|
3484
3482
|
/**
|
3485
3483
|
* Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
|
@@ -3487,14 +3485,12 @@ interface SSROptions {
|
|
3487
3485
|
* Use this to override the default ssr conditions for the ssr build.
|
3488
3486
|
*
|
3489
3487
|
* @default rootConfig.resolve.conditions
|
3490
|
-
* @deprecated
|
3491
3488
|
*/
|
3492
3489
|
conditions?: string[];
|
3493
3490
|
/**
|
3494
3491
|
* Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
|
3495
3492
|
*
|
3496
3493
|
* @default []
|
3497
|
-
* @deprecated
|
3498
3494
|
*/
|
3499
3495
|
externalConditions?: string[];
|
3500
3496
|
};
|
@@ -3605,6 +3601,11 @@ interface SharedEnvironmentOptions {
|
|
3605
3601
|
* Configure resolver
|
3606
3602
|
*/
|
3607
3603
|
resolve?: EnvironmentResolveOptions;
|
3604
|
+
/**
|
3605
|
+
* Define if this environment is used for Server Side Rendering
|
3606
|
+
* @default 'server' if it isn't the client environment
|
3607
|
+
*/
|
3608
|
+
consumer?: 'client' | 'server';
|
3608
3609
|
/**
|
3609
3610
|
* Runtime Compatibility
|
3610
3611
|
* Temporal options, we should remove these in favor of fine-grained control
|
@@ -3632,13 +3633,14 @@ interface EnvironmentOptions extends SharedEnvironmentOptions {
|
|
3632
3633
|
type ResolvedEnvironmentResolveOptions = Required<EnvironmentResolveOptions>;
|
3633
3634
|
type ResolvedEnvironmentOptions = {
|
3634
3635
|
resolve: ResolvedEnvironmentResolveOptions;
|
3636
|
+
consumer: 'client' | 'server';
|
3635
3637
|
nodeCompatible: boolean;
|
3636
3638
|
webCompatible: boolean;
|
3637
3639
|
injectInvalidationTimestamp: boolean;
|
3638
3640
|
dev: ResolvedDevEnvironmentOptions;
|
3639
3641
|
build: ResolvedBuildEnvironmentOptions;
|
3640
3642
|
};
|
3641
|
-
type DefaultEnvironmentOptions = Omit<EnvironmentOptions, 'build' | 'nodeCompatible' | 'webCompatible'> & {
|
3643
|
+
type DefaultEnvironmentOptions = Omit<EnvironmentOptions, 'build' | 'consumer' | 'nodeCompatible' | 'webCompatible' | 'injectInvalidationTimestamp'> & {
|
3642
3644
|
build?: BuildOptions;
|
3643
3645
|
};
|
3644
3646
|
interface UserConfig extends DefaultEnvironmentOptions {
|
@@ -4031,7 +4033,6 @@ declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
|
4031
4033
|
|
4032
4034
|
/**
|
4033
4035
|
* Check if the url is allowed to be served, via the `server.fs` config.
|
4034
|
-
* @deprecated use isFileLoadingAllowed
|
4035
4036
|
*/
|
4036
4037
|
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
4037
4038
|
declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
|
@@ -4052,4 +4053,4 @@ interface ManifestChunk {
|
|
4052
4053
|
dynamicImports?: string[];
|
4053
4054
|
}
|
4054
4055
|
|
4055
|
-
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentOptions, type DevEnvironmentSetup, type ESBuildOptions, type ESBuildTransformResult, type Environment, EnvironmentModuleGraph, EnvironmentModuleNode, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type
|
4056
|
+
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentOptions, type DevEnvironmentSetup, type ESBuildOptions, type ESBuildTransformResult, type Environment, EnvironmentModuleGraph, EnvironmentModuleNode, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotUpdateOptions, type HtmlTagDescriptor, HttpProxy, type HttpServer, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, 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, ModuleGraph, ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type OptimizedDepInfo, type Plugin, PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, RemoteEnvironmentTransport, 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 RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationConfig, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteBuilder, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createNodeDevEnvironment, createServer, createServerModuleRunner, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
|