vite 7.0.0-beta.0 → 7.0.0-beta.2
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-CCzsqxOh.js → dep-8cccGkwy.js} +51 -51
- package/dist/node/chunks/{dep-RiwDEHuV.js → dep-BO5GbxpL.js} +3 -3
- package/dist/node/chunks/{dep-FHYvcJhE.js → dep-BYhaRSbV.js} +22 -22
- package/dist/node/chunks/{dep-3jlWaCfC.js → dep-B_m28uIY.js} +1 -1
- package/dist/node/chunks/{dep-bvBD1i2C.js → dep-Bkc4tc5S.js} +627 -592
- package/dist/node/chunks/{dep-P8c3Tybu.js → dep-C5h9brB_.js} +1 -1
- package/dist/node/chunks/{dep-D_UgUiRQ.js → dep-CZ6VYVb7.js} +1 -1
- package/dist/node/chunks/{dep-Ccq9jQdz.js → dep-DZ1Lk4oF.js} +1 -1
- package/dist/node/chunks/{dep-D5HXLrlI.js → dep-DmY5m86w.js} +1 -1
- package/dist/node/chunks/{dep-B4i1tHPo.js → dep-Drtntmtt.js} +2 -1
- 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 +11 -12
- package/types/importGlob.d.ts +4 -0
- package/types/internal/cssPreprocessorOptions.d.ts +3 -3
@@ -288,8 +288,8 @@ function getOriginalPosition(map, needle) {
|
|
288
288
|
}
|
289
289
|
const MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
290
290
|
var EvaluatedModuleNode = class {
|
291
|
-
importers = new Set();
|
292
|
-
imports = new Set();
|
291
|
+
importers = /* @__PURE__ */ new Set();
|
292
|
+
imports = /* @__PURE__ */ new Set();
|
293
293
|
evaluated = !1;
|
294
294
|
meta;
|
295
295
|
promise;
|
@@ -300,9 +300,9 @@ var EvaluatedModuleNode = class {
|
|
300
300
|
this.id = id, this.url = url, this.file = cleanUrl(id);
|
301
301
|
}
|
302
302
|
}, EvaluatedModules = class {
|
303
|
-
idToModuleMap = new Map();
|
304
|
-
fileToModulesMap = new Map();
|
305
|
-
urlToIdModuleMap = new Map();
|
303
|
+
idToModuleMap = /* @__PURE__ */ new Map();
|
304
|
+
fileToModulesMap = /* @__PURE__ */ new Map();
|
305
|
+
urlToIdModuleMap = /* @__PURE__ */ new Map();
|
306
306
|
/**
|
307
307
|
* Returns the module node by the resolved module ID. Usually, module ID is
|
308
308
|
* the file system path with query and/or hash. It can also be a virtual module.
|
@@ -344,7 +344,7 @@ var EvaluatedModuleNode = class {
|
|
344
344
|
}
|
345
345
|
let moduleNode = new EvaluatedModuleNode(id, url);
|
346
346
|
this.idToModuleMap.set(id, moduleNode), this.urlToIdModuleMap.set(url, moduleNode);
|
347
|
-
let fileModules = this.fileToModulesMap.get(moduleNode.file) || new Set();
|
347
|
+
let fileModules = this.fileToModulesMap.get(moduleNode.file) || /* @__PURE__ */ new Set();
|
348
348
|
return fileModules.add(moduleNode), this.fileToModulesMap.set(moduleNode.file, fileModules), moduleNode;
|
349
349
|
}
|
350
350
|
invalidateModule(node) {
|
@@ -389,7 +389,7 @@ var HMRContext = class {
|
|
389
389
|
let listeners = hmrClient.customListenersMap.get(event);
|
390
390
|
listeners && hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
391
391
|
}
|
392
|
-
this.newListeners = new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
|
392
|
+
this.newListeners = /* @__PURE__ */ new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
|
393
393
|
}
|
394
394
|
get data() {
|
395
395
|
return this.hmrClient.dataMap.get(this.ownerPath);
|
@@ -460,12 +460,12 @@ var HMRContext = class {
|
|
460
460
|
}), this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
461
461
|
}
|
462
462
|
}, HMRClient = class {
|
463
|
-
hotModulesMap = new Map();
|
464
|
-
disposeMap = new Map();
|
465
|
-
pruneMap = new Map();
|
466
|
-
dataMap = new Map();
|
467
|
-
customListenersMap = new Map();
|
468
|
-
ctxToListenersMap = new Map();
|
463
|
+
hotModulesMap = /* @__PURE__ */ new Map();
|
464
|
+
disposeMap = /* @__PURE__ */ new Map();
|
465
|
+
pruneMap = /* @__PURE__ */ new Map();
|
466
|
+
dataMap = /* @__PURE__ */ new Map();
|
467
|
+
customListenersMap = /* @__PURE__ */ new Map();
|
468
|
+
ctxToListenersMap = /* @__PURE__ */ new Map();
|
469
469
|
currentFirstInvalidatedBy;
|
470
470
|
constructor(logger, transport, importUpdatedModule) {
|
471
471
|
this.logger = logger, this.transport = transport, this.importUpdatedModule = importUpdatedModule;
|
@@ -580,7 +580,7 @@ const createInvokeableTransport = (transport) => {
|
|
580
580
|
}
|
581
581
|
};
|
582
582
|
if (!transport.send || !transport.connect) throw Error("transport must implement send and connect when invoke is not implemented");
|
583
|
-
let rpcPromises = new Map();
|
583
|
+
let rpcPromises = /* @__PURE__ */ new Map();
|
584
584
|
return {
|
585
585
|
...transport,
|
586
586
|
connect({ onMessage, onDisconnection }) {
|
@@ -709,7 +709,7 @@ const createInvokeableTransport = (transport) => {
|
|
709
709
|
ws.send(JSON.stringify(data));
|
710
710
|
}
|
711
711
|
};
|
712
|
-
}, ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {}, silentConsole = {
|
712
|
+
}, 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 = {
|
713
713
|
debug: noop,
|
714
714
|
error: noop
|
715
715
|
}, hmrLogger = {
|
@@ -788,7 +788,7 @@ function getModulesByFile(runner, file) {
|
|
788
788
|
let nodes = runner.evaluatedModules.getModulesByFile(file);
|
789
789
|
return nodes ? [...nodes].map((node) => node.id) : [];
|
790
790
|
}
|
791
|
-
function getModulesEntrypoints(runner, modules, visited = new Set(), entrypoints = new Set()) {
|
791
|
+
function getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Set(), entrypoints = /* @__PURE__ */ new Set()) {
|
792
792
|
for (let moduleId of modules) {
|
793
793
|
if (visited.has(moduleId)) continue;
|
794
794
|
visited.add(moduleId);
|
@@ -802,11 +802,11 @@ function getModulesEntrypoints(runner, modules, visited = new Set(), entrypoints
|
|
802
802
|
}
|
803
803
|
return entrypoints;
|
804
804
|
}
|
805
|
-
function findAllEntrypoints(runner, entrypoints = new Set()) {
|
805
|
+
function findAllEntrypoints(runner, entrypoints = /* @__PURE__ */ new Set()) {
|
806
806
|
for (let mod of runner.evaluatedModules.idToModuleMap.values()) mod.importers.size || entrypoints.add(mod.url);
|
807
807
|
return entrypoints;
|
808
808
|
}
|
809
|
-
const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = new Set(), retrieveFileHandlers = new Set(), retrieveSourceMapHandlers = new Set(), createExecHandlers = (handlers) => (...args) => {
|
809
|
+
const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => (...args) => {
|
810
810
|
for (let handler of handlers) {
|
811
811
|
let result = handler(...args);
|
812
812
|
if (result) return result;
|
@@ -993,8 +993,8 @@ function enableSourceMapSupport(runner) {
|
|
993
993
|
var ESModulesEvaluator = class {
|
994
994
|
startOffset = getAsyncFunctionDeclarationPaddingLineCount();
|
995
995
|
async runInlinedModule(context, code) {
|
996
|
-
let initModule = new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, "\"use strict\";" + code);
|
997
|
-
await initModule(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey]), Object.seal(context[ssrModuleExportsKey]);
|
996
|
+
let initModule = new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, "\"use strict\";" + code);
|
997
|
+
await initModule(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
|
998
998
|
}
|
999
999
|
runExternalModule(filepath) {
|
1000
1000
|
return import(filepath);
|
@@ -1007,7 +1007,7 @@ var ESModulesEvaluator = class {
|
|
1007
1007
|
} });
|
1008
1008
|
transport;
|
1009
1009
|
resetSourceMapSupport;
|
1010
|
-
concurrentModuleNodePromises = new Map();
|
1010
|
+
concurrentModuleNodePromises = /* @__PURE__ */ new Map();
|
1011
1011
|
closed = !1;
|
1012
1012
|
constructor(options, evaluator = new ESModulesEvaluator(), debug) {
|
1013
1013
|
if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
|
@@ -1052,7 +1052,7 @@ var ESModulesEvaluator = class {
|
|
1052
1052
|
for (let importedFile of mod.imports) if (mod.importers.has(importedFile)) return !0;
|
1053
1053
|
return !1;
|
1054
1054
|
}
|
1055
|
-
isCircularImport(importers, moduleUrl, visited = new Set()) {
|
1055
|
+
isCircularImport(importers, moduleUrl, visited = /* @__PURE__ */ new Set()) {
|
1056
1056
|
for (let importer of importers) {
|
1057
1057
|
if (visited.has(importer)) continue;
|
1058
1058
|
if (visited.add(importer), importer === moduleUrl) return !0;
|
@@ -1158,6 +1158,11 @@ var ESModulesEvaluator = class {
|
|
1158
1158
|
[ssrDynamicImportKey]: dynamicRequest,
|
1159
1159
|
[ssrModuleExportsKey]: exports,
|
1160
1160
|
[ssrExportAllKey]: (obj) => exportAll(exports, obj),
|
1161
|
+
[ssrExportNameKey]: (name, getter) => Object.defineProperty(exports, name, {
|
1162
|
+
enumerable: !0,
|
1163
|
+
configurable: !0,
|
1164
|
+
get: getter
|
1165
|
+
}),
|
1161
1166
|
[ssrImportMetaKey]: meta
|
1162
1167
|
};
|
1163
1168
|
return this.debug?.("[module runner] executing", href), await this.evaluator.runInlinedModule(context, code, mod), exports;
|
package/dist/node/{moduleRunnerTransport-CnL9s_k9.d.ts → moduleRunnerTransport-BWUZBVLX.d.ts}
RENAMED
@@ -53,7 +53,8 @@ interface ViteFetchResult {
|
|
53
53
|
}
|
54
54
|
type InvokeMethods = {
|
55
55
|
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
56
|
-
};
|
56
|
+
};
|
57
|
+
//#endregion
|
57
58
|
//#region src/shared/moduleRunnerTransport.d.ts
|
58
59
|
type ModuleRunnerTransportHandlers = {
|
59
60
|
onMessage: (data: HotPayload) => void;
|
@@ -83,6 +84,5 @@ declare const createWebSocketModuleRunnerTransport: (options: {
|
|
83
84
|
createConnection: () => WebSocket;
|
84
85
|
pingInterval?: number;
|
85
86
|
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
|
86
|
-
|
87
87
|
//#endregion
|
88
88
|
export { ExternalFetchResult, FetchFunctionOptions, FetchResult, ModuleRunnerTransport, ModuleRunnerTransportHandlers, NormalizedModuleRunnerTransport, ViteFetchResult, createWebSocketModuleRunnerTransport };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "7.0.0-beta.
|
3
|
+
"version": "7.0.0-beta.2",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -69,9 +69,9 @@
|
|
69
69
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
70
70
|
"dependencies": {
|
71
71
|
"esbuild": "^0.25.0",
|
72
|
-
"fdir": "^6.4.
|
72
|
+
"fdir": "^6.4.6",
|
73
73
|
"picomatch": "^4.0.2",
|
74
|
-
"postcss": "^8.5.
|
74
|
+
"postcss": "^8.5.5",
|
75
75
|
"rollup": "^4.40.0",
|
76
76
|
"tinyglobby": "^0.2.14"
|
77
77
|
},
|
@@ -80,19 +80,19 @@
|
|
80
80
|
},
|
81
81
|
"devDependencies": {
|
82
82
|
"@ampproject/remapping": "^2.3.0",
|
83
|
-
"@babel/parser": "^7.27.
|
83
|
+
"@babel/parser": "^7.27.5",
|
84
84
|
"@jridgewell/trace-mapping": "^0.3.25",
|
85
85
|
"@oxc-project/runtime": "^0.70.0",
|
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.5",
|
90
90
|
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
91
91
|
"@rollup/pluginutils": "^5.1.4",
|
92
92
|
"@types/escape-html": "^1.0.4",
|
93
93
|
"@types/pnpapi": "^0.0.5",
|
94
94
|
"artichokie": "^0.3.1",
|
95
|
-
"baseline-browser-mapping": "^2.4.
|
95
|
+
"baseline-browser-mapping": "^2.4.4",
|
96
96
|
"cac": "^6.7.14",
|
97
97
|
"chokidar": "^3.6.0",
|
98
98
|
"connect": "^3.7.0",
|
@@ -125,15 +125,14 @@
|
|
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.16",
|
129
|
+
"rolldown-plugin-dts": "^0.13.11",
|
130
130
|
"rollup-plugin-license": "^3.6.0",
|
131
|
-
"sass": "^1.89.
|
132
|
-
"sass-embedded": "^1.89.
|
131
|
+
"sass": "^1.89.2",
|
132
|
+
"sass-embedded": "^1.89.2",
|
133
133
|
"sirv": "^3.0.1",
|
134
|
-
"source-map-support": "^0.5.21",
|
135
134
|
"strip-literal": "^3.0.0",
|
136
|
-
"terser": "^5.
|
135
|
+
"terser": "^5.42.0",
|
137
136
|
"tsconfck": "^3.1.6",
|
138
137
|
"types": "link:./types",
|
139
138
|
"ufo": "^1.6.1",
|
package/types/importGlob.d.ts
CHANGED
@@ -17,9 +17,9 @@ type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false
|
|
17
17
|
type DartSassStringOptionsAsync = DartSass.StringOptions<'async'>
|
18
18
|
type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>
|
19
19
|
type SassStringOptionsAsync =
|
20
|
-
IsAny<
|
21
|
-
?
|
22
|
-
:
|
20
|
+
IsAny<SassEmbeddedStringOptionsAsync> extends false
|
21
|
+
? SassEmbeddedStringOptionsAsync
|
22
|
+
: DartSassStringOptionsAsync
|
23
23
|
|
24
24
|
export type SassModernPreprocessBaseOptions = Omit<
|
25
25
|
SassStringOptionsAsync,
|