vite 8.3.3 → 8.3.4
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/bundledDevClient.mjs +38 -20
- package/dist/client/client.mjs +10 -9
- package/dist/node/chunks/build.js +19 -19
- package/dist/node/chunks/node.js +139 -95
- package/dist/node/chunks/postcss-import.js +10 -10
- package/dist/node/index.d.ts +2 -1
- package/dist/node/module-runner.d.ts +1 -0
- package/dist/node/module-runner.js +9 -7
- package/package.json +7 -7
|
@@ -9,7 +9,7 @@ let nanoid = (size = 21) => {
|
|
|
9
9
|
return id;
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region \0@oxc-project+runtime@0.
|
|
12
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
13
13
|
function _typeof(o) {
|
|
14
14
|
"@babel/helpers - typeof";
|
|
15
15
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -19,7 +19,7 @@ function _typeof(o) {
|
|
|
19
19
|
}, _typeof(o);
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region \0@oxc-project+runtime@0.
|
|
22
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
23
23
|
function toPrimitive(t, r) {
|
|
24
24
|
if ("object" != _typeof(t) || !t) return t;
|
|
25
25
|
var e = t[Symbol.toPrimitive];
|
|
@@ -31,13 +31,13 @@ function toPrimitive(t, r) {
|
|
|
31
31
|
return ("string" === r ? String : Number)(t);
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
35
35
|
function toPropertyKey(t) {
|
|
36
36
|
var i = toPrimitive(t, "string");
|
|
37
37
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region \0@oxc-project+runtime@0.
|
|
40
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
41
41
|
function _defineProperty(e, r, t) {
|
|
42
42
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
43
43
|
value: t,
|
|
@@ -73,8 +73,8 @@ var HMRContext = class {
|
|
|
73
73
|
else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
|
|
74
74
|
else throw new Error(`invalid hot.accept() usage.`);
|
|
75
75
|
}
|
|
76
|
-
acceptExports(
|
|
77
|
-
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
|
|
76
|
+
acceptExports(exportNames, callback) {
|
|
77
|
+
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod), typeof exportNames === "string" ? [exportNames] : exportNames);
|
|
78
78
|
}
|
|
79
79
|
dispose(cb) {
|
|
80
80
|
this.hmrClient.disposeMap.set(this.ownerPath, cb);
|
|
@@ -127,14 +127,15 @@ var HMRContext = class {
|
|
|
127
127
|
data
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
acceptDeps(deps, callback = () => {}) {
|
|
130
|
+
acceptDeps(deps, callback = () => {}, exports) {
|
|
131
131
|
const mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
|
|
132
132
|
id: this.ownerPath,
|
|
133
133
|
callbacks: []
|
|
134
134
|
};
|
|
135
135
|
mod.callbacks.push({
|
|
136
136
|
deps,
|
|
137
|
-
fn: callback
|
|
137
|
+
fn: callback,
|
|
138
|
+
exports
|
|
138
139
|
});
|
|
139
140
|
this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
|
140
141
|
}
|
|
@@ -247,10 +248,28 @@ var BundledDevHMRClient = class extends HMRClient {
|
|
|
247
248
|
this.reloadPending = false;
|
|
248
249
|
}
|
|
249
250
|
isSelfAccepted(id) {
|
|
250
|
-
return this.
|
|
251
|
+
return this.acceptsDep(id, id);
|
|
251
252
|
}
|
|
252
253
|
acceptsDep(parent, id) {
|
|
253
|
-
return this.hotModulesMap.get(parent)?.callbacks.some((c) => c.deps.includes(id)) ?? false;
|
|
254
|
+
return this.hotModulesMap.get(parent)?.callbacks.some((c) => !c.exports && c.deps.includes(id)) ?? false;
|
|
255
|
+
}
|
|
256
|
+
getAcceptedExports(id) {
|
|
257
|
+
let accepted;
|
|
258
|
+
for (const c of this.hotModulesMap.get(id)?.callbacks ?? []) {
|
|
259
|
+
if (!c.exports) continue;
|
|
260
|
+
accepted ?? (accepted = /* @__PURE__ */ new Set());
|
|
261
|
+
for (const name of c.exports) accepted.add(name);
|
|
262
|
+
}
|
|
263
|
+
return accepted;
|
|
264
|
+
}
|
|
265
|
+
acceptsAllExports(id, accepted) {
|
|
266
|
+
const exports = this.runtime.loadExports(id);
|
|
267
|
+
if (typeof exports !== "object" || exports == null) return false;
|
|
268
|
+
return Object.keys(exports).every((name) => accepted.has(name));
|
|
269
|
+
}
|
|
270
|
+
importsOnlyAccepted(parent, id, accepted) {
|
|
271
|
+
if (!this.options.partialAccept) return false;
|
|
272
|
+
return this.runtime.getImportedBindings(parent, id)?.every((name) => accepted.has(name)) ?? false;
|
|
254
273
|
}
|
|
255
274
|
computeHmrUpdate(changedIds, opts) {
|
|
256
275
|
const boundaries = [];
|
|
@@ -275,16 +294,18 @@ var BundledDevHMRClient = class extends HMRClient {
|
|
|
275
294
|
type: "full-reload",
|
|
276
295
|
reason: `update propagated back to ${firstInvalidatedBy}, which already called \`import.meta.hot.invalidate()\``
|
|
277
296
|
};
|
|
278
|
-
|
|
297
|
+
const acceptedExports = this.getAcceptedExports(id);
|
|
298
|
+
const selfAccepted = this.isSelfAccepted(id) || acceptedExports !== void 0 && this.acceptsAllExports(id, acceptedExports);
|
|
299
|
+
if (selfAccepted || acceptedExports) {
|
|
279
300
|
boundaries.push({
|
|
280
301
|
boundary: id,
|
|
281
302
|
acceptedVia: id,
|
|
282
303
|
isWithinCircularImport: this.isNodeWithinCircularImports(id, stack)
|
|
283
304
|
});
|
|
284
|
-
return;
|
|
305
|
+
if (selfAccepted) return;
|
|
285
306
|
}
|
|
286
307
|
const parents = this.runtime.getImporters(id).filter((p) => this.runtime.isExecuted(p));
|
|
287
|
-
if (!parents.length) return {
|
|
308
|
+
if (!acceptedExports && !parents.length) return {
|
|
288
309
|
type: "full-reload",
|
|
289
310
|
reason: `no hmr boundary found for module \`${id}\``
|
|
290
311
|
};
|
|
@@ -298,6 +319,7 @@ var BundledDevHMRClient = class extends HMRClient {
|
|
|
298
319
|
});
|
|
299
320
|
continue;
|
|
300
321
|
}
|
|
322
|
+
if (acceptedExports && this.importsOnlyAccepted(parent, id, acceptedExports)) continue;
|
|
301
323
|
if (!stack.includes(parent)) {
|
|
302
324
|
const fullReload = this.bubble(parent, subChain, updateSet, boundaries, firstInvalidatedBy, traversedModules);
|
|
303
325
|
if (fullReload) return fullReload;
|
|
@@ -1535,7 +1557,7 @@ function updateStyle(id, content) {
|
|
|
1535
1557
|
}, 0);
|
|
1536
1558
|
} else lastInsertedStyle.insertAdjacentElement("afterend", style);
|
|
1537
1559
|
lastInsertedStyle = style;
|
|
1538
|
-
} else style.textContent = content;
|
|
1560
|
+
} else if (style.textContent !== content) style.textContent = content;
|
|
1539
1561
|
sheetsMap.set(id, style);
|
|
1540
1562
|
}
|
|
1541
1563
|
function removeStyle(id) {
|
|
@@ -1574,12 +1596,7 @@ if (typeof DevRuntime !== "undefined") {
|
|
|
1574
1596
|
});
|
|
1575
1597
|
}
|
|
1576
1598
|
createModuleHotContext(moduleId) {
|
|
1577
|
-
|
|
1578
|
-
ctx._internal = {
|
|
1579
|
-
updateStyle,
|
|
1580
|
-
removeStyle
|
|
1581
|
-
};
|
|
1582
|
-
return ctx;
|
|
1599
|
+
return new BundledDevHMRContext(bundledDevHmrClient, moduleId);
|
|
1583
1600
|
}
|
|
1584
1601
|
}
|
|
1585
1602
|
const clientId = nanoid();
|
|
@@ -1594,6 +1611,7 @@ if (typeof DevRuntime !== "undefined") {
|
|
|
1594
1611
|
debug: (...msg) => console.debug("[vite]", ...msg)
|
|
1595
1612
|
}, transport, runtime, {
|
|
1596
1613
|
base,
|
|
1614
|
+
partialAccept: __HMR_PARTIAL_ACCEPT__,
|
|
1597
1615
|
beforeApply: clearOverlayOrReloadOnFirstUpdate
|
|
1598
1616
|
});
|
|
1599
1617
|
registerBundledDevClient(bundledDevHmrClient);
|
package/dist/client/client.mjs
CHANGED
|
@@ -432,7 +432,7 @@ function isHighSurrogate(value) {
|
|
|
432
432
|
return value >= "\ud800" && value <= "\udbff";
|
|
433
433
|
}
|
|
434
434
|
//#endregion
|
|
435
|
-
//#region \0@oxc-project+runtime@0.
|
|
435
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
436
436
|
function _typeof(o) {
|
|
437
437
|
"@babel/helpers - typeof";
|
|
438
438
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -442,7 +442,7 @@ function _typeof(o) {
|
|
|
442
442
|
}, _typeof(o);
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
|
-
//#region \0@oxc-project+runtime@0.
|
|
445
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
446
446
|
function toPrimitive(t, r) {
|
|
447
447
|
if ("object" != _typeof(t) || !t) return t;
|
|
448
448
|
var e = t[Symbol.toPrimitive];
|
|
@@ -454,13 +454,13 @@ function toPrimitive(t, r) {
|
|
|
454
454
|
return ("string" === r ? String : Number)(t);
|
|
455
455
|
}
|
|
456
456
|
//#endregion
|
|
457
|
-
//#region \0@oxc-project+runtime@0.
|
|
457
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
458
458
|
function toPropertyKey(t) {
|
|
459
459
|
var i = toPrimitive(t, "string");
|
|
460
460
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
461
461
|
}
|
|
462
462
|
//#endregion
|
|
463
|
-
//#region \0@oxc-project+runtime@0.
|
|
463
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
464
464
|
function _defineProperty(e, r, t) {
|
|
465
465
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
466
466
|
value: t,
|
|
@@ -496,8 +496,8 @@ var HMRContext = class {
|
|
|
496
496
|
else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
|
|
497
497
|
else throw new Error(`invalid hot.accept() usage.`);
|
|
498
498
|
}
|
|
499
|
-
acceptExports(
|
|
500
|
-
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
|
|
499
|
+
acceptExports(exportNames, callback) {
|
|
500
|
+
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod), typeof exportNames === "string" ? [exportNames] : exportNames);
|
|
501
501
|
}
|
|
502
502
|
dispose(cb) {
|
|
503
503
|
this.hmrClient.disposeMap.set(this.ownerPath, cb);
|
|
@@ -550,14 +550,15 @@ var HMRContext = class {
|
|
|
550
550
|
data
|
|
551
551
|
});
|
|
552
552
|
}
|
|
553
|
-
acceptDeps(deps, callback = () => {}) {
|
|
553
|
+
acceptDeps(deps, callback = () => {}, exports) {
|
|
554
554
|
const mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
|
|
555
555
|
id: this.ownerPath,
|
|
556
556
|
callbacks: []
|
|
557
557
|
};
|
|
558
558
|
mod.callbacks.push({
|
|
559
559
|
deps,
|
|
560
|
-
fn: callback
|
|
560
|
+
fn: callback,
|
|
561
|
+
exports
|
|
561
562
|
});
|
|
562
563
|
this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
|
563
564
|
}
|
|
@@ -1293,7 +1294,7 @@ function updateStyle(id, content) {
|
|
|
1293
1294
|
}, 0);
|
|
1294
1295
|
} else lastInsertedStyle.insertAdjacentElement("afterend", style);
|
|
1295
1296
|
lastInsertedStyle = style;
|
|
1296
|
-
} else style.textContent = content;
|
|
1297
|
+
} else if (style.textContent !== content) style.textContent = content;
|
|
1297
1298
|
sheetsMap.set(id, style);
|
|
1298
1299
|
}
|
|
1299
1300
|
function removeStyle(id) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ft as __commonJSMin, pt as __require } from "./node.js";
|
|
2
2
|
import { t as require_lib } from "./lib.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
3
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/fs.js
|
|
4
4
|
var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
function _export(target, all) {
|
|
@@ -34,7 +34,7 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
34
34
|
}
|
|
35
35
|
}));
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
37
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/unquote.js
|
|
38
38
|
var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
Object.defineProperty(exports, "default", {
|
|
@@ -52,7 +52,7 @@ var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
52
52
|
}
|
|
53
53
|
}));
|
|
54
54
|
//#endregion
|
|
55
|
-
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
55
|
+
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/replaceValueSymbols.js
|
|
56
56
|
var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
57
57
|
const matchValueName = /[$]?[\w-]+/g;
|
|
58
58
|
const replaceValueSymbols = (value, replacements) => {
|
|
@@ -69,7 +69,7 @@ var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
69
69
|
module.exports = replaceValueSymbols;
|
|
70
70
|
}));
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
72
|
+
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/replaceSymbols.js
|
|
73
73
|
var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
74
74
|
const replaceValueSymbols = require_replaceValueSymbols();
|
|
75
75
|
const replaceSymbols = (css, replacements) => {
|
|
@@ -82,7 +82,7 @@ var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
82
82
|
module.exports = replaceSymbols;
|
|
83
83
|
}));
|
|
84
84
|
//#endregion
|
|
85
|
-
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
85
|
+
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/extractICSS.js
|
|
86
86
|
var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
87
87
|
const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
|
|
88
88
|
const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
|
|
@@ -136,7 +136,7 @@ var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
136
136
|
module.exports = extractICSS;
|
|
137
137
|
}));
|
|
138
138
|
//#endregion
|
|
139
|
-
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
139
|
+
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/createICSSRules.js
|
|
140
140
|
var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
141
141
|
const createImports = (imports, postcss, mode = "rule") => {
|
|
142
142
|
return Object.keys(imports).map((path) => {
|
|
@@ -180,7 +180,7 @@ var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
180
180
|
module.exports = createICSSRules;
|
|
181
181
|
}));
|
|
182
182
|
//#endregion
|
|
183
|
-
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.
|
|
183
|
+
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.29/node_modules/icss-utils/src/index.js
|
|
184
184
|
var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
185
185
|
module.exports = {
|
|
186
186
|
replaceValueSymbols: require_replaceValueSymbols(),
|
|
@@ -190,7 +190,7 @@ var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
190
190
|
};
|
|
191
191
|
}));
|
|
192
192
|
//#endregion
|
|
193
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
193
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/Parser.js
|
|
194
194
|
var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
195
195
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
196
196
|
Object.defineProperty(exports, "default", {
|
|
@@ -262,7 +262,7 @@ var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
262
262
|
};
|
|
263
263
|
}));
|
|
264
264
|
//#endregion
|
|
265
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
265
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/saveJSON.js
|
|
266
266
|
var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
267
267
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
268
268
|
Object.defineProperty(exports, "default", {
|
|
@@ -944,7 +944,7 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
944
944
|
module.exports = camelCase;
|
|
945
945
|
}));
|
|
946
946
|
//#endregion
|
|
947
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
947
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/localsConvention.js
|
|
948
948
|
var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
949
949
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
950
950
|
Object.defineProperty(exports, "makeLocalsConventionReducer", {
|
|
@@ -999,7 +999,7 @@ var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
999
999
|
}
|
|
1000
1000
|
}));
|
|
1001
1001
|
//#endregion
|
|
1002
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
1002
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/FileSystemLoader.js
|
|
1003
1003
|
var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1004
1004
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1005
1005
|
Object.defineProperty(exports, "default", {
|
|
@@ -1088,7 +1088,7 @@ var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1088
1088
|
};
|
|
1089
1089
|
}));
|
|
1090
1090
|
//#endregion
|
|
1091
|
-
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.
|
|
1091
|
+
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.29/node_modules/postcss-modules-extract-imports/src/topologicalSort.js
|
|
1092
1092
|
var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1093
1093
|
const PERMANENT_MARKER = 2;
|
|
1094
1094
|
const TEMPORARY_MARKER = 1;
|
|
@@ -1127,7 +1127,7 @@ var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
1127
1127
|
module.exports = topologicalSort;
|
|
1128
1128
|
}));
|
|
1129
1129
|
//#endregion
|
|
1130
|
-
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.
|
|
1130
|
+
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.29/node_modules/postcss-modules-extract-imports/src/index.js
|
|
1131
1131
|
var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1132
1132
|
const topologicalSort = require_topologicalSort();
|
|
1133
1133
|
const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
|
|
@@ -4654,7 +4654,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4654
4654
|
module.exports = exports.default;
|
|
4655
4655
|
}));
|
|
4656
4656
|
//#endregion
|
|
4657
|
-
//#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.
|
|
4657
|
+
//#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.29/node_modules/postcss-modules-local-by-default/src/index.js
|
|
4658
4658
|
var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4659
4659
|
const selectorParser = require_dist();
|
|
4660
4660
|
const valueParser = require_lib();
|
|
@@ -5050,7 +5050,7 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5050
5050
|
module.exports.postcss = true;
|
|
5051
5051
|
}));
|
|
5052
5052
|
//#endregion
|
|
5053
|
-
//#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.
|
|
5053
|
+
//#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.29/node_modules/postcss-modules-scope/src/index.js
|
|
5054
5054
|
var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5055
5055
|
const selectorParser = require_dist();
|
|
5056
5056
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -5228,7 +5228,7 @@ var require_string_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5228
5228
|
module.exports = hash;
|
|
5229
5229
|
}));
|
|
5230
5230
|
//#endregion
|
|
5231
|
-
//#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.
|
|
5231
|
+
//#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.29/node_modules/postcss-modules-values/src/index.js
|
|
5232
5232
|
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5233
5233
|
const ICSSUtils = require_src$4();
|
|
5234
5234
|
const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
|
|
@@ -5315,7 +5315,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5315
5315
|
module.exports.postcss = true;
|
|
5316
5316
|
}));
|
|
5317
5317
|
//#endregion
|
|
5318
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
5318
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/scoping.js
|
|
5319
5319
|
var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5320
5320
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5321
5321
|
function _export(target, all) {
|
|
@@ -5394,7 +5394,7 @@ var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5394
5394
|
}
|
|
5395
5395
|
}));
|
|
5396
5396
|
//#endregion
|
|
5397
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
5397
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/pluginFactory.js
|
|
5398
5398
|
var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5399
5399
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5400
5400
|
Object.defineProperty(exports, "makePlugin", {
|
|
@@ -5476,7 +5476,7 @@ var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5476
5476
|
}
|
|
5477
5477
|
}));
|
|
5478
5478
|
//#endregion
|
|
5479
|
-
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.
|
|
5479
|
+
//#region ../../node_modules/.pnpm/postcss-modules@9.0.1_postcss@8.5.29/node_modules/postcss-modules/build/index.js
|
|
5480
5480
|
var require_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5481
5481
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5482
5482
|
const _fs = __require("fs");
|
package/dist/node/chunks/node.js
CHANGED
|
@@ -13,7 +13,6 @@ import { format, formatWithOptions, inspect, isDeepStrictEqual, parseEnv, promis
|
|
|
13
13
|
import { MessageChannel, Worker } from "node:worker_threads";
|
|
14
14
|
import pm from "picomatch";
|
|
15
15
|
import { VERSION as rolldownVersion, rolldown } from "rolldown";
|
|
16
|
-
import { escapePath, glob, globSync, isDynamicPattern } from "tinyglobby";
|
|
17
16
|
import { dev, oxcRuntimePlugin, resolveTsconfig, scan, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteDynamicImportVarsPlugin, viteImportGlobPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin } from "rolldown/experimental";
|
|
18
17
|
import childProcess, { exec, execFile, execSync, spawn } from "node:child_process";
|
|
19
18
|
import { promises } from "node:dns";
|
|
@@ -24,6 +23,7 @@ import path$1, { isAbsolute as isAbsolute$1, join as join$1, posix as posix$1, r
|
|
|
24
23
|
import { exactRegex, makeIdFiltersToMatchWithQuery, prefixRegex, withFilter } from "rolldown/filter";
|
|
25
24
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
26
25
|
import { readdirSync, statSync as statSync$1 } from "fs";
|
|
26
|
+
import { escapePath, glob, globSync, isDynamicPattern } from "tinyglobby";
|
|
27
27
|
import assert from "node:assert";
|
|
28
28
|
import process$1, { cwd } from "node:process";
|
|
29
29
|
import v8 from "node:v8";
|
|
@@ -649,7 +649,7 @@ var BaseEnvironment = class extends PartialEnvironment {
|
|
|
649
649
|
};
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region package.json
|
|
652
|
-
var version = "8.3.
|
|
652
|
+
var version = "8.3.4";
|
|
653
653
|
//#endregion
|
|
654
654
|
//#region src/node/constants.ts
|
|
655
655
|
const ROLLUP_HOOKS = [
|
|
@@ -2490,7 +2490,7 @@ function optimizeSafeRealPathSync() {
|
|
|
2490
2490
|
});
|
|
2491
2491
|
}
|
|
2492
2492
|
function ensureWatchedFile(watcher, file, root) {
|
|
2493
|
-
if (file && !file.startsWith(withTrailingSlash(root)) && !file.includes("\0") && fs.existsSync(file)) watcher.add(path.resolve(file));
|
|
2493
|
+
if (file && !normalizePath(file).startsWith(withTrailingSlash(root)) && !file.includes("\0") && fs.existsSync(file)) watcher.add(path.resolve(file));
|
|
2494
2494
|
}
|
|
2495
2495
|
function joinSrcset(ret) {
|
|
2496
2496
|
return ret.map(({ url, descriptor }) => url + (descriptor ? ` ${descriptor}` : "")).join(", ");
|
|
@@ -2832,7 +2832,7 @@ function setupHmrWsOptionCompat(serverConfig) {
|
|
|
2832
2832
|
for (const key of wsOptionKeys) if (hmrConfig[key] !== void 0) wsConfig[key] ??= hmrConfig[key];
|
|
2833
2833
|
}
|
|
2834
2834
|
serverConfig.ws = wsConfig;
|
|
2835
|
-
const hmrProxy = hmrConfig
|
|
2835
|
+
const hmrProxy = { ...hmrConfig };
|
|
2836
2836
|
for (const key of wsOptionKeys) Object.defineProperty(hmrProxy, key, {
|
|
2837
2837
|
get() {
|
|
2838
2838
|
return serverConfig.ws?.[key];
|
|
@@ -3483,7 +3483,7 @@ function alias$1(options = {}) {
|
|
|
3483
3483
|
};
|
|
3484
3484
|
}
|
|
3485
3485
|
//#endregion
|
|
3486
|
-
//#region ../../node_modules/.pnpm/magic-string@1.4.
|
|
3486
|
+
//#region ../../node_modules/.pnpm/magic-string@1.4.3/node_modules/magic-string/dist/index.mjs
|
|
3487
3487
|
var BitSet = class BitSet {
|
|
3488
3488
|
constructor(arg) {
|
|
3489
3489
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -4492,7 +4492,7 @@ var MagicString = class MagicString {
|
|
|
4492
4492
|
while (chunk !== last) {
|
|
4493
4493
|
if (chunk.next !== this.byStart.get(chunk.end)) throw new MagicStringError("cannot overwrite across a split point");
|
|
4494
4494
|
chunk = chunk.next;
|
|
4495
|
-
chunk.edit("", false);
|
|
4495
|
+
chunk.edit("", false, !overwrite);
|
|
4496
4496
|
}
|
|
4497
4497
|
first.edit(content, storeName, !overwrite);
|
|
4498
4498
|
} else {
|
|
@@ -4846,8 +4846,8 @@ var MagicString = class MagicString {
|
|
|
4846
4846
|
if (this._hasRemovedContent(match.index, match.index + match[0].length)) return false;
|
|
4847
4847
|
const replacement = getReplacement(match, this.original);
|
|
4848
4848
|
if (replacement === match[0]) return true;
|
|
4849
|
-
if (match[0].length === 0) this.appendRight(match.index, replacement);
|
|
4850
|
-
else this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
4849
|
+
if (match[0].length === 0) this.appendRight(match.index - this.offset, replacement);
|
|
4850
|
+
else this.overwrite(match.index - this.offset, match.index + match[0].length - this.offset, replacement);
|
|
4851
4851
|
return true;
|
|
4852
4852
|
};
|
|
4853
4853
|
if (searchValue.global) {
|
|
@@ -4874,8 +4874,8 @@ var MagicString = class MagicString {
|
|
|
4874
4874
|
if (typeof replacement === "function") replacement = replacement(string, index, original);
|
|
4875
4875
|
else replacement = expandReplacement(replacement, string, index, original, [], void 0);
|
|
4876
4876
|
if (string !== replacement) {
|
|
4877
|
-
if (string.length === 0) this.appendRight(index, replacement);
|
|
4878
|
-
else this.overwrite(index, index + string.length, replacement);
|
|
4877
|
+
if (string.length === 0) this.appendRight(index - this.offset, replacement);
|
|
4878
|
+
else this.overwrite(index - this.offset, index + string.length - this.offset, replacement);
|
|
4879
4879
|
}
|
|
4880
4880
|
break;
|
|
4881
4881
|
}
|
|
@@ -4896,7 +4896,7 @@ var MagicString = class MagicString {
|
|
|
4896
4896
|
for (let index = 0; index <= original.length; index += 1) {
|
|
4897
4897
|
if (this._hasRemovedContent(index, index)) continue;
|
|
4898
4898
|
const _replacement = typeof replacement === "function" ? replacement("", index, original) : expandReplacement(replacement, "", index, original, [], void 0);
|
|
4899
|
-
if (_replacement !== "") this.appendRight(index, _replacement);
|
|
4899
|
+
if (_replacement !== "") this.appendRight(index - this.offset, _replacement);
|
|
4900
4900
|
}
|
|
4901
4901
|
return this;
|
|
4902
4902
|
}
|
|
@@ -4904,7 +4904,7 @@ var MagicString = class MagicString {
|
|
|
4904
4904
|
if (this._hasRemovedContent(index, index + stringLength)) continue;
|
|
4905
4905
|
const previous = original.slice(index, index + stringLength);
|
|
4906
4906
|
const _replacement = typeof replacement === "function" ? replacement(previous, index, original) : expandReplacement(replacement, previous, index, original, [], void 0);
|
|
4907
|
-
if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
|
|
4907
|
+
if (previous !== _replacement) this.overwrite(index - this.offset, index + stringLength - this.offset, _replacement);
|
|
4908
4908
|
}
|
|
4909
4909
|
return this;
|
|
4910
4910
|
}
|
|
@@ -6814,7 +6814,7 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6814
6814
|
};
|
|
6815
6815
|
}));
|
|
6816
6816
|
//#endregion
|
|
6817
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
6817
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/req.js
|
|
6818
6818
|
var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6819
6819
|
const { createRequire: createRequire$1 } = __require("node:module");
|
|
6820
6820
|
const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = __require("node:url");
|
|
@@ -6856,7 +6856,7 @@ var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6856
6856
|
module.exports = req;
|
|
6857
6857
|
}));
|
|
6858
6858
|
//#endregion
|
|
6859
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
6859
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/options.js
|
|
6860
6860
|
var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6861
6861
|
const req = require_req();
|
|
6862
6862
|
/**
|
|
@@ -6890,7 +6890,7 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6890
6890
|
module.exports = options;
|
|
6891
6891
|
}));
|
|
6892
6892
|
//#endregion
|
|
6893
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
6893
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/plugins.js
|
|
6894
6894
|
var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6895
6895
|
const req = require_req();
|
|
6896
6896
|
/**
|
|
@@ -6944,7 +6944,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6944
6944
|
module.exports = plugins;
|
|
6945
6945
|
}));
|
|
6946
6946
|
//#endregion
|
|
6947
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
6947
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/index.js
|
|
6948
6948
|
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6949
6949
|
const { resolve: resolve$3 } = __require("node:path");
|
|
6950
6950
|
const config = require_src$1();
|
|
@@ -7620,7 +7620,7 @@ function oxcPlugin(config) {
|
|
|
7620
7620
|
...jsxOptions,
|
|
7621
7621
|
refresh: false
|
|
7622
7622
|
};
|
|
7623
|
-
if (jsxRefreshFilter?.(id) && !JS_TYPES_RE.test(cleanUrl(id))) result.lang = "js";
|
|
7623
|
+
if (jsxRefreshFilter?.(id) && !JS_TYPES_RE.test(id) && !JS_TYPES_RE.test(cleanUrl(id))) result.lang = "js";
|
|
7624
7624
|
return result;
|
|
7625
7625
|
};
|
|
7626
7626
|
let server;
|
|
@@ -17300,9 +17300,10 @@ async function createClientConfigValueReplacer(config) {
|
|
|
17300
17300
|
const hmrTimeoutReplacement = escapeReplacement(timeout);
|
|
17301
17301
|
const hmrEnableOverlayReplacement = escapeReplacement(overlay);
|
|
17302
17302
|
const hmrConfigNameReplacement = escapeReplacement(hmrConfigName);
|
|
17303
|
+
const hmrPartialAcceptReplacement = escapeReplacement(config.experimental.hmrPartialAccept);
|
|
17303
17304
|
const wsTokenReplacement = escapeReplacement(config.webSocketToken);
|
|
17304
17305
|
const serverForwardConsoleReplacement = escapeReplacement(config.server.forwardConsole);
|
|
17305
|
-
return (code) => code.replace(`__MODE__`, modeReplacement).replace(/__BASE__/g, baseReplacement).replace(`__SERVER_HOST__`, serverHostReplacement).replace(`__HMR_PROTOCOL__`, hmrProtocolReplacement).replace(`__HMR_HOSTNAME__`, hmrHostnameReplacement).replace(`__HMR_PORT__`, hmrPortReplacement).replace(`__HMR_DIRECT_TARGET__`, hmrDirectTargetReplacement).replace(`__HMR_BASE__`, hmrBaseReplacement).replace(`__HMR_TIMEOUT__`, hmrTimeoutReplacement).replace(`__HMR_ENABLE_OVERLAY__`, hmrEnableOverlayReplacement).replace(`__HMR_CONFIG_NAME__`, hmrConfigNameReplacement).replace(`__WS_TOKEN__`, wsTokenReplacement).replace(`__SERVER_FORWARD_CONSOLE__`, serverForwardConsoleReplacement);
|
|
17306
|
+
return (code) => code.replace(`__MODE__`, modeReplacement).replace(/__BASE__/g, baseReplacement).replace(`__SERVER_HOST__`, serverHostReplacement).replace(`__HMR_PROTOCOL__`, hmrProtocolReplacement).replace(`__HMR_HOSTNAME__`, hmrHostnameReplacement).replace(`__HMR_PORT__`, hmrPortReplacement).replace(`__HMR_DIRECT_TARGET__`, hmrDirectTargetReplacement).replace(`__HMR_BASE__`, hmrBaseReplacement).replace(`__HMR_TIMEOUT__`, hmrTimeoutReplacement).replace(`__HMR_ENABLE_OVERLAY__`, hmrEnableOverlayReplacement).replace(`__HMR_CONFIG_NAME__`, hmrConfigNameReplacement).replace(`__HMR_PARTIAL_ACCEPT__`, hmrPartialAcceptReplacement).replace(`__WS_TOKEN__`, wsTokenReplacement).replace(`__SERVER_FORWARD_CONSOLE__`, serverForwardConsoleReplacement);
|
|
17306
17307
|
}
|
|
17307
17308
|
const ROLLDOWN_DEV_RUNTIME_ENTRY = "rolldown/experimental/runtime";
|
|
17308
17309
|
async function getHmrImplementation(config) {
|
|
@@ -17325,6 +17326,34 @@ function getRolldownDevRuntimeFiles() {
|
|
|
17325
17326
|
if (!files.has(`@rolldown/${path.basename(entry)}`)) throw new Error(`rolldown dev runtime entry ${entry} was not found`);
|
|
17326
17327
|
return files;
|
|
17327
17328
|
}
|
|
17329
|
+
function getBundledDevClientAliases(config) {
|
|
17330
|
+
const clientUrl = path.posix.join(config.base, BUNDLED_DEV_CLIENT_FILENAME);
|
|
17331
|
+
return /* @__PURE__ */ new Map([[CLIENT_PUBLIC_PATH.slice(1), `export * from ${JSON.stringify(clientUrl)}`], [ENV_PUBLIC_PATH.slice(1), ""]]);
|
|
17332
|
+
}
|
|
17333
|
+
function bundledDevClientImportsPlugin(config) {
|
|
17334
|
+
const clientUrl = path.posix.join(config.base, BUNDLED_DEV_CLIENT_FILENAME);
|
|
17335
|
+
return {
|
|
17336
|
+
name: "vite:bundled-dev-client-imports",
|
|
17337
|
+
applyToEnvironment(environment) {
|
|
17338
|
+
return config.command === "serve" && environment.config.isBundled && environment.config.consumer === "client";
|
|
17339
|
+
},
|
|
17340
|
+
resolveId: {
|
|
17341
|
+
filter: { id: [exactRegex(clientUrl), exactRegex(path.posix.join(config.base, CLIENT_PUBLIC_PATH))] },
|
|
17342
|
+
handler() {
|
|
17343
|
+
return {
|
|
17344
|
+
id: clientUrl,
|
|
17345
|
+
external: true
|
|
17346
|
+
};
|
|
17347
|
+
}
|
|
17348
|
+
},
|
|
17349
|
+
load: {
|
|
17350
|
+
filter: { id: new RegExp(`^(?:${escapeRegex(normalizedClientEntry$1)}|${escapeRegex(normalizedEnvEntry$1)})(?:\\?.*)?$`) },
|
|
17351
|
+
handler(id) {
|
|
17352
|
+
return cleanUrl(id) === normalizedClientEntry$1 ? `export * from ${JSON.stringify(clientUrl)}` : "";
|
|
17353
|
+
}
|
|
17354
|
+
}
|
|
17355
|
+
};
|
|
17356
|
+
}
|
|
17328
17357
|
//#endregion
|
|
17329
17358
|
//#region ../../node_modules/.pnpm/convert-source-map@2.0.0/node_modules/convert-source-map/index.js
|
|
17330
17359
|
var require_convert_source_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -17959,11 +17988,7 @@ function serveStaticMiddleware(server) {
|
|
|
17959
17988
|
const url = new URL(req.url, "http://example.com");
|
|
17960
17989
|
const pathname = decodeURIIfPossible(url.pathname);
|
|
17961
17990
|
if (pathname === void 0) return next();
|
|
17962
|
-
let redirectedPathname;
|
|
17963
|
-
for (const { find, replacement } of server.config.resolve.alias) if (typeof find === "string" ? pathname.startsWith(find) : find.test(pathname)) {
|
|
17964
|
-
redirectedPathname = pathname.replace(find, replacement);
|
|
17965
|
-
break;
|
|
17966
|
-
}
|
|
17991
|
+
let redirectedPathname = applyStaticAlias(pathname, server.config.resolve.alias);
|
|
17967
17992
|
if (redirectedPathname) {
|
|
17968
17993
|
if (redirectedPathname.startsWith(withTrailingSlash(dir))) redirectedPathname = redirectedPathname.slice(dir.length);
|
|
17969
17994
|
}
|
|
@@ -17985,6 +18010,9 @@ function serveStaticMiddleware(server) {
|
|
|
17985
18010
|
}
|
|
17986
18011
|
};
|
|
17987
18012
|
}
|
|
18013
|
+
function applyStaticAlias(pathname, aliases) {
|
|
18014
|
+
for (const { find, replacement } of aliases) if (typeof find === "string" ? pathname === find || pathname.startsWith(`${find}/`) : find.test(pathname)) return pathname.replace(find, replacement);
|
|
18015
|
+
}
|
|
17988
18016
|
function serveRawFsMiddleware(server) {
|
|
17989
18017
|
const serveFromRoot = build_default$1("/", sirvOptions({
|
|
17990
18018
|
config: server.config,
|
|
@@ -18154,7 +18182,8 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
18154
18182
|
let proxyModulePath;
|
|
18155
18183
|
let proxyModuleUrl;
|
|
18156
18184
|
const trailingSlash = htmlPath.endsWith("/");
|
|
18157
|
-
if (!trailingSlash &&
|
|
18185
|
+
if (!trailingSlash && tryStatSync(filename)?.isFile()) {
|
|
18186
|
+
ensureWatchedFile(watcher, filename, config.root);
|
|
18158
18187
|
proxyModulePath = htmlPath.startsWith(FS_PREFIX) ? filename : htmlPath;
|
|
18159
18188
|
proxyModuleUrl = htmlPath;
|
|
18160
18189
|
} else {
|
|
@@ -18236,7 +18265,6 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
18236
18265
|
await Promise.all([...styleUrl.map(async ({ start, end, code }, index) => {
|
|
18237
18266
|
const url = `${proxyModulePath}?html-proxy&direct&index=${index}.css`;
|
|
18238
18267
|
const mod = await server.environments.client.moduleGraph.ensureEntryFromUrl(url, false);
|
|
18239
|
-
ensureWatchedFile(watcher, mod.file, config.root);
|
|
18240
18268
|
const result = await server.environments.client.pluginContainer.transform(code, mod.id);
|
|
18241
18269
|
let content = "";
|
|
18242
18270
|
if (result.map && "version" in result.map) {
|
|
@@ -18247,7 +18275,6 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
|
|
|
18247
18275
|
}), ...inlineStyles.map(async ({ index, location, code }) => {
|
|
18248
18276
|
const url = `${proxyModulePath}?html-proxy&inline-css&style-attr&index=${index}.css`;
|
|
18249
18277
|
const mod = await server.environments.client.moduleGraph.ensureEntryFromUrl(url, false);
|
|
18250
|
-
ensureWatchedFile(watcher, mod.file, config.root);
|
|
18251
18278
|
await server?.environments.client.pluginContainer.transform(code, mod.id);
|
|
18252
18279
|
const hash = getHash(cleanUrl(mod.id));
|
|
18253
18280
|
const result = htmlProxyResult.get(`${hash}_${index}`);
|
|
@@ -18415,7 +18442,7 @@ function memoryFilesMiddleware(server) {
|
|
|
18415
18442
|
}
|
|
18416
18443
|
res.setHeader("Etag", file.etag);
|
|
18417
18444
|
}
|
|
18418
|
-
const mime = lookup(filePath);
|
|
18445
|
+
const mime = file.contentType ?? lookup(filePath);
|
|
18419
18446
|
if (mime) res.setHeader("Content-Type", mime);
|
|
18420
18447
|
for (const name in headers) res.setHeader(name, headers[name]);
|
|
18421
18448
|
return res.end(file.source);
|
|
@@ -24795,6 +24822,11 @@ function createServer$2(inlineConfig = {}) {
|
|
|
24795
24822
|
}
|
|
24796
24823
|
async function _createServer(inlineConfig = {}, options) {
|
|
24797
24824
|
disableCache();
|
|
24825
|
+
const restartState = options.restartState ?? {
|
|
24826
|
+
promise: null,
|
|
24827
|
+
pending: false,
|
|
24828
|
+
forceOptimize: false
|
|
24829
|
+
};
|
|
24798
24830
|
const config = isResolvedConfig(inlineConfig) ? inlineConfig : await resolveConfig(inlineConfig, "serve");
|
|
24799
24831
|
if (usedConfigs.has(config)) throw new Error(`There is already a server associated with the config.`);
|
|
24800
24832
|
if (config.command !== "serve") throw new Error(`Config was resolved for a "build", expected a "serve" command.`);
|
|
@@ -24958,14 +24990,24 @@ async function _createServer(inlineConfig = {}, options) {
|
|
|
24958
24990
|
bindCLIShortcuts(server, options);
|
|
24959
24991
|
},
|
|
24960
24992
|
async restart(forceOptimize) {
|
|
24961
|
-
|
|
24962
|
-
|
|
24963
|
-
|
|
24964
|
-
|
|
24965
|
-
server._forceOptimizeOnRestart = false;
|
|
24966
|
-
});
|
|
24993
|
+
restartState.forceOptimize ||= !!forceOptimize;
|
|
24994
|
+
if (restartState.promise) {
|
|
24995
|
+
restartState.pending = true;
|
|
24996
|
+
return restartState.promise;
|
|
24967
24997
|
}
|
|
24968
|
-
|
|
24998
|
+
restartState.promise = (async () => {
|
|
24999
|
+
try {
|
|
25000
|
+
do {
|
|
25001
|
+
restartState.pending = false;
|
|
25002
|
+
await restartServer(server, restartState);
|
|
25003
|
+
} while (restartState.pending);
|
|
25004
|
+
} finally {
|
|
25005
|
+
restartState.promise = null;
|
|
25006
|
+
restartState.pending = false;
|
|
25007
|
+
restartState.forceOptimize = false;
|
|
25008
|
+
}
|
|
25009
|
+
})();
|
|
25010
|
+
return restartState.promise;
|
|
24969
25011
|
},
|
|
24970
25012
|
waitForRequestsIdle(ignoredId) {
|
|
24971
25013
|
return environments.client.waitForRequestsIdle(ignoredId);
|
|
@@ -24977,8 +25019,6 @@ async function _createServer(inlineConfig = {}, options) {
|
|
|
24977
25019
|
if (!closeServerPromise) closeServerPromise = closeServer(reason);
|
|
24978
25020
|
return closeServerPromise;
|
|
24979
25021
|
},
|
|
24980
|
-
_restartPromise: options.previousRestartPromise ?? null,
|
|
24981
|
-
_forceOptimizeOnRestart: options.previousForceOptimizeOnRestart ?? false,
|
|
24982
25022
|
_shortcutsState: options.previousShortcutsState
|
|
24983
25023
|
};
|
|
24984
25024
|
const reflexServer = new Proxy(server, {
|
|
@@ -25231,10 +25271,10 @@ async function resolveServerOptions(root, raw, logger) {
|
|
|
25231
25271
|
}
|
|
25232
25272
|
return server;
|
|
25233
25273
|
}
|
|
25234
|
-
async function restartServer(server) {
|
|
25274
|
+
async function restartServer(server, restartState) {
|
|
25235
25275
|
global.__vite_start_time = performance$1.now();
|
|
25236
25276
|
let inlineConfig = server.config.inlineConfig;
|
|
25237
|
-
if (
|
|
25277
|
+
if (restartState.forceOptimize) inlineConfig = mergeConfig(inlineConfig, { forceOptimizeDeps: true });
|
|
25238
25278
|
{
|
|
25239
25279
|
let newServer = null;
|
|
25240
25280
|
try {
|
|
@@ -25242,8 +25282,7 @@ async function restartServer(server) {
|
|
|
25242
25282
|
listen: false,
|
|
25243
25283
|
previousEnvironments: server.environments,
|
|
25244
25284
|
previousShortcutsState: server._shortcutsState,
|
|
25245
|
-
|
|
25246
|
-
previousForceOptimizeOnRestart: server._forceOptimizeOnRestart
|
|
25285
|
+
restartState
|
|
25247
25286
|
});
|
|
25248
25287
|
} catch (err) {
|
|
25249
25288
|
server.config.logger.error(err.message, { timestamp: true });
|
|
@@ -26929,6 +26968,22 @@ function detectScriptRel() {
|
|
|
26929
26968
|
const relList = typeof document !== "undefined" && document.createElement("link").relList;
|
|
26930
26969
|
return relList && relList.supports && relList.supports("modulepreload") ? "modulepreload" : "preload";
|
|
26931
26970
|
}
|
|
26971
|
+
function preloadOnce(seen, href, preload) {
|
|
26972
|
+
if (href in seen) return seen[href];
|
|
26973
|
+
const promise = preload();
|
|
26974
|
+
if (!promise) {
|
|
26975
|
+
seen[href] = void 0;
|
|
26976
|
+
return;
|
|
26977
|
+
}
|
|
26978
|
+
const preloadPromise = promise.then(() => {
|
|
26979
|
+
seen[href] = void 0;
|
|
26980
|
+
}, (err) => {
|
|
26981
|
+
seen[href] = void 0;
|
|
26982
|
+
throw err;
|
|
26983
|
+
});
|
|
26984
|
+
seen[href] = preloadPromise;
|
|
26985
|
+
return preloadPromise;
|
|
26986
|
+
}
|
|
26932
26987
|
function preload(baseModule, deps, importerUrl) {
|
|
26933
26988
|
let promise = Promise.resolve();
|
|
26934
26989
|
if (__VITE_IS_MODERN__ && deps && deps.length > 0) {
|
|
@@ -26955,32 +27010,32 @@ function preload(baseModule, deps, importerUrl) {
|
|
|
26955
27010
|
promise = allSettled(deps.map((depString) => {
|
|
26956
27011
|
depString = assetsURL(depString, importerUrl);
|
|
26957
27012
|
const dep = importMetaResolve(depString);
|
|
26958
|
-
if (dep.href in seen) return;
|
|
26959
|
-
seen[dep.href] = true;
|
|
26960
27013
|
const isCss = isCssPreloadUrl(dep);
|
|
26961
|
-
|
|
26962
|
-
preloadedHrefs
|
|
26963
|
-
|
|
26964
|
-
|
|
26965
|
-
|
|
26966
|
-
|
|
26967
|
-
|
|
26968
|
-
|
|
26969
|
-
|
|
26970
|
-
|
|
26971
|
-
|
|
26972
|
-
|
|
26973
|
-
|
|
26974
|
-
|
|
26975
|
-
|
|
26976
|
-
|
|
26977
|
-
|
|
26978
|
-
|
|
26979
|
-
|
|
26980
|
-
|
|
26981
|
-
|
|
26982
|
-
|
|
26983
|
-
|
|
27014
|
+
return preloadOnce(seen, dep.href, () => {
|
|
27015
|
+
if (preloadedHrefs === void 0) {
|
|
27016
|
+
preloadedHrefs = {
|
|
27017
|
+
all: /* @__PURE__ */ new Set(),
|
|
27018
|
+
styles: /* @__PURE__ */ new Set()
|
|
27019
|
+
};
|
|
27020
|
+
const links = document.getElementsByTagName("link");
|
|
27021
|
+
for (let i = links.length - 1; i >= 0; i--) {
|
|
27022
|
+
const link = links[i];
|
|
27023
|
+
preloadedHrefs.all.add(link.href);
|
|
27024
|
+
if (link.rel === "stylesheet") preloadedHrefs.styles.add(link.href);
|
|
27025
|
+
}
|
|
27026
|
+
}
|
|
27027
|
+
if ((isCss ? preloadedHrefs.styles : preloadedHrefs.all).has(dep.href)) return;
|
|
27028
|
+
const link = document.createElement("link");
|
|
27029
|
+
link.rel = isCss ? "stylesheet" : scriptRel;
|
|
27030
|
+
if (!isCss) link.as = "script";
|
|
27031
|
+
link.crossOrigin = "";
|
|
27032
|
+
link.href = dep.href;
|
|
27033
|
+
if (cspNonce) link.setAttribute("nonce", cspNonce);
|
|
27034
|
+
document.head.appendChild(link);
|
|
27035
|
+
if (isCss) return new Promise((res, rej) => {
|
|
27036
|
+
link.addEventListener("load", res);
|
|
27037
|
+
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
|
|
27038
|
+
});
|
|
26984
27039
|
});
|
|
26985
27040
|
}).filter((p) => p !== void 0));
|
|
26986
27041
|
}
|
|
@@ -27003,7 +27058,7 @@ function getPreloadCode(environment, renderBuiltUrlBoolean, isRelativeBase) {
|
|
|
27003
27058
|
const scriptRel = modulePreload && modulePreload.polyfill ? `'modulepreload'` : `/* @__PURE__ */ (${detectScriptRel.toString()})()`;
|
|
27004
27059
|
const assetsURL = renderBuiltUrlBoolean || isRelativeBase ? `function(dep, importerUrl) { return new URL(dep, importerUrl).href }` : `function(dep) { return ${JSON.stringify(environment.config.base)}+dep }`;
|
|
27005
27060
|
const preloadMethodCode = preload.toString().replaceAll("𝐢𝐦𝐩𝐨𝐫𝐭", "import");
|
|
27006
|
-
return `const scriptRel = ${scriptRel};const assetsURL = ${assetsURL};const seen = {};const isCssPreloadUrl = ${isCssPreloadUrl.toString()};export const ${preloadMethod} = ${preloadMethodCode}`;
|
|
27061
|
+
return `const scriptRel = ${scriptRel};const assetsURL = ${assetsURL};const seen = {};const isCssPreloadUrl = ${isCssPreloadUrl.toString()};const preloadOnce = ${preloadOnce.toString()};export const ${preloadMethod} = ${preloadMethodCode}`;
|
|
27007
27062
|
}
|
|
27008
27063
|
/**
|
|
27009
27064
|
* Build only. During serve this is performed as part of ./importAnalysis.
|
|
@@ -28241,9 +28296,10 @@ function rolldownScanPlugin(environment, depImports, missing, entries, jsxOption
|
|
|
28241
28296
|
if (htmlTypesRE.test(id)) {
|
|
28242
28297
|
const resolved = await resolve(id, importer);
|
|
28243
28298
|
if (!resolved) return;
|
|
28244
|
-
if (isInNodeModules(resolved)
|
|
28245
|
-
|
|
28246
|
-
|
|
28299
|
+
if (!isInNodeModules(resolved) || !isOptimizable(resolved, optimizeDepsOptions)) {
|
|
28300
|
+
if (shouldExternalizeDep(resolved, id)) return externalUnlessEntry({ path: id });
|
|
28301
|
+
return resolved;
|
|
28302
|
+
}
|
|
28247
28303
|
}
|
|
28248
28304
|
if (/^[\w@][^:]/.test(id)) {
|
|
28249
28305
|
if (moduleListContains(exclude, id)) return externalUnlessEntry({ path: id });
|
|
@@ -29929,7 +29985,7 @@ function cssPostPlugin(config) {
|
|
|
29929
29985
|
const cssContent = await getContentWithSourcemap(css);
|
|
29930
29986
|
return {
|
|
29931
29987
|
code: [
|
|
29932
|
-
|
|
29988
|
+
`import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
|
|
29933
29989
|
`const __vite__id = ${JSON.stringify(id)}`,
|
|
29934
29990
|
`const __vite__css = ${JSON.stringify(cssContent)}`,
|
|
29935
29991
|
`__vite__updateStyle(__vite__id, __vite__css)`,
|
|
@@ -31232,10 +31288,10 @@ async function compileLightningCSS(environment, id, src, deps, workerController,
|
|
|
31232
31288
|
const code = fs.readFileSync(filePath, "utf-8");
|
|
31233
31289
|
const lang = CSS_LANGS_RE.exec(filePath)?.[1];
|
|
31234
31290
|
if (isPreProcessor(lang)) {
|
|
31235
|
-
const result = await compileCSSPreprocessors(environment,
|
|
31291
|
+
const result = await compileCSSPreprocessors(environment, filePath, lang, code, workerController);
|
|
31236
31292
|
result.deps?.forEach((dep) => deps.add(dep));
|
|
31237
31293
|
return result.code;
|
|
31238
|
-
} else if (lang === "sss") return (await transformSugarSS(environment,
|
|
31294
|
+
} else if (lang === "sss") return (await transformSugarSS(environment, filePath, code)).code;
|
|
31239
31295
|
return code;
|
|
31240
31296
|
},
|
|
31241
31297
|
async resolve(id, from) {
|
|
@@ -31683,13 +31739,14 @@ function getCssFilesForChunk(chunk, bundle, analyzedImportedCssFiles, seenChunks
|
|
|
31683
31739
|
}
|
|
31684
31740
|
const allFiles = [];
|
|
31685
31741
|
const filteredFiles = [];
|
|
31742
|
+
let complete = true;
|
|
31686
31743
|
chunk.imports.forEach((file) => {
|
|
31687
31744
|
const importee = bundle[file];
|
|
31688
31745
|
if (importee?.type === "chunk") {
|
|
31689
31746
|
const importeeCss = getCssFilesForChunk(importee, bundle, analyzedImportedCssFiles, seenChunks, seenCss);
|
|
31690
31747
|
filteredFiles.push(...importeeCss);
|
|
31691
31748
|
if (analyzedImportedCssFiles.has(importee)) allFiles.push(...analyzedImportedCssFiles.get(importee));
|
|
31692
|
-
else
|
|
31749
|
+
else complete = false;
|
|
31693
31750
|
}
|
|
31694
31751
|
});
|
|
31695
31752
|
chunk.viteMetadata.importedCss.forEach((file) => {
|
|
@@ -31699,7 +31756,7 @@ function getCssFilesForChunk(chunk, bundle, analyzedImportedCssFiles, seenChunks
|
|
|
31699
31756
|
filteredFiles.push(file);
|
|
31700
31757
|
}
|
|
31701
31758
|
});
|
|
31702
|
-
analyzedImportedCssFiles.set(chunk, unique(allFiles));
|
|
31759
|
+
if (complete) analyzedImportedCssFiles.set(chunk, unique(allFiles));
|
|
31703
31760
|
return filteredFiles;
|
|
31704
31761
|
}
|
|
31705
31762
|
/**
|
|
@@ -32306,9 +32363,7 @@ function getImportMapFilename(options) {
|
|
|
32306
32363
|
return "importmap.json";
|
|
32307
32364
|
}
|
|
32308
32365
|
function getImportMapBaseUrl(options) {
|
|
32309
|
-
|
|
32310
|
-
if (typeof chunkImportMap === "object" && chunkImportMap.baseUrl) return chunkImportMap.baseUrl;
|
|
32311
|
-
return "/";
|
|
32366
|
+
return options.base;
|
|
32312
32367
|
}
|
|
32313
32368
|
/**
|
|
32314
32369
|
* Read and parse the chunk import map asset from the bundle.
|
|
@@ -33978,6 +34033,7 @@ async function resolvePlugins(config, prePlugins, normalPlugins, postPlugins) {
|
|
|
33978
34033
|
},
|
|
33979
34034
|
...prePlugins,
|
|
33980
34035
|
modulePreload !== false && modulePreload.polyfill ? modulePreloadPolyfillPlugin() : null,
|
|
34036
|
+
bundledDevClientImportsPlugin(config),
|
|
33981
34037
|
...oxcResolvePlugin({
|
|
33982
34038
|
root: config.root,
|
|
33983
34039
|
isProduction: config.isProduction,
|
|
@@ -36372,11 +36428,13 @@ var BundledDev = class {
|
|
|
36372
36428
|
}
|
|
36373
36429
|
async storeStaticFiles() {
|
|
36374
36430
|
const sources = new Map([[BUNDLED_DEV_CLIENT_FILENAME, await getHmrImplementation(this.environment.getTopLevelConfig())], ...getRolldownDevRuntimeFiles()]);
|
|
36431
|
+
const aliases = getBundledDevClientAliases(this.environment.getTopLevelConfig());
|
|
36375
36432
|
this.staticFiles.clear();
|
|
36376
|
-
for (const [fileName, source] of sources) {
|
|
36433
|
+
for (const [fileName, source] of [...sources, ...aliases]) {
|
|
36377
36434
|
const file = {
|
|
36378
36435
|
source,
|
|
36379
|
-
etag: (0, import_etag.default)(Buffer.from(source), { weak: true })
|
|
36436
|
+
etag: (0, import_etag.default)(Buffer.from(source), { weak: true }),
|
|
36437
|
+
...aliases.has(fileName) ? { contentType: "text/javascript" } : {}
|
|
36380
36438
|
};
|
|
36381
36439
|
this.staticFiles.set(fileName, file);
|
|
36382
36440
|
this.memoryFiles.set(fileName, file);
|
|
@@ -37294,19 +37352,6 @@ const configDefaults = Object.freeze({
|
|
|
37294
37352
|
environments: {},
|
|
37295
37353
|
appType: "spa"
|
|
37296
37354
|
});
|
|
37297
|
-
function normalizeInput(input) {
|
|
37298
|
-
if (input === void 0) return;
|
|
37299
|
-
if (typeof input === "string") return unescapeGlobCharacters(input);
|
|
37300
|
-
if (Array.isArray(input)) return input.map(unescapeGlobCharacters);
|
|
37301
|
-
const resolved = {};
|
|
37302
|
-
for (const key in input) resolved[key] = unescapeGlobCharacters(input[key]);
|
|
37303
|
-
return resolved;
|
|
37304
|
-
}
|
|
37305
|
-
const escapedGlobCharactersRE = /\\([*?[\]{}()!+@|])/g;
|
|
37306
|
-
function unescapeGlobCharacters(value) {
|
|
37307
|
-
if (isDynamicPattern(value)) throw new Error(`\`input\` cannot contain glob characters. They are reserved, so the ${JSON.stringify(value)} is not allowed. Please escape them with a backslash (\\)`);
|
|
37308
|
-
return value.replace(escapedGlobCharactersRE, "$1");
|
|
37309
|
-
}
|
|
37310
37355
|
function resolveDevEnvironmentOptions(dev, environmentName, consumer, preTransformRequest) {
|
|
37311
37356
|
const resolved = mergeWithDefaults({
|
|
37312
37357
|
...configDefaults.dev,
|
|
@@ -37335,7 +37380,7 @@ function resolveEnvironmentOptions(options, alias, preserveSymlinks, forceOptimi
|
|
|
37335
37380
|
}
|
|
37336
37381
|
const resolve = resolveEnvironmentResolveOptions(options.resolve, alias, preserveSymlinks, logger, consumer, isSsrTargetWebworkerEnvironment);
|
|
37337
37382
|
return {
|
|
37338
|
-
input:
|
|
37383
|
+
input: options.input,
|
|
37339
37384
|
define: options.define,
|
|
37340
37385
|
resolve,
|
|
37341
37386
|
keepProcessEnv: options.keepProcessEnv ?? (isSsrTargetWebworkerEnvironment ? false : consumer === "server"),
|
|
@@ -37636,7 +37681,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
37636
37681
|
const assetsFilter = config.assetsInclude && (!Array.isArray(config.assetsInclude) || config.assetsInclude.length) ? createFilter$1(config.assetsInclude) : () => false;
|
|
37637
37682
|
const { publicDir } = config;
|
|
37638
37683
|
const resolvedPublicDir = publicDir !== false && publicDir !== "" ? normalizePath(path.resolve(resolvedRoot, typeof publicDir === "string" ? publicDir : configDefaults.publicDir)) : "";
|
|
37639
|
-
const input = normalizeInput(config.input);
|
|
37640
37684
|
const server = await resolveServerOptions(resolvedRoot, config.server, logger);
|
|
37641
37685
|
const builder = resolveBuilderOptions(config.builder);
|
|
37642
37686
|
const BASE_URL = resolvedBase;
|
|
@@ -37763,7 +37807,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
|
|
37763
37807
|
removeSsrLoadModule: "warn"
|
|
37764
37808
|
} : config.future,
|
|
37765
37809
|
ssr,
|
|
37766
|
-
input,
|
|
37810
|
+
input: config.input,
|
|
37767
37811
|
optimizeDeps: backwardCompatibleOptimizeDeps,
|
|
37768
37812
|
resolve: resolvedDefaultResolve,
|
|
37769
37813
|
dev: resolvedDevEnvironmentOptions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ft as __commonJSMin, pt as __require } from "./node.js";
|
|
2
2
|
import { t as require_lib } from "./lib.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
3
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/format-import-prelude.js
|
|
4
4
|
var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
5
|
module.exports = function formatImportPrelude(layer, media, supports) {
|
|
6
6
|
const parts = [];
|
|
@@ -15,7 +15,7 @@ var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
15
15
|
};
|
|
16
16
|
}));
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
18
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/base64-encoded-import.js
|
|
19
19
|
var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
20
20
|
const formatImportPrelude = require_format_import_prelude();
|
|
21
21
|
module.exports = function base64EncodedConditionalImport(prelude, conditions) {
|
|
@@ -28,7 +28,7 @@ var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
28
28
|
};
|
|
29
29
|
}));
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
31
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/apply-conditions.js
|
|
32
32
|
var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33
33
|
const base64EncodedConditionalImport = require_base64_encoded_import();
|
|
34
34
|
module.exports = function applyConditions(bundle, atRule) {
|
|
@@ -103,7 +103,7 @@ var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
103
103
|
};
|
|
104
104
|
}));
|
|
105
105
|
//#endregion
|
|
106
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
106
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/apply-raws.js
|
|
107
107
|
var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
108
108
|
module.exports = function applyRaws(bundle) {
|
|
109
109
|
bundle.forEach((stmt, index) => {
|
|
@@ -114,7 +114,7 @@ var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
114
114
|
};
|
|
115
115
|
}));
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
117
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/apply-styles.js
|
|
118
118
|
var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
119
119
|
module.exports = function applyStyles(bundle, styles) {
|
|
120
120
|
styles.nodes = [];
|
|
@@ -134,7 +134,7 @@ var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134
134
|
};
|
|
135
135
|
}));
|
|
136
136
|
//#endregion
|
|
137
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
137
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/data-url.js
|
|
138
138
|
var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
139
139
|
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
|
140
140
|
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
|
@@ -153,7 +153,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
153
153
|
};
|
|
154
154
|
}));
|
|
155
155
|
//#endregion
|
|
156
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
156
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/parse-statements.js
|
|
157
157
|
var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
158
158
|
const valueParser = require_lib();
|
|
159
159
|
const { stringify } = valueParser;
|
|
@@ -278,7 +278,7 @@ var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
278
278
|
}
|
|
279
279
|
}));
|
|
280
280
|
//#endregion
|
|
281
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
281
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/process-content.js
|
|
282
282
|
var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
283
283
|
const path$2 = __require("path");
|
|
284
284
|
let sugarss;
|
|
@@ -312,7 +312,7 @@ var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
312
312
|
}
|
|
313
313
|
}));
|
|
314
314
|
//#endregion
|
|
315
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
315
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/lib/parse-styles.js
|
|
316
316
|
var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
317
317
|
const path$1 = __require("path");
|
|
318
318
|
const dataURL = require_data_url();
|
|
@@ -416,7 +416,7 @@ var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
416
416
|
module.exports = parseStyles;
|
|
417
417
|
}));
|
|
418
418
|
//#endregion
|
|
419
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.
|
|
419
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.2.0_postcss@8.5.29/node_modules/postcss-import/index.js
|
|
420
420
|
var require_postcss_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
421
421
|
const path = __require("path");
|
|
422
422
|
const applyConditions = require_apply_conditions();
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1100,6 +1100,7 @@ export declare function optimizeDeps(config: ResolvedConfig, force?: boolean | u
|
|
|
1100
1100
|
type MemoryFile = {
|
|
1101
1101
|
source: string | Uint8Array;
|
|
1102
1102
|
etag?: string;
|
|
1103
|
+
contentType?: string;
|
|
1103
1104
|
};
|
|
1104
1105
|
declare class MemoryFiles {
|
|
1105
1106
|
private files;
|
|
@@ -3132,7 +3133,7 @@ type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: stri
|
|
|
3132
3133
|
*/
|
|
3133
3134
|
export declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
|
|
3134
3135
|
//#endregion
|
|
3135
|
-
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.
|
|
3136
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.29_tsx@4.23.15_yaml@2.9.1/node_modules/postcss-load-config/src/index.d.ts
|
|
3136
3137
|
type ConfigPlugin = Transformer | PostCSS.Plugin | Processor;
|
|
3137
3138
|
interface Config {
|
|
3138
3139
|
parser?: string | ProcessOptions['parser'] | false;
|
|
@@ -402,8 +402,8 @@ var HMRContext = class {
|
|
|
402
402
|
else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
|
|
403
403
|
else throw Error("invalid hot.accept() usage.");
|
|
404
404
|
}
|
|
405
|
-
acceptExports(
|
|
406
|
-
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
|
|
405
|
+
acceptExports(exportNames, callback) {
|
|
406
|
+
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod), typeof exportNames == "string" ? [exportNames] : exportNames);
|
|
407
407
|
}
|
|
408
408
|
dispose(cb) {
|
|
409
409
|
this.hmrClient.disposeMap.set(this.ownerPath, cb);
|
|
@@ -451,14 +451,15 @@ var HMRContext = class {
|
|
|
451
451
|
data
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
acceptDeps(deps, callback = () => {}) {
|
|
454
|
+
acceptDeps(deps, callback = () => {}, exports) {
|
|
455
455
|
let mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
|
|
456
456
|
id: this.ownerPath,
|
|
457
457
|
callbacks: []
|
|
458
458
|
};
|
|
459
459
|
mod.callbacks.push({
|
|
460
460
|
deps,
|
|
461
|
-
fn: callback
|
|
461
|
+
fn: callback,
|
|
462
|
+
exports
|
|
462
463
|
}), this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
|
463
464
|
}
|
|
464
465
|
}, HMRClient = class {
|
|
@@ -1073,13 +1074,14 @@ function wrapCallSite(frame, state) {
|
|
|
1073
1074
|
}), frame.isNative()) return state.curPosition = null, frame;
|
|
1074
1075
|
let source = frame.getFileName() || frame.getScriptNameOrSourceURL();
|
|
1075
1076
|
if (source) {
|
|
1076
|
-
let
|
|
1077
|
+
let unmapped = {
|
|
1077
1078
|
name: null,
|
|
1078
1079
|
source,
|
|
1079
1080
|
line: frame.getLineNumber() ?? 0,
|
|
1080
1081
|
column: (frame.getColumnNumber() ?? 1) - 1
|
|
1081
|
-
});
|
|
1082
|
-
state.curPosition = position, frame
|
|
1082
|
+
}, position = mapSourcePosition(unmapped);
|
|
1083
|
+
if (state.curPosition = position, position === unmapped && !state.nextPosition?.name && frame.getColumnNumber() != null && frame.getScriptNameOrSourceURL() === source) return frame;
|
|
1084
|
+
frame = cloneCallSite(frame);
|
|
1083
1085
|
let originalFunctionName = frame.getFunctionName;
|
|
1084
1086
|
return frame.getFunctionName = function() {
|
|
1085
1087
|
let name = state.nextPosition == null ? originalFunctionName() : state.nextPosition.name || originalFunctionName();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.4",
|
|
4
4
|
"description": "Native-ESM powered web dev build tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build-tool",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"lightningcss": "^1.33.0",
|
|
60
60
|
"picomatch": "^4.0.7",
|
|
61
|
-
"postcss": "^8.5.
|
|
62
|
-
"rolldown": "~1.2.
|
|
61
|
+
"postcss": "^8.5.29",
|
|
62
|
+
"rolldown": "~1.2.12",
|
|
63
63
|
"tinyglobby": "^0.2.17"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@vitest/utils": "^4.1.11",
|
|
78
78
|
"@voidzero-dev/vite-task-client": "^0.2.0",
|
|
79
79
|
"artichokie": "^0.4.5",
|
|
80
|
-
"baseline-browser-mapping": "^2.11.
|
|
80
|
+
"baseline-browser-mapping": "^2.11.27",
|
|
81
81
|
"cac": "^7.0.0",
|
|
82
82
|
"chokidar": "^3.6.0",
|
|
83
83
|
"connect": "^3.7.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"host-validation-middleware": "^0.1.4",
|
|
94
94
|
"http-proxy-3": "^1.23.3",
|
|
95
95
|
"launch-editor-middleware": "^2.14.2",
|
|
96
|
-
"magic-string": "^1.4.
|
|
96
|
+
"magic-string": "^1.4.3",
|
|
97
97
|
"mlly": "^1.8.2",
|
|
98
98
|
"mrmime": "^2.0.1",
|
|
99
99
|
"nanoid": "^5.1.16",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"rolldown-plugin-dts": "^0.28.6",
|
|
112
112
|
"rollup": "^4.59.0",
|
|
113
113
|
"rollup-plugin-license": "^3.7.1",
|
|
114
|
-
"sass": "^1.105.
|
|
115
|
-
"sass-embedded": "^1.105.
|
|
114
|
+
"sass": "^1.105.1",
|
|
115
|
+
"sass-embedded": "^1.105.1",
|
|
116
116
|
"sirv": "^3.0.2",
|
|
117
117
|
"strip-literal": "^4.0.0",
|
|
118
118
|
"terser": "^5.51.2",
|