vite 7.1.11 → 7.2.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 +81 -81
- package/dist/client/client.mjs +4 -4
- package/dist/node/chunks/build.js +2 -2
- package/dist/node/chunks/build2.js +2 -2
- package/dist/node/chunks/chunk.js +1 -1
- package/dist/node/chunks/config.js +20612 -20393
- package/dist/node/chunks/config2.js +2 -2
- package/dist/node/chunks/dist.js +1 -1
- package/dist/node/chunks/lib.js +2 -2
- package/dist/node/chunks/logger.js +11 -2
- package/dist/node/chunks/moduleRunnerTransport.d.ts +28 -27
- package/dist/node/chunks/optimizer.js +2 -2
- package/dist/node/chunks/postcss-import.js +2 -2
- package/dist/node/chunks/preview.js +2 -2
- package/dist/node/chunks/server.js +2 -2
- package/dist/node/cli.js +2 -2
- package/dist/node/index.d.ts +1292 -1259
- package/dist/node/index.js +2 -2
- package/dist/node/module-runner.d.ts +82 -78
- package/dist/node/module-runner.js +47 -13
- package/package.json +10 -10
- package/types/customEvent.d.ts +5 -0
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { F as defaultAllowedOrigins, N as VERSION, _ as DEFAULT_SERVER_CONDITIONS, d as DEFAULT_CLIENT_MAIN_FIELDS, h as DEFAULT_EXTERNAL_CONDITIONS, n as createLogger, u as DEFAULT_CLIENT_CONDITIONS, v as DEFAULT_SERVER_MAIN_FIELDS } from "./chunks/logger.js";
|
|
2
|
+
import { Ct as perEnvironmentPlugin, Dt as mergeConfig, Et as mergeAlias, J as optimizeDeps, Ot as normalizePath, St as perEnvironmentState, Tt as isCSSRequest, _ as build, _t as createServerModuleRunnerTransport, b as createBuilder, bt as resolveEnvPrefix, c as sortUserPlugins, dt as searchForWorkspaceRoot, f as createRunnableDevEnvironment, ft as isFileLoadingAllowed, g as BuildEnvironment, gt as createServerModuleRunner, h as fetchModule, ht as ssrTransform, i as loadConfigFromFile, it as createServerHotChannel, kt as rollupVersion, l as runnerImport, m as DevEnvironment, mt as send, nt as preprocessCSS, o as resolveConfig, ot as createServer, p as isRunnableDevEnvironment, pt as isFileServingAllowed, rt as createIdResolver, t as defineConfig, tt as formatPostcssSourceMap, u as preview, vt as buildErrorMessage, wt as createFilter, xt as transformWithEsbuild, yt as loadEnv } from "./chunks/config.js";
|
|
3
3
|
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
|
4
4
|
import { version as esbuildVersion } from "esbuild";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExternalFetchResult,
|
|
1
|
+
import { a as ExternalFetchResult, c as ViteFetchResult, i as createWebSocketModuleRunnerTransport, n as ModuleRunnerTransportHandlers, o as FetchFunctionOptions, r as NormalizedModuleRunnerTransport, s as FetchResult, t as ModuleRunnerTransport } from "./chunks/moduleRunnerTransport.js";
|
|
2
2
|
import { ModuleNamespace, ViteHotContext } from "#types/hot";
|
|
3
3
|
import { HotPayload, Update } from "#types/hmrPayload";
|
|
4
4
|
import { InferCustomEventPayload } from "#types/customEvent";
|
|
@@ -17,6 +17,7 @@ declare class DecodedMap {
|
|
|
17
17
|
_decoded: undefined | number[][][];
|
|
18
18
|
_decodedMemo: Stats;
|
|
19
19
|
url: string;
|
|
20
|
+
file: string;
|
|
20
21
|
version: number;
|
|
21
22
|
names: string[];
|
|
22
23
|
resolvedSources: string[];
|
|
@@ -62,10 +63,10 @@ declare class HMRClient {
|
|
|
62
63
|
private updateQueue;
|
|
63
64
|
private pendingUpdateQueue;
|
|
64
65
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
* buffer multiple hot updates triggered by the same src change
|
|
67
|
+
* so that they are invoked in the same order they were sent.
|
|
68
|
+
* (otherwise the order may be inconsistent because of the http request round trip)
|
|
69
|
+
*/
|
|
69
70
|
queueUpdate(payload: Update): Promise<void>;
|
|
70
71
|
private fetchUpdate;
|
|
71
72
|
}
|
|
@@ -73,14 +74,14 @@ declare class HMRClient {
|
|
|
73
74
|
//#region src/shared/ssrTransform.d.ts
|
|
74
75
|
interface DefineImportMetadata {
|
|
75
76
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
* Imported names before being transformed to `ssrImportKey`
|
|
78
|
+
*
|
|
79
|
+
* import foo, { bar as baz, qux } from 'hello'
|
|
80
|
+
* => ['default', 'bar', 'qux']
|
|
81
|
+
*
|
|
82
|
+
* import * as namespace from 'world
|
|
83
|
+
* => undefined
|
|
84
|
+
*/
|
|
84
85
|
importedNames?: string[];
|
|
85
86
|
}
|
|
86
87
|
interface SSRImportMetadata extends DefineImportMetadata {
|
|
@@ -108,30 +109,33 @@ declare class ModuleRunner {
|
|
|
108
109
|
private readonly transport;
|
|
109
110
|
private readonly resetSourceMapSupport?;
|
|
110
111
|
private readonly concurrentModuleNodePromises;
|
|
112
|
+
private isBuiltin?;
|
|
113
|
+
private builtinsPromise?;
|
|
111
114
|
private closed;
|
|
112
115
|
constructor(options: ModuleRunnerOptions, evaluator?: ModuleEvaluator, debug?: ModuleRunnerDebugger | undefined);
|
|
113
116
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
* URL to execute. Accepts file path, server path or id relative to the root.
|
|
118
|
+
*/
|
|
116
119
|
import<T = any>(url: string): Promise<T>;
|
|
117
120
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
* Clear all caches including HMR listeners.
|
|
122
|
+
*/
|
|
120
123
|
clearCache(): void;
|
|
121
124
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
* Clears all caches, removes all HMR listeners, and resets source map support.
|
|
126
|
+
* This method doesn't stop the HMR connection.
|
|
127
|
+
*/
|
|
125
128
|
close(): Promise<void>;
|
|
126
129
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
* Returns `true` if the runtime has been closed by calling `close()` method.
|
|
131
|
+
*/
|
|
129
132
|
isClosed(): boolean;
|
|
130
133
|
private processImport;
|
|
131
134
|
private isCircularModule;
|
|
132
135
|
private isCircularImport;
|
|
133
136
|
private cachedRequest;
|
|
134
137
|
private cachedModule;
|
|
138
|
+
private ensureBuiltins;
|
|
135
139
|
private getModuleInformation;
|
|
136
140
|
protected directRequest(url: string, mod: EvaluatedModuleNode, _callstack: string[]): Promise<any>;
|
|
137
141
|
}
|
|
@@ -168,20 +172,20 @@ interface ModuleRunnerContext {
|
|
|
168
172
|
}
|
|
169
173
|
interface ModuleEvaluator {
|
|
170
174
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
* Number of prefixed lines in the transformed code.
|
|
176
|
+
*/
|
|
173
177
|
startOffset?: number;
|
|
174
178
|
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
* Run code that was transformed by Vite.
|
|
180
|
+
* @param context Function context
|
|
181
|
+
* @param code Transformed code
|
|
182
|
+
* @param module The module node
|
|
183
|
+
*/
|
|
180
184
|
runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
|
|
181
185
|
/**
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
186
|
+
* Run externalized module.
|
|
187
|
+
* @param file File URL to the external module
|
|
188
|
+
*/
|
|
185
189
|
runExternalModule(file: string): Promise<any>;
|
|
186
190
|
}
|
|
187
191
|
type ResolvedResult = (ExternalFetchResult | ViteFetchResult) & {
|
|
@@ -191,36 +195,36 @@ type ResolvedResult = (ExternalFetchResult | ViteFetchResult) & {
|
|
|
191
195
|
type FetchFunction = (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
|
192
196
|
interface ModuleRunnerHmr {
|
|
193
197
|
/**
|
|
194
|
-
|
|
195
|
-
|
|
198
|
+
* Configure HMR logger.
|
|
199
|
+
*/
|
|
196
200
|
logger?: false | HMRLogger;
|
|
197
201
|
}
|
|
198
202
|
interface ModuleRunnerOptions {
|
|
199
203
|
/**
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
* A set of methods to communicate with the server.
|
|
205
|
+
*/
|
|
202
206
|
transport: ModuleRunnerTransport;
|
|
203
207
|
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
sourcemapInterceptor?: false |
|
|
208
|
+
* Configure how source maps are resolved. Prefers `node` if `process.setSourceMapsEnabled` is available.
|
|
209
|
+
* Otherwise it will use `prepareStackTrace` by default which overrides `Error.prepareStackTrace` method.
|
|
210
|
+
* You can provide an object to configure how file contents and source maps are resolved for files that were not processed by Vite.
|
|
211
|
+
*/
|
|
212
|
+
sourcemapInterceptor?: false | "node" | "prepareStackTrace" | InterceptorOptions;
|
|
209
213
|
/**
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
* Disable HMR or configure HMR options.
|
|
215
|
+
*
|
|
216
|
+
* @default true
|
|
217
|
+
*/
|
|
214
218
|
hmr?: boolean | ModuleRunnerHmr;
|
|
215
219
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
* Create import.meta object for the module.
|
|
221
|
+
*
|
|
222
|
+
* @default createDefaultImportMeta
|
|
223
|
+
*/
|
|
220
224
|
createImportMeta?: (modulePath: string) => ModuleRunnerImportMeta | Promise<ModuleRunnerImportMeta>;
|
|
221
225
|
/**
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
* Custom module cache. If not provided, creates a separate module cache for each ModuleRunner instance.
|
|
227
|
+
*/
|
|
224
228
|
evaluatedModules?: EvaluatedModules;
|
|
225
229
|
}
|
|
226
230
|
interface ImportMetaEnv {
|
|
@@ -251,40 +255,40 @@ declare class EvaluatedModules {
|
|
|
251
255
|
readonly fileToModulesMap: Map<string, Set<EvaluatedModuleNode>>;
|
|
252
256
|
readonly urlToIdModuleMap: Map<string, EvaluatedModuleNode>;
|
|
253
257
|
/**
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
* Returns the module node by the resolved module ID. Usually, module ID is
|
|
259
|
+
* the file system path with query and/or hash. It can also be a virtual module.
|
|
260
|
+
*
|
|
261
|
+
* Module runner graph will have 1 to 1 mapping with the server module graph.
|
|
262
|
+
* @param id Resolved module ID
|
|
263
|
+
*/
|
|
260
264
|
getModuleById(id: string): EvaluatedModuleNode | undefined;
|
|
261
265
|
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
* Returns all modules related to the file system path. Different modules
|
|
267
|
+
* might have different query parameters or hash, so it's possible to have
|
|
268
|
+
* multiple modules for the same file.
|
|
269
|
+
* @param file The file system path of the module
|
|
270
|
+
*/
|
|
267
271
|
getModulesByFile(file: string): Set<EvaluatedModuleNode> | undefined;
|
|
268
272
|
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
* Returns the module node by the URL that was used in the import statement.
|
|
274
|
+
* Unlike module graph on the server, the URL is not resolved and is used as is.
|
|
275
|
+
* @param url Server URL that was used in the import statement
|
|
276
|
+
*/
|
|
273
277
|
getModuleByUrl(url: string): EvaluatedModuleNode | undefined;
|
|
274
278
|
/**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
* Ensure that module is in the graph. If the module is already in the graph,
|
|
280
|
+
* it will return the existing module node. Otherwise, it will create a new
|
|
281
|
+
* module node and add it to the graph.
|
|
282
|
+
* @param id Resolved module ID
|
|
283
|
+
* @param url URL that was used in the import statement
|
|
284
|
+
*/
|
|
281
285
|
ensureModule(id: string, url: string): EvaluatedModuleNode;
|
|
282
286
|
invalidateModule(node: EvaluatedModuleNode): void;
|
|
283
287
|
/**
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
* Extracts the inlined source map from the module code and returns the decoded
|
|
289
|
+
* source map. If the source map is not inlined, it will return null.
|
|
290
|
+
* @param id Resolved module ID
|
|
291
|
+
*/
|
|
288
292
|
getModuleSourceMapById(id: string): DecodedMap | null;
|
|
289
293
|
clear(): void;
|
|
290
294
|
}
|
|
@@ -300,8 +304,8 @@ declare class ESModulesEvaluator implements ModuleEvaluator {
|
|
|
300
304
|
//#region src/module-runner/createImportMeta.d.ts
|
|
301
305
|
declare function createDefaultImportMeta(modulePath: string): ModuleRunnerImportMeta;
|
|
302
306
|
/**
|
|
303
|
-
|
|
304
|
-
|
|
307
|
+
* Create import.meta object for Node.js.
|
|
308
|
+
*/
|
|
305
309
|
declare function createNodeImportMeta(modulePath: string): Promise<ModuleRunnerImportMeta>;
|
|
306
310
|
//#endregion
|
|
307
311
|
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 };
|
|
@@ -216,13 +216,16 @@ var DecodedMap = class {
|
|
|
216
216
|
_decoded;
|
|
217
217
|
_decodedMemo;
|
|
218
218
|
url;
|
|
219
|
+
file;
|
|
219
220
|
version;
|
|
220
221
|
names = [];
|
|
221
222
|
resolvedSources;
|
|
222
223
|
constructor(map, from) {
|
|
223
224
|
this.map = map;
|
|
224
225
|
let { mappings, names, sources } = map;
|
|
225
|
-
this.version = map.version, this.names = names || [], this._encoded = mappings || "", this._decodedMemo = memoizedState(), this.url = from, this.
|
|
226
|
+
this.version = map.version, this.names = names || [], this._encoded = mappings || "", this._decodedMemo = memoizedState(), this.url = from, this.file = from;
|
|
227
|
+
let originDir = posixDirname(from);
|
|
228
|
+
this.resolvedSources = (sources || []).map((s) => posixResolve(originDir, s || ""));
|
|
226
229
|
}
|
|
227
230
|
};
|
|
228
231
|
function memoizedState() {
|
|
@@ -619,7 +622,12 @@ const createInvokeableTransport = (transport) => {
|
|
|
619
622
|
ws.send(JSON.stringify(data));
|
|
620
623
|
}
|
|
621
624
|
};
|
|
622
|
-
}
|
|
625
|
+
};
|
|
626
|
+
function createIsBuiltin(builtins) {
|
|
627
|
+
let plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin == "string")), regexBuiltins = builtins.filter((builtin) => typeof builtin != "string");
|
|
628
|
+
return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));
|
|
629
|
+
}
|
|
630
|
+
const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrExportNameKey = "__vite_ssr_exportName__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {}, silentConsole = {
|
|
623
631
|
debug: noop,
|
|
624
632
|
error: noop
|
|
625
633
|
}, hmrLogger = {
|
|
@@ -917,11 +925,17 @@ export async function resolve(specifier, context, nextResolve) {
|
|
|
917
925
|
specifier = parsedSpecifier
|
|
918
926
|
context.parentURL = parsedImporter
|
|
919
927
|
}
|
|
920
|
-
|
|
921
928
|
return nextResolve(specifier, context)
|
|
922
929
|
}
|
|
923
930
|
|
|
924
931
|
`;
|
|
932
|
+
function customizationHookResolve(specifier, context, nextResolve) {
|
|
933
|
+
if (specifier.startsWith(customizationHookNamespace)) {
|
|
934
|
+
let data = specifier.slice(42), [parsedSpecifier, parsedImporter] = JSON.parse(data);
|
|
935
|
+
specifier = parsedSpecifier, context.parentURL = parsedImporter;
|
|
936
|
+
}
|
|
937
|
+
return nextResolve(specifier, context);
|
|
938
|
+
}
|
|
925
939
|
async function createImportMetaResolver() {
|
|
926
940
|
let module;
|
|
927
941
|
try {
|
|
@@ -929,17 +943,24 @@ async function createImportMetaResolver() {
|
|
|
929
943
|
} catch {
|
|
930
944
|
return;
|
|
931
945
|
}
|
|
932
|
-
if (module
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
946
|
+
if (module) {
|
|
947
|
+
if (module.registerHooks) return module.registerHooks({ resolve: customizationHookResolve }), importMetaResolveWithCustomHook;
|
|
948
|
+
if (module.register) {
|
|
949
|
+
try {
|
|
950
|
+
let hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`;
|
|
951
|
+
module.register(hookModuleContent);
|
|
952
|
+
} catch (e) {
|
|
953
|
+
if ("code" in e && e.code === "ERR_NETWORK_IMPORT_DISALLOWED") return;
|
|
954
|
+
throw e;
|
|
955
|
+
}
|
|
956
|
+
return importMetaResolveWithCustomHook;
|
|
939
957
|
}
|
|
940
|
-
return (specifier, importer) => import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
|
|
941
958
|
}
|
|
942
959
|
}
|
|
960
|
+
function importMetaResolveWithCustomHook(specifier, importer) {
|
|
961
|
+
return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
|
|
962
|
+
}
|
|
963
|
+
`${customizationHookNamespace}`;
|
|
943
964
|
const envProxy = new Proxy({}, { get(_, p) {
|
|
944
965
|
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
|
|
945
966
|
} });
|
|
@@ -977,6 +998,8 @@ var ModuleRunner = class {
|
|
|
977
998
|
transport;
|
|
978
999
|
resetSourceMapSupport;
|
|
979
1000
|
concurrentModuleNodePromises = /* @__PURE__ */ new Map();
|
|
1001
|
+
isBuiltin;
|
|
1002
|
+
builtinsPromise;
|
|
980
1003
|
closed = !1;
|
|
981
1004
|
constructor(options, evaluator = new ESModulesEvaluator(), debug) {
|
|
982
1005
|
if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
|
|
@@ -1043,10 +1066,21 @@ var ModuleRunner = class {
|
|
|
1043
1066
|
}
|
|
1044
1067
|
return cached;
|
|
1045
1068
|
}
|
|
1069
|
+
ensureBuiltins() {
|
|
1070
|
+
if (!this.isBuiltin) return this.builtinsPromise ??= (async () => {
|
|
1071
|
+
try {
|
|
1072
|
+
this.debug?.("[module runner] fetching builtins from server");
|
|
1073
|
+
let builtins = await this.transport.invoke("getBuiltins", []);
|
|
1074
|
+
this.isBuiltin = createIsBuiltin(builtins), this.debug?.("[module runner] builtins loaded:", builtins);
|
|
1075
|
+
} finally {
|
|
1076
|
+
this.builtinsPromise = void 0;
|
|
1077
|
+
}
|
|
1078
|
+
})(), this.builtinsPromise;
|
|
1079
|
+
}
|
|
1046
1080
|
async getModuleInformation(url, importer, cachedModule) {
|
|
1047
1081
|
if (this.closed) throw Error("Vite module runner has been closed.");
|
|
1048
|
-
this.debug?.("[module runner] fetching", url);
|
|
1049
|
-
let isCached = !!(typeof cachedModule == "object" && cachedModule.meta), fetchedModule = url.startsWith("data:") ? {
|
|
1082
|
+
await this.ensureBuiltins(), this.debug?.("[module runner] fetching", url);
|
|
1083
|
+
let isCached = !!(typeof cachedModule == "object" && cachedModule.meta), fetchedModule = url.startsWith("data:") || this.isBuiltin?.(url) ? {
|
|
1050
1084
|
externalize: url,
|
|
1051
1085
|
type: "builtin"
|
|
1052
1086
|
} : await this.transport.invoke("fetchModule", [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -79,20 +79,20 @@
|
|
|
79
79
|
"fsevents": "~2.3.3"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@babel/parser": "^7.28.
|
|
82
|
+
"@babel/parser": "^7.28.5",
|
|
83
83
|
"@jridgewell/remapping": "^2.3.5",
|
|
84
84
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
85
|
-
"@oxc-project/types": "0.
|
|
85
|
+
"@oxc-project/types": "0.95.0",
|
|
86
86
|
"@polka/compression": "^1.0.0-next.25",
|
|
87
|
-
"@rolldown/pluginutils": "^1.0.0-beta.
|
|
87
|
+
"@rolldown/pluginutils": "^1.0.0-beta.44",
|
|
88
88
|
"@rollup/plugin-alias": "^5.1.1",
|
|
89
|
-
"@rollup/plugin-commonjs": "
|
|
89
|
+
"@rollup/plugin-commonjs": "28.0.6",
|
|
90
90
|
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
|
91
91
|
"@rollup/pluginutils": "^5.3.0",
|
|
92
92
|
"@types/escape-html": "^1.0.4",
|
|
93
93
|
"@types/pnpapi": "^0.0.5",
|
|
94
94
|
"artichokie": "^0.4.2",
|
|
95
|
-
"baseline-browser-mapping": "^2.8.
|
|
95
|
+
"baseline-browser-mapping": "^2.8.20",
|
|
96
96
|
"cac": "^6.7.14",
|
|
97
97
|
"chokidar": "^3.6.0",
|
|
98
98
|
"connect": "^3.7.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"http-proxy-3": "^1.22.0",
|
|
111
111
|
"launch-editor-middleware": "^2.11.1",
|
|
112
112
|
"lightningcss": "^1.30.2",
|
|
113
|
-
"magic-string": "^0.30.
|
|
113
|
+
"magic-string": "^0.30.21",
|
|
114
114
|
"mlly": "^1.8.0",
|
|
115
115
|
"mrmime": "^2.0.1",
|
|
116
116
|
"nanoid": "^5.1.6",
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
"postcss-modules": "^6.0.1",
|
|
125
125
|
"premove": "^4.0.0",
|
|
126
126
|
"resolve.exports": "^2.0.3",
|
|
127
|
-
"rolldown": "^1.0.0-beta.
|
|
128
|
-
"rolldown-plugin-dts": "^0.
|
|
127
|
+
"rolldown": "^1.0.0-beta.44",
|
|
128
|
+
"rolldown-plugin-dts": "^0.17.1",
|
|
129
129
|
"rollup-plugin-license": "^3.6.0",
|
|
130
130
|
"sass": "^1.93.2",
|
|
131
131
|
"sass-embedded": "^1.93.2",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"build-types": "pnpm build-types-roll && pnpm build-types-check",
|
|
192
192
|
"build-types-roll": "rolldown --config rolldown.dts.config.ts",
|
|
193
193
|
"build-types-check": "tsc --project tsconfig.check.json",
|
|
194
|
-
"typecheck": "tsc && tsc -p src/node",
|
|
194
|
+
"typecheck": "tsc && tsc -p src/node && tsc -p src/module-runner && tsc -p src/shared && tsc -p src/node/__tests_dts__",
|
|
195
195
|
"lint": "eslint --cache --ext .ts src/**",
|
|
196
196
|
"format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
|
|
197
197
|
"generate-target": "tsx scripts/generateTarget.ts"
|
package/types/customEvent.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
} from './hmrPayload'
|
|
7
7
|
|
|
8
8
|
export interface CustomEventMap {
|
|
9
|
+
// client events
|
|
9
10
|
'vite:beforeUpdate': UpdatePayload
|
|
10
11
|
'vite:afterUpdate': UpdatePayload
|
|
11
12
|
'vite:beforePrune': PrunePayload
|
|
@@ -14,6 +15,10 @@ export interface CustomEventMap {
|
|
|
14
15
|
'vite:invalidate': InvalidatePayload
|
|
15
16
|
'vite:ws:connect': WebSocketConnectionPayload
|
|
16
17
|
'vite:ws:disconnect': WebSocketConnectionPayload
|
|
18
|
+
|
|
19
|
+
// server events
|
|
20
|
+
'vite:client:connect': undefined
|
|
21
|
+
'vite:client:disconnect': undefined
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export interface WebSocketConnectionPayload {
|