vite 7.0.0-beta.2 → 7.0.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/dist/client/client.mjs +8 -8
- package/dist/node/chunks/{dep-B_m28uIY.js → dep-BDIuIvL4.js} +1 -1
- package/dist/node/chunks/{dep-C5h9brB_.js → dep-BrEuKyO0.js} +1 -1
- package/dist/node/chunks/{dep-Bkc4tc5S.js → dep-Bsx9IwL8.js} +86 -97
- package/dist/node/chunks/{dep-BYhaRSbV.js → dep-DcjhO6Jt.js} +65 -30
- package/dist/node/chunks/{dep-CZ6VYVb7.js → dep-DnkJBLYF.js} +1 -1
- package/dist/node/chunks/{dep-8cccGkwy.js → dep-Do-w1DD4.js} +39 -39
- package/dist/node/chunks/{dep-DZ1Lk4oF.js → dep-pyXEOwQv.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.d.ts +27 -234
- package/dist/node/index.js +1 -1
- package/dist/node/module-runner.d.ts +2 -1
- package/dist/node/module-runner.js +7 -15
- package/package.json +8 -8
- package/types/internal/terserOptions.d.ts +11 -0
package/dist/node/index.d.ts
CHANGED
@@ -5,9 +5,6 @@ import { CustomEventMap, InferCustomEventPayload, InferCustomEventPayload as hmr
|
|
5
5
|
import * as Rollup from "rollup";
|
6
6
|
import { CustomPluginOptions, ExistingRawSourceMap, InputOption, InputOptions, LoadResult, MinimalPluginContext, ModuleFormat, ModuleInfo, ObjectHook, OutputBundle, OutputChunk, PartialResolvedId, PluginContext, PluginContextMeta, PluginHooks, ResolveIdResult, RollupError, RollupLog, RollupOptions, RollupOutput, RollupWatcher, SourceDescription, SourceMap, SourceMapInput, TransformPluginContext, WatcherOptions } from "rollup";
|
7
7
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
8
|
-
import * as http_3 from "node:http";
|
9
|
-
import * as http_2 from "node:http";
|
10
|
-
import * as http_1 from "node:http";
|
11
8
|
import * as http from "node:http";
|
12
9
|
import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders, ServerResponse } from "node:http";
|
13
10
|
import { Http2SecureServer } from "node:http2";
|
@@ -24,6 +21,7 @@ import { FetchFunction, FetchFunctionOptions, FetchResult, FetchResult as module
|
|
24
21
|
import { BuildOptions as esbuild_BuildOptions, TransformOptions as EsbuildTransformOptions, TransformOptions as esbuild_TransformOptions, TransformResult as esbuild_TransformResult, version as esbuildVersion } from "esbuild";
|
25
22
|
import { SecureContextOptions } from "node:tls";
|
26
23
|
import { ZlibOptions } from "node:zlib";
|
24
|
+
import { Terser, TerserMinifyOptions } from "../../types/internal/terserOptions.js";
|
27
25
|
import * as PostCSS from "postcss";
|
28
26
|
import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "../../types/internal/lightningcssOptions.js";
|
29
27
|
import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "../../types/internal/cssPreprocessorOptions.js";
|
@@ -31,6 +29,7 @@ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownA
|
|
31
29
|
import { ChunkMetadata, CustomPluginOptionsVite } from "../../types/metadata.js";
|
32
30
|
|
33
31
|
//#region src/types/alias.d.ts
|
32
|
+
|
34
33
|
interface Alias {
|
35
34
|
find: string | RegExp;
|
36
35
|
replacement: string;
|
@@ -255,21 +254,21 @@ interface AwaitWriteFinishOptions {
|
|
255
254
|
//#endregion
|
256
255
|
//#region src/types/connect.d.ts
|
257
256
|
declare namespace Connect {
|
258
|
-
export type ServerHandle = HandleFunction |
|
259
|
-
export class IncomingMessage extends
|
260
|
-
originalUrl?:
|
257
|
+
export type ServerHandle = HandleFunction | http.Server;
|
258
|
+
export class IncomingMessage extends http.IncomingMessage {
|
259
|
+
originalUrl?: http.IncomingMessage['url'] | undefined;
|
261
260
|
}
|
262
261
|
export type NextFunction = (err?: any) => void;
|
263
|
-
export type SimpleHandleFunction = (req: IncomingMessage, res:
|
264
|
-
export type NextHandleFunction = (req: IncomingMessage, res:
|
265
|
-
export type ErrorHandleFunction = (err: any, req: IncomingMessage, res:
|
262
|
+
export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
|
263
|
+
export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
|
264
|
+
export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
|
266
265
|
export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
|
267
266
|
export interface ServerStackItem {
|
268
267
|
route: string;
|
269
268
|
handle: ServerHandle;
|
270
269
|
}
|
271
270
|
export interface Server extends NodeJS.EventEmitter {
|
272
|
-
(req:
|
271
|
+
(req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
|
273
272
|
route: string;
|
274
273
|
stack: ServerStackItem[];
|
275
274
|
|
@@ -293,7 +292,7 @@ declare namespace Connect {
|
|
293
292
|
* Handle server requests, punting them down
|
294
293
|
* the middleware stack.
|
295
294
|
*/
|
296
|
-
handle(req:
|
295
|
+
handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
|
297
296
|
|
298
297
|
/**
|
299
298
|
* Listen for connections.
|
@@ -317,10 +316,10 @@ declare namespace Connect {
|
|
317
316
|
* http.createServer(app).listen(80);
|
318
317
|
* https.createServer(options, app).listen(443);
|
319
318
|
*/
|
320
|
-
listen(port: number, hostname?: string, backlog?: number, callback?: Function):
|
321
|
-
listen(port: number, hostname?: string, callback?: Function):
|
322
|
-
listen(path: string, callback?: Function):
|
323
|
-
listen(handle: any, listeningListener?: Function):
|
319
|
+
listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
|
320
|
+
listen(port: number, hostname?: string, callback?: Function): http.Server;
|
321
|
+
listen(path: string, callback?: Function): http.Server;
|
322
|
+
listen(handle: any, listeningListener?: Function): http.Server;
|
324
323
|
}
|
325
324
|
}
|
326
325
|
//#endregion
|
@@ -342,7 +341,7 @@ declare namespace HttpProxy {
|
|
342
341
|
ciphers?: string | undefined;
|
343
342
|
secureProtocol?: string | undefined;
|
344
343
|
}
|
345
|
-
export type ErrorCallback = (err: Error, req:
|
344
|
+
export type ErrorCallback = (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target?: ProxyTargetUrl) => void;
|
346
345
|
export class Server extends events.EventEmitter {
|
347
346
|
/**
|
348
347
|
* Creates the proxy server with specified options.
|
@@ -357,7 +356,7 @@ declare namespace HttpProxy {
|
|
357
356
|
* @param options - Additional options.
|
358
357
|
* @param callback - Error callback.
|
359
358
|
*/
|
360
|
-
web(req:
|
359
|
+
web(req: http.IncomingMessage, res: http.ServerResponse, options?: ServerOptions, callback?: ErrorCallback): void;
|
361
360
|
|
362
361
|
/**
|
363
362
|
* Used for proxying regular HTTP(S) requests
|
@@ -367,7 +366,7 @@ declare namespace HttpProxy {
|
|
367
366
|
* @param options - Additional options.
|
368
367
|
* @param callback - Error callback.
|
369
368
|
*/
|
370
|
-
ws(req:
|
369
|
+
ws(req: http.IncomingMessage, socket: unknown, head: unknown, options?: ServerOptions, callback?: ErrorCallback): void;
|
371
370
|
|
372
371
|
/**
|
373
372
|
* A function that wraps the object in a webserver, for your convenience
|
@@ -403,13 +402,13 @@ declare namespace HttpProxy {
|
|
403
402
|
addListener(event: string, listener: () => void): this;
|
404
403
|
on(event: string, listener: () => void): this;
|
405
404
|
on(event: 'error', listener: ErrorCallback): this;
|
406
|
-
on(event: 'start', listener: (req:
|
407
|
-
on(event: 'proxyReq', listener: (proxyReq:
|
408
|
-
on(event: 'proxyRes', listener: (proxyRes:
|
409
|
-
on(event: 'proxyReqWs', listener: (proxyReq:
|
410
|
-
on(event: 'econnreset', listener: (err: Error, req:
|
411
|
-
on(event: 'end', listener: (req:
|
412
|
-
on(event: 'close', listener: (proxyRes:
|
405
|
+
on(event: 'start', listener: (req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl) => void): this;
|
406
|
+
on(event: 'proxyReq', listener: (proxyReq: http.ClientRequest, req: http.IncomingMessage, res: http.ServerResponse, options: ServerOptions) => void): this;
|
407
|
+
on(event: 'proxyRes', listener: (proxyRes: http.IncomingMessage, req: http.IncomingMessage, res: http.ServerResponse) => void): this;
|
408
|
+
on(event: 'proxyReqWs', listener: (proxyReq: http.ClientRequest, req: http.IncomingMessage, socket: net.Socket, options: ServerOptions, head: any) => void): this;
|
409
|
+
on(event: 'econnreset', listener: (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl) => void): this;
|
410
|
+
on(event: 'end', listener: (req: http.IncomingMessage, res: http.ServerResponse, proxyRes: http.IncomingMessage) => void): this;
|
411
|
+
on(event: 'close', listener: (proxyRes: http.IncomingMessage, proxySocket: net.Socket, proxyHead: any) => void): this;
|
413
412
|
once(event: string, listener: () => void): this;
|
414
413
|
removeListener(event: string, listener: () => void): this;
|
415
414
|
removeAllListeners(event?: string): this;
|
@@ -492,8 +491,8 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
|
|
492
491
|
/**
|
493
492
|
* webpack-dev-server style bypass function
|
494
493
|
*/
|
495
|
-
bypass?: (req:
|
496
|
-
res:
|
494
|
+
bypass?: (req: http.IncomingMessage, /** undefined for WebSocket upgrade requests */
|
495
|
+
res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
|
497
496
|
/**
|
498
497
|
* rewrite the Origin header of a WebSocket request to match the target
|
499
498
|
*
|
@@ -1773,214 +1772,8 @@ interface RollupDynamicImportVarsOptions {
|
|
1773
1772
|
warnOnError?: boolean;
|
1774
1773
|
}
|
1775
1774
|
//#endregion
|
1776
|
-
//#region src/types/terser.d.ts
|
1777
|
-
// Modified and inlined to avoid extra dependency
|
1778
|
-
// Source: https://github.com/terser/terser/blob/master/tools/terser.d.ts
|
1779
|
-
// BSD Licensed https://github.com/terser/terser/blob/master/LICENSE
|
1780
|
-
|
1781
|
-
declare namespace Terser {
|
1782
|
-
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
|
1783
|
-
export type ConsoleProperty = keyof typeof console;
|
1784
|
-
type DropConsoleOption = boolean | ConsoleProperty[];
|
1785
|
-
export interface ParseOptions {
|
1786
|
-
bare_returns?: boolean;
|
1787
|
-
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
1788
|
-
ecma?: ECMA;
|
1789
|
-
html5_comments?: boolean;
|
1790
|
-
shebang?: boolean;
|
1791
|
-
}
|
1792
|
-
export interface CompressOptions {
|
1793
|
-
arguments?: boolean;
|
1794
|
-
arrows?: boolean;
|
1795
|
-
booleans_as_integers?: boolean;
|
1796
|
-
booleans?: boolean;
|
1797
|
-
collapse_vars?: boolean;
|
1798
|
-
comparisons?: boolean;
|
1799
|
-
computed_props?: boolean;
|
1800
|
-
conditionals?: boolean;
|
1801
|
-
dead_code?: boolean;
|
1802
|
-
defaults?: boolean;
|
1803
|
-
directives?: boolean;
|
1804
|
-
drop_console?: DropConsoleOption;
|
1805
|
-
drop_debugger?: boolean;
|
1806
|
-
ecma?: ECMA;
|
1807
|
-
evaluate?: boolean;
|
1808
|
-
expression?: boolean;
|
1809
|
-
global_defs?: object;
|
1810
|
-
hoist_funs?: boolean;
|
1811
|
-
hoist_props?: boolean;
|
1812
|
-
hoist_vars?: boolean;
|
1813
|
-
ie8?: boolean;
|
1814
|
-
if_return?: boolean;
|
1815
|
-
inline?: boolean | InlineFunctions;
|
1816
|
-
join_vars?: boolean;
|
1817
|
-
keep_classnames?: boolean | RegExp;
|
1818
|
-
keep_fargs?: boolean;
|
1819
|
-
keep_fnames?: boolean | RegExp;
|
1820
|
-
keep_infinity?: boolean;
|
1821
|
-
loops?: boolean;
|
1822
|
-
module?: boolean;
|
1823
|
-
negate_iife?: boolean;
|
1824
|
-
passes?: number;
|
1825
|
-
properties?: boolean;
|
1826
|
-
pure_funcs?: string[];
|
1827
|
-
pure_new?: boolean;
|
1828
|
-
pure_getters?: boolean | 'strict';
|
1829
|
-
reduce_funcs?: boolean;
|
1830
|
-
reduce_vars?: boolean;
|
1831
|
-
sequences?: boolean | number;
|
1832
|
-
side_effects?: boolean;
|
1833
|
-
switches?: boolean;
|
1834
|
-
toplevel?: boolean;
|
1835
|
-
top_retain?: null | string | string[] | RegExp;
|
1836
|
-
typeofs?: boolean;
|
1837
|
-
unsafe_arrows?: boolean;
|
1838
|
-
unsafe?: boolean;
|
1839
|
-
unsafe_comps?: boolean;
|
1840
|
-
unsafe_Function?: boolean;
|
1841
|
-
unsafe_math?: boolean;
|
1842
|
-
unsafe_symbols?: boolean;
|
1843
|
-
unsafe_methods?: boolean;
|
1844
|
-
unsafe_proto?: boolean;
|
1845
|
-
unsafe_regexp?: boolean;
|
1846
|
-
unsafe_undefined?: boolean;
|
1847
|
-
unused?: boolean;
|
1848
|
-
}
|
1849
|
-
export enum InlineFunctions {
|
1850
|
-
Disabled = 0,
|
1851
|
-
SimpleFunctions = 1,
|
1852
|
-
WithArguments = 2,
|
1853
|
-
WithArgumentsAndVariables = 3,
|
1854
|
-
}
|
1855
|
-
export interface MangleOptions {
|
1856
|
-
eval?: boolean;
|
1857
|
-
keep_classnames?: boolean | RegExp;
|
1858
|
-
keep_fnames?: boolean | RegExp;
|
1859
|
-
module?: boolean;
|
1860
|
-
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
|
1861
|
-
properties?: boolean | ManglePropertiesOptions;
|
1862
|
-
reserved?: string[];
|
1863
|
-
safari10?: boolean;
|
1864
|
-
toplevel?: boolean;
|
1865
|
-
}
|
1866
|
-
|
1867
|
-
/**
|
1868
|
-
* An identifier mangler for which the output is invariant with respect to the source code.
|
1869
|
-
*/
|
1870
|
-
export interface SimpleIdentifierMangler {
|
1871
|
-
/**
|
1872
|
-
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
1873
|
-
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
1874
|
-
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
1875
|
-
* @param n The ordinal of the identifier.
|
1876
|
-
*/
|
1877
|
-
get(n: number): string;
|
1878
|
-
}
|
1879
|
-
|
1880
|
-
/**
|
1881
|
-
* An identifier mangler that leverages character frequency analysis to determine identifier precedence.
|
1882
|
-
*/
|
1883
|
-
export interface WeightedIdentifierMangler extends SimpleIdentifierMangler {
|
1884
|
-
/**
|
1885
|
-
* Modifies the internal weighting of the input characters by the specified delta.
|
1886
|
-
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
1887
|
-
* @param chars The characters to modify the weighting of.
|
1888
|
-
* @param delta The numeric weight to add to the characters.
|
1889
|
-
*/
|
1890
|
-
consider(chars: string, delta: number): number;
|
1891
|
-
/**
|
1892
|
-
* Resets character weights.
|
1893
|
-
*/
|
1894
|
-
reset(): void;
|
1895
|
-
/**
|
1896
|
-
* Sorts identifiers by character frequency, in preparation for calls to get(n).
|
1897
|
-
*/
|
1898
|
-
sort(): void;
|
1899
|
-
}
|
1900
|
-
export interface ManglePropertiesOptions {
|
1901
|
-
builtins?: boolean;
|
1902
|
-
debug?: boolean;
|
1903
|
-
keep_quoted?: boolean | 'strict';
|
1904
|
-
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
|
1905
|
-
regex?: RegExp | string;
|
1906
|
-
reserved?: string[];
|
1907
|
-
}
|
1908
|
-
export interface FormatOptions {
|
1909
|
-
ascii_only?: boolean;
|
1910
|
-
/** @deprecated Not implemented anymore */
|
1911
|
-
beautify?: boolean;
|
1912
|
-
braces?: boolean;
|
1913
|
-
comments?: boolean | 'all' | 'some' | RegExp | ((node: any, comment: {
|
1914
|
-
value: string;
|
1915
|
-
type: 'comment1' | 'comment2' | 'comment3' | 'comment4';
|
1916
|
-
pos: number;
|
1917
|
-
line: number;
|
1918
|
-
col: number;
|
1919
|
-
}) => boolean);
|
1920
|
-
ecma?: ECMA;
|
1921
|
-
ie8?: boolean;
|
1922
|
-
keep_numbers?: boolean;
|
1923
|
-
indent_level?: number;
|
1924
|
-
indent_start?: number;
|
1925
|
-
inline_script?: boolean;
|
1926
|
-
keep_quoted_props?: boolean;
|
1927
|
-
max_line_len?: number | false;
|
1928
|
-
preamble?: string;
|
1929
|
-
preserve_annotations?: boolean;
|
1930
|
-
quote_keys?: boolean;
|
1931
|
-
quote_style?: OutputQuoteStyle;
|
1932
|
-
safari10?: boolean;
|
1933
|
-
semicolons?: boolean;
|
1934
|
-
shebang?: boolean;
|
1935
|
-
shorthand?: boolean;
|
1936
|
-
source_map?: SourceMapOptions;
|
1937
|
-
webkit?: boolean;
|
1938
|
-
width?: number;
|
1939
|
-
wrap_iife?: boolean;
|
1940
|
-
wrap_func_args?: boolean;
|
1941
|
-
}
|
1942
|
-
export enum OutputQuoteStyle {
|
1943
|
-
PreferDouble = 0,
|
1944
|
-
AlwaysSingle = 1,
|
1945
|
-
AlwaysDouble = 2,
|
1946
|
-
AlwaysOriginal = 3,
|
1947
|
-
}
|
1948
|
-
export interface MinifyOptions {
|
1949
|
-
compress?: boolean | CompressOptions;
|
1950
|
-
ecma?: ECMA;
|
1951
|
-
enclose?: boolean | string;
|
1952
|
-
ie8?: boolean;
|
1953
|
-
keep_classnames?: boolean | RegExp;
|
1954
|
-
keep_fnames?: boolean | RegExp;
|
1955
|
-
mangle?: boolean | MangleOptions;
|
1956
|
-
module?: boolean;
|
1957
|
-
nameCache?: object;
|
1958
|
-
format?: FormatOptions;
|
1959
|
-
/** @deprecated */
|
1960
|
-
output?: FormatOptions;
|
1961
|
-
parse?: ParseOptions;
|
1962
|
-
safari10?: boolean;
|
1963
|
-
sourceMap?: boolean | SourceMapOptions;
|
1964
|
-
toplevel?: boolean;
|
1965
|
-
}
|
1966
|
-
export interface MinifyOutput {
|
1967
|
-
code?: string;
|
1968
|
-
map?: object | string;
|
1969
|
-
decoded_map?: object | null;
|
1970
|
-
}
|
1971
|
-
export interface SourceMapOptions {
|
1972
|
-
/** Source map object, 'inline' or source map file content */
|
1973
|
-
content?: object | string;
|
1974
|
-
includeSources?: boolean;
|
1975
|
-
filename?: string;
|
1976
|
-
root?: string;
|
1977
|
-
asObject?: boolean;
|
1978
|
-
url?: string | 'inline';
|
1979
|
-
}
|
1980
|
-
}
|
1981
|
-
//#endregion
|
1982
1775
|
//#region src/node/plugins/terser.d.ts
|
1983
|
-
interface TerserOptions extends
|
1776
|
+
interface TerserOptions extends TerserMinifyOptions {
|
1984
1777
|
/**
|
1985
1778
|
* Vite-specific option to specify the max number of workers to spawn
|
1986
1779
|
* when minifying files with terser.
|
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-Bsx9IwL8.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";
|
@@ -288,6 +288,7 @@ declare class EvaluatedModules {
|
|
288
288
|
getModuleSourceMapById(id: string): DecodedMap | null;
|
289
289
|
clear(): void;
|
290
290
|
}
|
291
|
+
declare function normalizeModuleId(file: string): string;
|
291
292
|
//#endregion
|
292
293
|
//#region src/module-runner/esmEvaluator.d.ts
|
293
294
|
declare class ESModulesEvaluator implements ModuleEvaluator {
|
@@ -296,4 +297,4 @@ declare class ESModulesEvaluator implements ModuleEvaluator {
|
|
296
297
|
runExternalModule(filepath: string): Promise<any>;
|
297
298
|
}
|
298
299
|
//#endregion
|
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 };
|
300
|
+
export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunction, FetchFunctionOptions, FetchResult, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunner, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ModuleRunnerTransport, ModuleRunnerTransportHandlers, ResolvedResult, SSRImportMetadata, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
|
@@ -1,13 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
* module ID with `\0`, a convention from the rollup ecosystem.
|
4
|
-
* This prevents other plugins from trying to process the id (like node resolution),
|
5
|
-
* and core features like sourcemaps can use this info to differentiate between
|
6
|
-
* virtual modules and regular files.
|
7
|
-
* `\0` is not a permitted char in import URLs so we have to replace them during
|
8
|
-
* import analysis. The id will be decoded back before entering the plugins pipeline.
|
9
|
-
* These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual
|
10
|
-
* modules in the browser end up encoded as `/@id/__x00__{id}`
|
2
|
+
* Prefix for resolved Ids that are not valid browser import specifiers
|
11
3
|
*/
|
12
4
|
const VALID_ID_PREFIX = "/@id/", NULL_BYTE_PLACEHOLDER = "__x00__";
|
13
5
|
let SOURCEMAPPING_URL = "sourceMa";
|
@@ -286,7 +278,7 @@ function getOriginalPosition(map, needle) {
|
|
286
278
|
let result = originalPositionFor(map, needle);
|
287
279
|
return result.column == null ? null : result;
|
288
280
|
}
|
289
|
-
const MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
281
|
+
const MODULE_RUNNER_SOURCEMAPPING_REGEXP = /* @__PURE__ */ RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
290
282
|
var EvaluatedModuleNode = class {
|
291
283
|
importers = /* @__PURE__ */ new Set();
|
292
284
|
imports = /* @__PURE__ */ new Set();
|
@@ -560,7 +552,7 @@ let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzr
|
|
560
552
|
};
|
561
553
|
function reviveInvokeError(e) {
|
562
554
|
let error = Error(e.message || "Unknown invoke error");
|
563
|
-
return Object.assign(error, e, { runnerError: Error("RunnerError") }), error;
|
555
|
+
return Object.assign(error, e, { runnerError: /* @__PURE__ */ Error("RunnerError") }), error;
|
564
556
|
}
|
565
557
|
const createInvokeableTransport = (transport) => {
|
566
558
|
if (transport.invoke) return {
|
@@ -604,7 +596,7 @@ const createInvokeableTransport = (transport) => {
|
|
604
596
|
},
|
605
597
|
disconnect() {
|
606
598
|
return rpcPromises.forEach((promise) => {
|
607
|
-
promise.reject(Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
|
599
|
+
promise.reject(/* @__PURE__ */ Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
|
608
600
|
}), rpcPromises.clear(), transport.disconnect?.();
|
609
601
|
},
|
610
602
|
send(data) {
|
@@ -621,7 +613,7 @@ const createInvokeableTransport = (transport) => {
|
|
621
613
|
}
|
622
614
|
}, sendPromise = transport.send(wrappedData), { promise, resolve: resolve$1, reject } = promiseWithResolvers(), timeout = transport.timeout ?? 6e4, timeoutId;
|
623
615
|
timeout > 0 && (timeoutId = setTimeout(() => {
|
624
|
-
rpcPromises.delete(promiseId), reject(Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
|
616
|
+
rpcPromises.delete(promiseId), reject(/* @__PURE__ */ Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
|
625
617
|
}, timeout), timeoutId?.unref?.()), rpcPromises.set(promiseId, {
|
626
618
|
resolve: resolve$1,
|
627
619
|
reject,
|
@@ -685,7 +677,7 @@ const createInvokeableTransport = (transport) => {
|
|
685
677
|
isOpened = !0, resolve$1();
|
686
678
|
}, { once: !0 }), socket.addEventListener("close", async () => {
|
687
679
|
if (!isOpened) {
|
688
|
-
reject(Error("WebSocket closed without opened."));
|
680
|
+
reject(/* @__PURE__ */ Error("WebSocket closed without opened."));
|
689
681
|
return;
|
690
682
|
}
|
691
683
|
onMessage({
|
@@ -1179,4 +1171,4 @@ function exportAll(exports, sourceModule) {
|
|
1179
1171
|
} catch {}
|
1180
1172
|
}
|
1181
1173
|
}
|
1182
|
-
export { ESModulesEvaluator, EvaluatedModules, ModuleRunner, createWebSocketModuleRunnerTransport, ssrDynamicImportKey, ssrExportAllKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
|
1174
|
+
export { ESModulesEvaluator, EvaluatedModules, ModuleRunner, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "7.0.0
|
3
|
+
"version": "7.0.0",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"esbuild": "^0.25.0",
|
72
72
|
"fdir": "^6.4.6",
|
73
73
|
"picomatch": "^4.0.2",
|
74
|
-
"postcss": "^8.5.
|
74
|
+
"postcss": "^8.5.6",
|
75
75
|
"rollup": "^4.40.0",
|
76
76
|
"tinyglobby": "^0.2.14"
|
77
77
|
},
|
@@ -86,9 +86,9 @@
|
|
86
86
|
"@oxc-project/types": "^0.70.0",
|
87
87
|
"@polka/compression": "^1.0.0-next.25",
|
88
88
|
"@rollup/plugin-alias": "^5.1.1",
|
89
|
-
"@rollup/plugin-commonjs": "^28.0.
|
89
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
90
90
|
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
91
|
-
"@rollup/pluginutils": "^5.
|
91
|
+
"@rollup/pluginutils": "^5.2.0",
|
92
92
|
"@types/escape-html": "^1.0.4",
|
93
93
|
"@types/pnpapi": "^0.0.5",
|
94
94
|
"artichokie": "^0.3.1",
|
@@ -120,19 +120,19 @@
|
|
120
120
|
"pathe": "^2.0.3",
|
121
121
|
"periscopic": "^4.0.2",
|
122
122
|
"picocolors": "^1.1.1",
|
123
|
-
"postcss-import": "^16.1.
|
123
|
+
"postcss-import": "^16.1.1",
|
124
124
|
"postcss-load-config": "^6.0.1",
|
125
125
|
"postcss-modules": "^6.0.1",
|
126
126
|
"premove": "^4.0.0",
|
127
127
|
"resolve.exports": "^2.0.3",
|
128
|
-
"rolldown": "^1.0.0-beta.
|
129
|
-
"rolldown-plugin-dts": "^0.13.
|
128
|
+
"rolldown": "^1.0.0-beta.19",
|
129
|
+
"rolldown-plugin-dts": "^0.13.12",
|
130
130
|
"rollup-plugin-license": "^3.6.0",
|
131
131
|
"sass": "^1.89.2",
|
132
132
|
"sass-embedded": "^1.89.2",
|
133
133
|
"sirv": "^3.0.1",
|
134
134
|
"strip-literal": "^3.0.0",
|
135
|
-
"terser": "^5.
|
135
|
+
"terser": "^5.43.1",
|
136
136
|
"tsconfck": "^3.1.6",
|
137
137
|
"types": "link:./types",
|
138
138
|
"ufo": "^1.6.1",
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
2
|
+
|
3
|
+
// @ts-ignore `terser` may not be installed
|
4
|
+
export type * as Terser from 'terser'
|
5
|
+
// @ts-ignore `terser` may not be installed
|
6
|
+
import type * as Terser from 'terser'
|
7
|
+
|
8
|
+
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
9
|
+
|
10
|
+
export type TerserMinifyOptions = Terser.MinifyOptions
|
11
|
+
export type TerserMinifyOutput = Terser.MinifyOutput
|