vite 8.1.0-beta.0 → 8.1.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.
@@ -8,7 +8,7 @@ let nanoid = (size = 21) => {
8
8
  return id;
9
9
  };
10
10
  //#endregion
11
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/typeof.js
11
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
12
12
  function _typeof(o) {
13
13
  "@babel/helpers - typeof";
14
14
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -18,7 +18,7 @@ function _typeof(o) {
18
18
  }, _typeof(o);
19
19
  }
20
20
  //#endregion
21
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/toPrimitive.js
21
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
22
22
  function toPrimitive(t, r) {
23
23
  if ("object" != _typeof(t) || !t) return t;
24
24
  var e = t[Symbol.toPrimitive];
@@ -30,13 +30,13 @@ function toPrimitive(t, r) {
30
30
  return ("string" === r ? String : Number)(t);
31
31
  }
32
32
  //#endregion
33
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/toPropertyKey.js
33
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
34
34
  function toPropertyKey(t) {
35
35
  var i = toPrimitive(t, "string");
36
36
  return "symbol" == _typeof(i) ? i : i + "";
37
37
  }
38
38
  //#endregion
39
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/defineProperty.js
39
+ //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
40
40
  function _defineProperty(e, r, t) {
41
41
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
42
42
  value: t,
@@ -1206,9 +1206,7 @@ function updateStyle(id, content) {
1206
1206
  }
1207
1207
  function removeStyle(id) {
1208
1208
  if (linkSheetsMap.has(id)) {
1209
- document.querySelectorAll(`link[rel="stylesheet"][data-vite-dev-id]`).forEach((el) => {
1210
- if (el.getAttribute("data-vite-dev-id") === id) el.remove();
1211
- });
1209
+ document.querySelectorAll(`link[rel="stylesheet"][data-vite-dev-id="${CSS.escape(id)}"]`).forEach((el) => el.remove());
1212
1210
  linkSheetsMap.delete(id);
1213
1211
  }
1214
1212
  const style = sheetsMap.get(id);
@@ -256,16 +256,6 @@ var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => {
256
256
  //#endregion
257
257
  //#region ../../node_modules/.pnpm/lodash.camelcase@4.3.0/node_modules/lodash.camelcase/index.js
258
258
  var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module) => {
259
- /**
260
- * lodash (Custom Build) <https://lodash.com/>
261
- * Build: `lodash modularize exports="npm" -o ./`
262
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
263
- * Released under MIT license <https://lodash.com/license>
264
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
265
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
266
- */
267
- /** Used as references for various `Number` constants. */
268
- var INFINITY = Infinity;
269
259
  /** `Object#toString` result references. */
270
260
  var symbolTag = "[object Symbol]";
271
261
  /** Used to match words composed of alphanumeric characters. */
@@ -668,7 +658,7 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
668
658
  if (typeof value == "string") return value;
669
659
  if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
670
660
  var result = value + "";
671
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
661
+ return result == "0" && 1 / value == -Infinity ? "-0" : result;
672
662
  }
673
663
  /**
674
664
  * Casts `array` to a slice if it's needed.
@@ -1,5 +1,5 @@
1
1
  //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/unicode.js
2
- const UNDEFINED_CODE_POINTS = new Set([
2
+ const UNDEFINED_CODE_POINTS = /* @__PURE__ */ new Set([
3
3
  65534,
4
4
  65535,
5
5
  131070,
@@ -323,7 +323,7 @@ function getTokenAttr(token, attrName) {
323
323
  }
324
324
  //#endregion
325
325
  //#region ../../node_modules/.pnpm/entities@8.0.0/node_modules/entities/dist/decode-codepoint.js
326
- const decodeMap = new Map([
326
+ const decodeMap = /* @__PURE__ */ new Map([
327
327
  [0, 65533],
328
328
  [128, 8364],
329
329
  [130, 8218],
@@ -1038,7 +1038,7 @@ var TAG_ID;
1038
1038
  TAG_ID[TAG_ID["WBR"] = 122] = "WBR";
1039
1039
  TAG_ID[TAG_ID["XMP"] = 123] = "XMP";
1040
1040
  })(TAG_ID || (TAG_ID = {}));
1041
- const TAG_NAME_TO_ID = new Map([
1041
+ const TAG_NAME_TO_ID = /* @__PURE__ */ new Map([
1042
1042
  [TAG_NAMES.A, TAG_ID.A],
1043
1043
  [TAG_NAMES.ADDRESS, TAG_ID.ADDRESS],
1044
1044
  [TAG_NAMES.ANNOTATION_XML, TAG_ID.ANNOTATION_XML],
@@ -1169,7 +1169,7 @@ function getTagID(tagName) {
1169
1169
  }
1170
1170
  const $ = TAG_ID;
1171
1171
  const SPECIAL_ELEMENTS = {
1172
- [NS.HTML]: new Set([
1172
+ [NS.HTML]: /* @__PURE__ */ new Set([
1173
1173
  $.ADDRESS,
1174
1174
  $.APPLET,
1175
1175
  $.AREA,
@@ -1252,7 +1252,7 @@ const SPECIAL_ELEMENTS = {
1252
1252
  $.WBR,
1253
1253
  $.XMP
1254
1254
  ]),
1255
- [NS.MATHML]: new Set([
1255
+ [NS.MATHML]: /* @__PURE__ */ new Set([
1256
1256
  $.MI,
1257
1257
  $.MO,
1258
1258
  $.MN,
@@ -1260,7 +1260,7 @@ const SPECIAL_ELEMENTS = {
1260
1260
  $.MTEXT,
1261
1261
  $.ANNOTATION_XML
1262
1262
  ]),
1263
- [NS.SVG]: new Set([
1263
+ [NS.SVG]: /* @__PURE__ */ new Set([
1264
1264
  $.TITLE,
1265
1265
  $.FOREIGN_OBJECT,
1266
1266
  $.DESC
@@ -1269,7 +1269,7 @@ const SPECIAL_ELEMENTS = {
1269
1269
  [NS.XML]: /* @__PURE__ */ new Set(),
1270
1270
  [NS.XMLNS]: /* @__PURE__ */ new Set()
1271
1271
  };
1272
- const NUMBERED_HEADERS = new Set([
1272
+ const NUMBERED_HEADERS = /* @__PURE__ */ new Set([
1273
1273
  $.H1,
1274
1274
  $.H2,
1275
1275
  $.H3,
@@ -3337,7 +3337,7 @@ var Tokenizer = class {
3337
3337
  };
3338
3338
  //#endregion
3339
3339
  //#region ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/parser/open-element-stack.js
3340
- const IMPLICIT_END_TAG_REQUIRED = new Set([
3340
+ const IMPLICIT_END_TAG_REQUIRED = /* @__PURE__ */ new Set([
3341
3341
  TAG_ID.DD,
3342
3342
  TAG_ID.DT,
3343
3343
  TAG_ID.LI,
@@ -3349,7 +3349,7 @@ const IMPLICIT_END_TAG_REQUIRED = new Set([
3349
3349
  TAG_ID.RT,
3350
3350
  TAG_ID.RTC
3351
3351
  ]);
3352
- const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = new Set([
3352
+ const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = /* @__PURE__ */ new Set([
3353
3353
  ...IMPLICIT_END_TAG_REQUIRED,
3354
3354
  TAG_ID.CAPTION,
3355
3355
  TAG_ID.COLGROUP,
@@ -3360,7 +3360,7 @@ const IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = new Set([
3360
3360
  TAG_ID.THEAD,
3361
3361
  TAG_ID.TR
3362
3362
  ]);
3363
- const SCOPING_ELEMENTS_HTML = new Set([
3363
+ const SCOPING_ELEMENTS_HTML = /* @__PURE__ */ new Set([
3364
3364
  TAG_ID.APPLET,
3365
3365
  TAG_ID.CAPTION,
3366
3366
  TAG_ID.HTML,
@@ -3371,13 +3371,13 @@ const SCOPING_ELEMENTS_HTML = new Set([
3371
3371
  TAG_ID.TEMPLATE,
3372
3372
  TAG_ID.TH
3373
3373
  ]);
3374
- const SCOPING_ELEMENTS_HTML_LIST = new Set([
3374
+ const SCOPING_ELEMENTS_HTML_LIST = /* @__PURE__ */ new Set([
3375
3375
  ...SCOPING_ELEMENTS_HTML,
3376
3376
  TAG_ID.OL,
3377
3377
  TAG_ID.UL
3378
3378
  ]);
3379
- const SCOPING_ELEMENTS_HTML_BUTTON = new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.BUTTON]);
3380
- const SCOPING_ELEMENTS_MATHML = new Set([
3379
+ const SCOPING_ELEMENTS_HTML_BUTTON = /* @__PURE__ */ new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.BUTTON]);
3380
+ const SCOPING_ELEMENTS_MATHML = /* @__PURE__ */ new Set([
3381
3381
  TAG_ID.ANNOTATION_XML,
3382
3382
  TAG_ID.MI,
3383
3383
  TAG_ID.MN,
@@ -3385,29 +3385,29 @@ const SCOPING_ELEMENTS_MATHML = new Set([
3385
3385
  TAG_ID.MS,
3386
3386
  TAG_ID.MTEXT
3387
3387
  ]);
3388
- const SCOPING_ELEMENTS_SVG = new Set([
3388
+ const SCOPING_ELEMENTS_SVG = /* @__PURE__ */ new Set([
3389
3389
  TAG_ID.DESC,
3390
3390
  TAG_ID.FOREIGN_OBJECT,
3391
3391
  TAG_ID.TITLE
3392
3392
  ]);
3393
- const TABLE_ROW_CONTEXT = new Set([
3393
+ const TABLE_ROW_CONTEXT = /* @__PURE__ */ new Set([
3394
3394
  TAG_ID.TR,
3395
3395
  TAG_ID.TEMPLATE,
3396
3396
  TAG_ID.HTML
3397
3397
  ]);
3398
- const TABLE_BODY_CONTEXT = new Set([
3398
+ const TABLE_BODY_CONTEXT = /* @__PURE__ */ new Set([
3399
3399
  TAG_ID.TBODY,
3400
3400
  TAG_ID.TFOOT,
3401
3401
  TAG_ID.THEAD,
3402
3402
  TAG_ID.TEMPLATE,
3403
3403
  TAG_ID.HTML
3404
3404
  ]);
3405
- const TABLE_CONTEXT = new Set([
3405
+ const TABLE_CONTEXT = /* @__PURE__ */ new Set([
3406
3406
  TAG_ID.TABLE,
3407
3407
  TAG_ID.TEMPLATE,
3408
3408
  TAG_ID.HTML
3409
3409
  ]);
3410
- const TABLE_CELLS = new Set([TAG_ID.TD, TAG_ID.TH]);
3410
+ const TABLE_CELLS = /* @__PURE__ */ new Set([TAG_ID.TD, TAG_ID.TH]);
3411
3411
  var OpenElementStack = class {
3412
3412
  get currentTmplContentOrNode() {
3413
3413
  return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
@@ -3943,7 +3943,7 @@ const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
3943
3943
  "-//w3c//dtd html 4.01 frameset//",
3944
3944
  "-//w3c//dtd html 4.01 transitional//"
3945
3945
  ];
3946
- const QUIRKS_MODE_PUBLIC_IDS = new Set([
3946
+ const QUIRKS_MODE_PUBLIC_IDS = /* @__PURE__ */ new Set([
3947
3947
  "-//w3o//dtd w3 html strict 3.0//en//",
3948
3948
  "-/w3c/dtd html 4.0 transitional/en",
3949
3949
  "html"
@@ -4043,7 +4043,7 @@ const SVG_ATTRS_ADJUSTMENT_MAP = new Map([
4043
4043
  "yChannelSelector",
4044
4044
  "zoomAndPan"
4045
4045
  ].map((attr) => [attr.toLowerCase(), attr]));
4046
- const XML_ATTRS_ADJUSTMENT_MAP = new Map([
4046
+ const XML_ATTRS_ADJUSTMENT_MAP = /* @__PURE__ */ new Map([
4047
4047
  ["xlink:actuate", {
4048
4048
  prefix: "xlink",
4049
4049
  name: "actuate",
@@ -4138,7 +4138,7 @@ const SVG_TAG_NAMES_ADJUSTMENT_MAP = new Map([
4138
4138
  "radialGradient",
4139
4139
  "textPath"
4140
4140
  ].map((tn) => [tn.toLowerCase(), tn]));
4141
- const EXITS_FOREIGN_CONTENT = new Set([
4141
+ const EXITS_FOREIGN_CONTENT = /* @__PURE__ */ new Set([
4142
4142
  TAG_ID.B,
4143
4143
  TAG_ID.BIG,
4144
4144
  TAG_ID.BLOCKQUOTE,
@@ -4271,7 +4271,7 @@ const BASE_LOC = {
4271
4271
  endCol: -1,
4272
4272
  endOffset: -1
4273
4273
  };
4274
- const TABLE_STRUCTURE_TAGS = new Set([
4274
+ const TABLE_STRUCTURE_TAGS = /* @__PURE__ */ new Set([
4275
4275
  TAG_ID.TABLE,
4276
4276
  TAG_ID.TBODY,
4277
4277
  TAG_ID.TFOOT,
@@ -6253,7 +6253,7 @@ function tokenInTableText(p, token) {
6253
6253
  p.insertionMode = p.originalInsertionMode;
6254
6254
  p._processToken(token);
6255
6255
  }
6256
- const TABLE_VOID_ELEMENTS = new Set([
6256
+ const TABLE_VOID_ELEMENTS = /* @__PURE__ */ new Set([
6257
6257
  TAG_ID.CAPTION,
6258
6258
  TAG_ID.COL,
6259
6259
  TAG_ID.COLGROUP,
@@ -10,7 +10,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
11
11
  var __getProtoOf = Object.getPrototypeOf;
12
12
  var __hasOwnProp = Object.prototype.hasOwnProperty;
13
- var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
+ var __esmMin = (fn, res, err) => () => {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = fn(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
20
+ };
14
21
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15
22
  var __exportAll = (all, no_symbols) => {
16
23
  let target = {};
@@ -36,7 +43,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
43
  enumerable: true
37
44
  }) : target, mod));
38
45
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
46
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
40
47
  //#endregion
41
48
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
42
49
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -237,13 +244,13 @@ const KNOWN_ASSET_TYPES = [
237
244
  ];
238
245
  const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join("|") + `)(\\?.*)?$`, "i");
239
246
  const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
240
- const loopbackHosts = new Set([
247
+ const loopbackHosts = /* @__PURE__ */ new Set([
241
248
  "localhost",
242
249
  "127.0.0.1",
243
250
  "::1",
244
251
  "0000:0000:0000:0000:0000:0000:0000:0001"
245
252
  ]);
246
- const wildcardHosts = new Set([
253
+ const wildcardHosts = /* @__PURE__ */ new Set([
247
254
  "0.0.0.0",
248
255
  "::",
249
256
  "0000:0000:0000:0000:0000:0000:0000:0000"
@@ -11,7 +11,7 @@ import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
11
11
  import { format, formatWithOptions, inspect, parseEnv, promisify, stripVTControlCharacters } from "node:util";
12
12
  import { performance as performance$1 } from "node:perf_hooks";
13
13
  import crypto from "node:crypto";
14
- import picomatch from "picomatch";
14
+ import pm from "picomatch";
15
15
  import { MessageChannel, Worker } from "node:worker_threads";
16
16
  import { VERSION as rolldownVersion, rolldown } from "rolldown";
17
17
  import os from "node:os";
@@ -37,7 +37,13 @@ import { Buffer as Buffer$1 } from "node:buffer";
37
37
  import zlib from "zlib";
38
38
  import * as qs from "node:querystring";
39
39
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
40
- //#region ../../node_modules/.pnpm/@voidzero-dev+vite-task-client@0.1.1/node_modules/@voidzero-dev/vite-task-client/src/index.js
40
+ //#region ../../node_modules/.pnpm/@voidzero-dev+vite-task-client@0.2.0/node_modules/@voidzero-dev/vite-task-client/src/index.js
41
+ /**
42
+ * @typedef {{ tracked?: boolean }} GetEnvOptions
43
+ */
44
+ /**
45
+ * @typedef {string | { prefix: string }} GetEnvsQuery
46
+ */
41
47
  /**
42
48
  * Methods exposed by the napi addon. Keep this shape in sync with the
43
49
  * `RunnerClient` returned by `load()` in
@@ -48,8 +54,8 @@ import { setTimeout as setTimeout$1 } from "node:timers/promises";
48
54
  * ignoreInput: (path: string) => void,
49
55
  * ignoreOutput: (path: string) => void,
50
56
  * disableCache: () => void,
51
- * getEnv: (name: string, options?: { tracked?: boolean }) => string | undefined,
52
- * getEnvs: (pattern: string, options?: { tracked?: boolean }) => Record<string, string>,
57
+ * getEnv: (name: string, options?: GetEnvOptions) => string | undefined,
58
+ * getEnvs: (query: GetEnvsQuery, options?: GetEnvOptions) => Record<string, string>,
53
59
  * } | null | undefined}
54
60
  */
55
61
  let addon;
@@ -117,8 +123,10 @@ function getEnv(name, options) {
117
123
  return a.getEnv(name, options);
118
124
  }
119
125
  /**
120
- * Ask the runner for every env whose name matches `pattern` (a glob, e.g.
121
- * `VITE_*`) and return the match-set as a plain object.
126
+ * Ask the runner for matching envs and return the match-set as a plain object.
127
+ *
128
+ * Pass a glob string (e.g. `VITE_*`) to use glob matching, or pass
129
+ * `{ prefix: 'VITE_' }` to match env names by literal prefix.
122
130
  *
123
131
  * With `tracked: true` (the default) the runner records the pattern as a
124
132
  * dependency, so adding, removing, or changing a matching env invalidates
@@ -127,14 +135,14 @@ function getEnv(name, options) {
127
135
  * Has no effect on `process.env`; the caller decides what to do with the
128
136
  * returned values. Returns an empty object when not running inside a runner.
129
137
  *
130
- * @param {string} pattern
131
- * @param {{ tracked?: boolean }} [options]
138
+ * @param {GetEnvsQuery} query
139
+ * @param {GetEnvOptions} [options]
132
140
  * @returns {Record<string, string>}
133
141
  */
134
- function getEnvs(pattern, options) {
142
+ function getEnvs(query, options) {
135
143
  const a = load$1();
136
144
  if (!a) return {};
137
- return a.getEnvs(pattern, options);
145
+ return a.getEnvs(query, options);
138
146
  }
139
147
  //#endregion
140
148
  //#region ../../node_modules/.pnpm/fresh-import@0.2.1/node_modules/fresh-import/dist/index.js
@@ -426,8 +434,8 @@ const importMetaResolveWithCustomHookString = `
426
434
  var comma$1 = ",".charCodeAt(0);
427
435
  var semicolon = ";".charCodeAt(0);
428
436
  var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
429
- var intToChar$1 = new Uint8Array(64);
430
- var charToInt$1 = new Uint8Array(128);
437
+ var intToChar$1 = /* @__PURE__ */ new Uint8Array(64);
438
+ var charToInt$1 = /* @__PURE__ */ new Uint8Array(128);
431
439
  for (let i = 0; i < chars$1.length; i++) {
432
440
  const c = chars$1.charCodeAt(i);
433
441
  intToChar$1[i] = c;
@@ -1476,7 +1484,7 @@ function getMatcherString$1(id, resolutionBase) {
1476
1484
  const createFilter$2 = function createFilter(include, exclude, options) {
1477
1485
  const resolutionBase = options && options.resolve;
1478
1486
  const getMatcher = (id) => id instanceof RegExp ? id : { test: (what) => {
1479
- return picomatch(getMatcherString$1(id, resolutionBase), { dot: true })(what);
1487
+ return pm(getMatcherString$1(id, resolutionBase), { dot: true })(what);
1480
1488
  } };
1481
1489
  const includeMatchers = ensureArray(include).map(getMatcher);
1482
1490
  const excludeMatchers = ensureArray(exclude).map(getMatcher);
@@ -2371,7 +2379,7 @@ function resolveServerUrls(server, options, hostname, httpsOptions, config) {
2371
2379
  });
2372
2380
  const hostnamesFromCert = extractHostnamesFromCerts(httpsOptions?.cert);
2373
2381
  if (hostnamesFromCert.length > 0) {
2374
- const existings = new Set([...local, ...network]);
2382
+ const existings = /* @__PURE__ */ new Set([...local, ...network]);
2375
2383
  local.push(...hostnamesFromCert.map((hostname) => `${protocol}://${hostname}:${port}${base}`).filter((url) => !existings.has(url)));
2376
2384
  }
2377
2385
  return {
@@ -2459,7 +2467,7 @@ const environmentPathRE = /^environments\.[^.]+$/;
2459
2467
  function mergeWithDefaults(defaults, values) {
2460
2468
  return mergeWithDefaultsRecursively(deepClone(defaults), values);
2461
2469
  }
2462
- const runtimeDeprecatedPath = new Set(["optimizeDeps", "ssr.optimizeDeps"]);
2470
+ const runtimeDeprecatedPath = /* @__PURE__ */ new Set(["optimizeDeps", "ssr.optimizeDeps"]);
2463
2471
  const rollupOptionsDeprecationCall = (() => {
2464
2472
  return () => {
2465
2473
  const method = process.env.VITE_DEPRECATION_TRACE ? "trace" : "warn";
@@ -2481,7 +2489,7 @@ function setupRollupOptionCompat(buildConfig, path) {
2481
2489
  enumerable: true
2482
2490
  });
2483
2491
  }
2484
- const rollupOptionsRootPaths = new Set([
2492
+ const rollupOptionsRootPaths = /* @__PURE__ */ new Set([
2485
2493
  "build",
2486
2494
  "worker",
2487
2495
  "optimizeDeps",
@@ -3451,7 +3459,7 @@ function e(e, n, r) {
3451
3459
  }
3452
3460
  function n$1(n, i, o, f) {
3453
3461
  let s, u, l = r(n, o), c = function(e) {
3454
- let n = new Set(["default", ...e.conditions || []]);
3462
+ let n = /* @__PURE__ */ new Set(["default", ...e.conditions || []]);
3455
3463
  return e.unsafe || n.add(e.require ? "require" : "import"), e.unsafe || n.add(e.browser ? "browser" : "node"), n;
3456
3464
  }(f || {}), a = i[l];
3457
3465
  if (void 0 === a) {
@@ -4876,7 +4884,7 @@ function getImportNames(cleanedImports) {
4876
4884
  */
4877
4885
  const own$1 = {}.hasOwnProperty;
4878
4886
  const classRegExp = /^([A-Z][a-z\d]*)+$/;
4879
- const kTypes = new Set([
4887
+ const kTypes = /* @__PURE__ */ new Set([
4880
4888
  "string",
4881
4889
  "function",
4882
4890
  "number",
@@ -5309,7 +5317,7 @@ function loadEnv(mode, envDir, prefixes = "VITE_") {
5309
5317
  processEnv: { ...process.env }
5310
5318
  });
5311
5319
  for (const [key, value] of Object.entries(parsed)) if (prefixes.some((prefix) => key.startsWith(prefix))) env[key] = value;
5312
- for (const prefix of prefixes) Object.assign(env, getEnvs(`${prefix}*`));
5320
+ for (const prefix of prefixes) Object.assign(env, getEnvs({ prefix }));
5313
5321
  for (const key in process.env) if (prefixes.some((prefix) => key.startsWith(prefix))) env[key] = process.env[key];
5314
5322
  debug$12?.(`using resolved env: %O`, env);
5315
5323
  return env;
@@ -6842,7 +6850,7 @@ var require_readdirp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6842
6850
  const { Readable: Readable$1 } = __require("stream");
6843
6851
  const sysPath$3 = __require("path");
6844
6852
  const { promisify: promisify$4 } = __require("util");
6845
- const picomatch$2 = __require("picomatch");
6853
+ const picomatch$1 = __require("picomatch");
6846
6854
  const readdir = promisify$4(fs$10.readdir);
6847
6855
  const stat = promisify$4(fs$10.stat);
6848
6856
  const lstat = promisify$4(fs$10.lstat);
@@ -6857,7 +6865,7 @@ var require_readdirp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6857
6865
  */
6858
6866
  const BANG = "!";
6859
6867
  const RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
6860
- const NORMAL_FLOW_ERRORS = new Set([
6868
+ const NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set([
6861
6869
  "ENOENT",
6862
6870
  "EPERM",
6863
6871
  "EACCES",
@@ -6881,7 +6889,7 @@ var require_readdirp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6881
6889
  if (filter === void 0) return;
6882
6890
  if (typeof filter === "function") return filter;
6883
6891
  if (typeof filter === "string") {
6884
- const glob = picomatch$2(filter.trim());
6892
+ const glob = picomatch$1(filter.trim());
6885
6893
  return (entry) => glob(entry.basename);
6886
6894
  }
6887
6895
  if (Array.isArray(filter)) {
@@ -6889,8 +6897,8 @@ var require_readdirp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6889
6897
  const negative = [];
6890
6898
  for (const item of filter) {
6891
6899
  const trimmed = item.trim();
6892
- if (trimmed.charAt(0) === BANG) negative.push(picomatch$2(trimmed.slice(1)));
6893
- else positive.push(picomatch$2(trimmed));
6900
+ if (trimmed.charAt(0) === BANG) negative.push(picomatch$1(trimmed.slice(1)));
6901
+ else positive.push(picomatch$1(trimmed));
6894
6902
  }
6895
6903
  if (negative.length > 0) {
6896
6904
  if (positive.length > 0) return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename));
@@ -7120,7 +7128,7 @@ var require_normalize_path = /* @__PURE__ */ __commonJSMin(((exports, module) =>
7120
7128
  //#region ../../node_modules/.pnpm/anymatch@3.1.3/node_modules/anymatch/index.js
7121
7129
  var require_anymatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7122
7130
  Object.defineProperty(exports, "__esModule", { value: true });
7123
- const picomatch$1 = __require("picomatch");
7131
+ const picomatch = __require("picomatch");
7124
7132
  const normalizePath = require_normalize_path();
7125
7133
  /**
7126
7134
  * @typedef {(testString: string) => boolean} AnymatchFn
@@ -7138,7 +7146,7 @@ var require_anymatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7138
7146
  const createPattern = (matcher, options) => {
7139
7147
  if (typeof matcher === "function") return matcher;
7140
7148
  if (typeof matcher === "string") {
7141
- const glob = picomatch$1(matcher, options);
7149
+ const glob = picomatch(matcher, options);
7142
7150
  return (string) => matcher === string || glob(string);
7143
7151
  }
7144
7152
  if (matcher instanceof RegExp) return (string) => matcher.test(string);
@@ -7178,7 +7186,7 @@ var require_anymatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7178
7186
  const opts = typeof options === "boolean" ? { returnIndex: options } : options;
7179
7187
  const returnIndex = opts.returnIndex || false;
7180
7188
  const mtchers = arrify(matchers);
7181
- const negatedGlobs = mtchers.filter((item) => typeof item === "string" && item.charAt(0) === BANG).map((item) => item.slice(1)).map((item) => picomatch$1(item, opts));
7189
+ const negatedGlobs = mtchers.filter((item) => typeof item === "string" && item.charAt(0) === BANG).map((item) => item.slice(1)).map((item) => picomatch(item, opts));
7182
7190
  const patterns = mtchers.filter((item) => typeof item !== "string" || typeof item === "string" && item.charAt(0) !== BANG).map((matcher) => createPattern(matcher, opts));
7183
7191
  if (testString == null) return (testString, ri = false) => {
7184
7192
  return matchPatterns(patterns, negatedGlobs, testString, typeof ri === "boolean" ? ri : false);
@@ -7530,7 +7538,7 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
7530
7538
  let nines = 1;
7531
7539
  let zeros = 1;
7532
7540
  let stop = countNines(min, nines);
7533
- let stops = new Set([max]);
7541
+ let stops = /* @__PURE__ */ new Set([max]);
7534
7542
  while (min <= stop && stop <= max) {
7535
7543
  stops.add(stop);
7536
7544
  nines += 1;
@@ -8769,7 +8777,7 @@ var require_nodefs_handler = /* @__PURE__ */ __commonJSMin(((exports, module) =>
8769
8777
  };
8770
8778
  const addAndConvert = (main, prop, item) => {
8771
8779
  let container = main[prop];
8772
- if (!(container instanceof Set)) main[prop] = container = new Set([container]);
8780
+ if (!(container instanceof Set)) main[prop] = container = /* @__PURE__ */ new Set([container]);
8773
8781
  container.add(item);
8774
8782
  };
8775
8783
  const clearItem = (cont) => (key) => {
@@ -9244,7 +9252,7 @@ var require_fsevents_handler = /* @__PURE__ */ __commonJSMin(((exports, module)
9244
9252
  */
9245
9253
  const FSEventsWatchers = /* @__PURE__ */ new Map();
9246
9254
  const consolidateThreshhold = 10;
9247
- const wrongEventFlags = new Set([
9255
+ const wrongEventFlags = /* @__PURE__ */ new Set([
9248
9256
  69888,
9249
9257
  70400,
9250
9258
  71424,
@@ -9293,7 +9301,7 @@ var require_fsevents_handler = /* @__PURE__ */ __commonJSMin(((exports, module)
9293
9301
  if (cont || watchedParent) cont.listeners.add(filteredListener);
9294
9302
  else {
9295
9303
  cont = {
9296
- listeners: new Set([filteredListener]),
9304
+ listeners: /* @__PURE__ */ new Set([filteredListener]),
9297
9305
  rawEmitter,
9298
9306
  watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
9299
9307
  if (!cont.listeners.size) return;
@@ -12811,7 +12819,7 @@ const BASE_PREVIEW_SHORTCUTS = [{
12811
12819
  //#region src/node/watch.ts
12812
12820
  function getResolvedOutDirs(root, outDir, outputOptions) {
12813
12821
  const resolvedOutDir = path.resolve(root, outDir);
12814
- if (!outputOptions) return new Set([resolvedOutDir]);
12822
+ if (!outputOptions) return /* @__PURE__ */ new Set([resolvedOutDir]);
12815
12823
  return new Set(arraify(outputOptions).map(({ dir }) => dir ? path.resolve(root, dir) : resolvedOutDir));
12816
12824
  }
12817
12825
  function resolveEmptyOutDir(emptyOutDir, root, outDirs, logger) {
@@ -20258,12 +20266,8 @@ function perEnvironmentState(initial) {
20258
20266
  const stateMap = /* @__PURE__ */ new WeakMap();
20259
20267
  return function(context) {
20260
20268
  const { environment } = context;
20261
- let state = stateMap.get(environment);
20262
- if (!state) {
20263
- state = initial(environment);
20264
- stateMap.set(environment, state);
20265
- }
20266
- return state;
20269
+ if (!stateMap.has(environment)) stateMap.set(environment, initial(environment));
20270
+ return stateMap.get(environment);
20267
20271
  };
20268
20272
  }
20269
20273
  //#endregion
@@ -20419,7 +20423,7 @@ function assetPlugin(config) {
20419
20423
  filter: { id: [
20420
20424
  urlRE$1,
20421
20425
  DEFAULT_ASSETS_RE,
20422
- ...makeIdFiltersToMatchWithQuery(config.rawAssetsInclude).map((v) => typeof v === "string" ? picomatch.makeRe(v, { dot: true }) : v)
20426
+ ...makeIdFiltersToMatchWithQuery(config.rawAssetsInclude).map((v) => typeof v === "string" ? pm.makeRe(v, { dot: true }) : v)
20423
20427
  ] },
20424
20428
  handler(id) {
20425
20429
  if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) return;
@@ -22943,7 +22947,7 @@ const normalizeMaxWorkers = (maxWorker) => {
22943
22947
  if (maxWorker === true) return void 0;
22944
22948
  return maxWorker;
22945
22949
  };
22946
- const preprocessorSet = new Set([
22950
+ const preprocessorSet = /* @__PURE__ */ new Set([
22947
22951
  "less",
22948
22952
  "sass",
22949
22953
  "scss",
@@ -23313,7 +23317,7 @@ function addToHTMLProxyCache(config, filePath, index, result) {
23313
23317
  function addToHTMLProxyTransformResult(hash, code) {
23314
23318
  htmlProxyResult.set(hash, code);
23315
23319
  }
23316
- const noInlineLinkRels = new Set([
23320
+ const noInlineLinkRels = /* @__PURE__ */ new Set([
23317
23321
  "icon",
23318
23322
  "apple-touch-icon",
23319
23323
  "apple-touch-startup-image",
@@ -23812,7 +23816,7 @@ function postImportMapHook(config) {
23812
23816
  tag: "script",
23813
23817
  attrs: {
23814
23818
  type: "importmap",
23815
- nonce
23819
+ ...nonce ? { nonce } : {}
23816
23820
  },
23817
23821
  children: typeof importMap.source === "string" ? importMap.source : decoder.decode(importMap.source)
23818
23822
  });
@@ -23866,7 +23870,7 @@ function htmlEnvHook(config) {
23866
23870
  };
23867
23871
  }
23868
23872
  function injectNonceAttributeTagHook(config) {
23869
- const processRelType = new Set([
23873
+ const processRelType = /* @__PURE__ */ new Set([
23870
23874
  "stylesheet",
23871
23875
  "modulepreload",
23872
23876
  "preload"
@@ -23909,7 +23913,7 @@ function resolveHtmlTransforms(plugins) {
23909
23913
  postHooks
23910
23914
  ];
23911
23915
  }
23912
- const elementsAllowedInHead = new Set([
23916
+ const elementsAllowedInHead = /* @__PURE__ */ new Set([
23913
23917
  "title",
23914
23918
  "base",
23915
23919
  "link",
@@ -24006,7 +24010,7 @@ function prependInjectFallback(html, tags) {
24006
24010
  if (doctypePrependInjectRE.test(html)) return html.replace(doctypePrependInjectRE, `$&\n${serializeTags(tags)}`);
24007
24011
  return serializeTags(tags) + html;
24008
24012
  }
24009
- const unaryTags = new Set([
24013
+ const unaryTags = /* @__PURE__ */ new Set([
24010
24014
  "link",
24011
24015
  "meta",
24012
24016
  "base"
@@ -24037,8 +24041,8 @@ function getImportMapFilename(config) {
24037
24041
  //#endregion
24038
24042
  //#region src/node/server/middlewares/transform.ts
24039
24043
  const debugCache = createDebugger("vite:cache");
24040
- const knownIgnoreList = new Set(["/", "/favicon.ico"]);
24041
- const documentFetchDests = new Set([
24044
+ const knownIgnoreList = /* @__PURE__ */ new Set(["/", "/favicon.ico"]);
24045
+ const documentFetchDests = /* @__PURE__ */ new Set([
24042
24046
  "document",
24043
24047
  "iframe",
24044
24048
  "frame",
@@ -25220,7 +25224,13 @@ function memoryFilesMiddleware(server) {
25220
25224
  return function viteMemoryFilesMiddleware(req, res, next) {
25221
25225
  const cleanedUrl = cleanUrl(req.url);
25222
25226
  if (cleanedUrl.endsWith(".html")) return next();
25223
- const filePath = decodeURIComponent(cleanedUrl).slice(1);
25227
+ let pathname;
25228
+ try {
25229
+ pathname = decodeURIComponent(cleanedUrl);
25230
+ } catch {
25231
+ return next();
25232
+ }
25233
+ const filePath = pathname.slice(1);
25224
25234
  const file = memoryFiles.get(filePath);
25225
25235
  if (file) {
25226
25236
  if (file.etag) {
@@ -25660,7 +25670,9 @@ const _serverConfigDefaults = Object.freeze({
25660
25670
  deny: [
25661
25671
  ".env",
25662
25672
  ".env.*",
25663
- "*.{crt,pem}",
25673
+ "*.{crt,pem,key,p12,pfx,cer,der}",
25674
+ ".npmrc",
25675
+ ".yarnrc.yml",
25664
25676
  "**/.git/**"
25665
25677
  ]
25666
25678
  },
@@ -27414,7 +27426,7 @@ function codegenSimpleObject(obj) {
27414
27426
  }).join(", ")} }`;
27415
27427
  }
27416
27428
  const VALID_JS_IDENTIFIER = /^[$_\p{ID_Start}][$\p{ID_Continue}]*$/u;
27417
- const RESERVED_WORDS = new Set([
27429
+ const RESERVED_WORDS = /* @__PURE__ */ new Set([
27418
27430
  "abstract",
27419
27431
  "boolean",
27420
27432
  "break",
@@ -28275,14 +28287,16 @@ function importGlobPlugin(config) {
28275
28287
  const negated = [];
28276
28288
  for (const glob of i.globsResolved) if (glob[0] === "!") negated.push(glob.slice(1));
28277
28289
  else affirmed.push(glob);
28278
- const affirmedMatcher = picomatch(affirmed, {
28290
+ const affirmedMatcher = pm(affirmed, {
28279
28291
  noextglob: true,
28280
28292
  dot: !!i.options.exhaustive,
28293
+ nocase: !(i.options.caseSensitive ?? true),
28281
28294
  ignore: i.options.exhaustive ? [] : ["**/node_modules/**"]
28282
28295
  });
28283
- const negatedMatcher = picomatch(negated, {
28296
+ const negatedMatcher = pm(negated, {
28284
28297
  noextglob: true,
28285
28298
  dot: !!i.options.exhaustive,
28299
+ nocase: !(i.options.caseSensitive ?? true),
28286
28300
  ignore: i.options.exhaustive ? [] : ["**/node_modules/**"]
28287
28301
  });
28288
28302
  return (file) => {
@@ -28577,7 +28591,7 @@ async function toAbsoluteGlob(glob, root, importer, resolveId, base) {
28577
28591
  }
28578
28592
  function getCommonBase(globsResolved) {
28579
28593
  const bases = globsResolved.filter((g) => g[0] !== "!").map((glob) => {
28580
- let { base } = picomatch.scan(glob);
28594
+ let { base } = pm.scan(glob);
28581
28595
  if (posix.basename(base).includes(".")) base = posix.dirname(base);
28582
28596
  return base;
28583
28597
  });
@@ -28608,7 +28622,7 @@ function patternToIdFilter(pattern, cwd) {
28608
28622
  pattern.lastIndex = 0;
28609
28623
  return result;
28610
28624
  };
28611
- const matcher = picomatch(getMatcherString(pattern, cwd), { dot: true });
28625
+ const matcher = pm(getMatcherString(pattern, cwd), { dot: true });
28612
28626
  return (id) => {
28613
28627
  return matcher(slash(id));
28614
28628
  };
@@ -28761,8 +28775,8 @@ const isAbsolute$2 = function(p) {
28761
28775
  //#region ../../node_modules/.pnpm/@vitest+utils@4.1.8/node_modules/@vitest/utils/dist/source-map.js
28762
28776
  var comma = ",".charCodeAt(0);
28763
28777
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
28764
- var intToChar = new Uint8Array(64);
28765
- var charToInt = new Uint8Array(128);
28778
+ var intToChar = /* @__PURE__ */ new Uint8Array(64);
28779
+ var charToInt = /* @__PURE__ */ new Uint8Array(128);
28766
28780
  for (let i = 0; i < chars.length; i++) {
28767
28781
  const c = chars.charCodeAt(i);
28768
28782
  intToChar[i] = c;
@@ -30566,8 +30580,11 @@ function expandGlobIds(id, config) {
30566
30580
  }
30567
30581
  return "";
30568
30582
  }).filter(Boolean));
30569
- } else possibleExportPaths.push(key.slice(2));
30570
- const isMatch = picomatch(pattern);
30583
+ } else {
30584
+ if (exports[key] == null) continue;
30585
+ possibleExportPaths.push(key.slice(2));
30586
+ }
30587
+ const isMatch = pm(pattern);
30571
30588
  const matched = possibleExportPaths.filter((p) => isMatch(p)).map((match) => path.posix.join(pkgName, match));
30572
30589
  matched.unshift(pkgName);
30573
30590
  return matched;
@@ -32376,7 +32393,7 @@ function resolveBuildEnvironmentOptions(raw, logger, consumer, isBundledDev, isS
32376
32393
  if (merged.minify === "false") merged.minify = false;
32377
32394
  else if (merged.minify === true) merged.minify = "oxc";
32378
32395
  const defaultModulePreload = { polyfill: true };
32379
- return {
32396
+ const resolved = {
32380
32397
  ...merged,
32381
32398
  cssTarget: merged.cssTarget ?? merged.target,
32382
32399
  cssMinify: merged.cssMinify ?? (consumer === "server" ? "lightningcss" : !!merged.minify),
@@ -32385,6 +32402,8 @@ function resolveBuildEnvironmentOptions(raw, logger, consumer, isBundledDev, isS
32385
32402
  ...merged.modulePreload
32386
32403
  }
32387
32404
  };
32405
+ setupRollupOptionCompat(resolved, "build");
32406
+ return resolved;
32388
32407
  }
32389
32408
  function resolveBuildPlugins(config) {
32390
32409
  const isBuild = config.command === "build";
@@ -32462,7 +32481,7 @@ function resolveRolldownOptions(environment, chunkMetadataMap) {
32462
32481
  experimental: {
32463
32482
  ...options.rolldownOptions.experimental,
32464
32483
  viteMode: true,
32465
- chunkImportMap: options.chunkImportMap ? { baseUrl: base } : options.rollupOptions.experimental?.chunkImportMap
32484
+ chunkImportMap: options.chunkImportMap ? { baseUrl: base } : options.rolldownOptions.experimental?.chunkImportMap
32466
32485
  }
32467
32486
  };
32468
32487
  const isSsrTargetWebworkerEnvironment = environment.name === "ssr" && environment.getTopLevelConfig().ssr?.target === "webworker";
@@ -33856,6 +33875,8 @@ var BundledDev = class {
33856
33875
  });
33857
33876
  this.environment.logger.info(import_picocolors.default.green(`page reload`), { timestamp: true });
33858
33877
  });
33878
+ fullReloadPending = false;
33879
+ lastBuildError = null;
33859
33880
  memoryFiles = new MemoryFiles();
33860
33881
  constructor(environment) {
33861
33882
  this.environment = environment;
@@ -33874,6 +33895,15 @@ var BundledDev = class {
33874
33895
  this.clients.setupIfNeeded(client, payload.clientId);
33875
33896
  this.devEngine.registerModules(payload.clientId, payload.modules);
33876
33897
  });
33898
+ this.environment.hot.on("vite:client:connect", (_payload, client) => {
33899
+ if (this.lastBuildError) {
33900
+ debug$1?.("REPLAY: replaying last build error to newly connected client");
33901
+ client.send({
33902
+ type: "error",
33903
+ err: prepareError(this.lastBuildError)
33904
+ });
33905
+ }
33906
+ });
33877
33907
  this.environment.hot.on("vite:client:disconnect", (_payload, client) => {
33878
33908
  const clientId = this.clients.delete(client);
33879
33909
  if (clientId) this.devEngine.removeClient(clientId);
@@ -33904,12 +33934,15 @@ var BundledDev = class {
33904
33934
  onOutput: (result) => {
33905
33935
  if (result instanceof Error) {
33906
33936
  this.environment.logger.error(import_picocolors.default.red(`✘ Build error: ${result.message}`), { error: result });
33937
+ this.lastBuildError = result;
33938
+ this.fullReloadPending = false;
33907
33939
  this.environment.hot.send({
33908
33940
  type: "error",
33909
33941
  err: prepareError(result)
33910
33942
  });
33911
33943
  return;
33912
33944
  }
33945
+ this.lastBuildError = null;
33913
33946
  for (const outputFile of result.output) this.memoryFiles.set(outputFile.fileName, () => {
33914
33947
  const source = outputFile.type === "chunk" ? outputFile.code : outputFile.source;
33915
33948
  return {
@@ -33917,6 +33950,10 @@ var BundledDev = class {
33917
33950
  etag: (0, import_etag.default)(Buffer.from(source), { weak: true })
33918
33951
  };
33919
33952
  });
33953
+ if (this.fullReloadPending) {
33954
+ this.fullReloadPending = false;
33955
+ this.debouncedFullReload();
33956
+ }
33920
33957
  },
33921
33958
  watch: { skipWrite: true }
33922
33959
  });
@@ -33937,9 +33974,11 @@ var BundledDev = class {
33937
33974
  }
33938
33975
  async waitForInitialBuildFinish() {
33939
33976
  await this.devEngine.ensureCurrentBuildFinish();
33940
- while (this.memoryFiles.size === 0) {
33977
+ let state = await this.devEngine.getBundleState();
33978
+ while (this.memoryFiles.size === 0 && !state.lastBuildErrored) {
33941
33979
  await setTimeout$1(10);
33942
33980
  await this.devEngine.ensureCurrentBuildFinish();
33981
+ state = await this.devEngine.getBundleState();
33943
33982
  }
33944
33983
  }
33945
33984
  async invalidateModule(m, client) {
@@ -33967,7 +34006,15 @@ var BundledDev = class {
33967
34006
  }
33968
34007
  async triggerBundleRegenerationIfStale() {
33969
34008
  const bundleState = await this.devEngine.getBundleState();
33970
- const shouldTrigger = bundleState.hasStaleOutput && !bundleState.lastFullBuildFailed && this.initialBuildCompleted;
34009
+ if (this.initialBuildCompleted && bundleState.lastBuildErrored && bundleState.lastErrorStage === "Hmr") {
34010
+ debug$1?.(`TRIGGER: access after HMR-stage failure, forcing full rebuild`);
34011
+ this.devEngine.triggerFullBuild();
34012
+ this.devEngine.ensureLatestBuildOutput().then(() => {
34013
+ this.debouncedFullReload();
34014
+ });
34015
+ return true;
34016
+ }
34017
+ const shouldTrigger = bundleState.hasStaleOutput && !bundleState.lastBuildErrored && this.initialBuildCompleted;
33971
34018
  if (shouldTrigger) {
33972
34019
  this.devEngine.ensureLatestBuildOutput().then(() => {
33973
34020
  this.debouncedFullReload();
@@ -34023,9 +34070,10 @@ var BundledDev = class {
34023
34070
  clear: !invalidateInformation,
34024
34071
  timestamp: true
34025
34072
  });
34026
- this.devEngine.ensureLatestBuildOutput().then(() => {
34073
+ if (invalidateInformation) this.devEngine.ensureLatestBuildOutput().then(async () => {
34027
34074
  this.debouncedFullReload();
34028
34075
  });
34076
+ else this.fullReloadPending = true;
34029
34077
  return;
34030
34078
  }
34031
34079
  debug$1?.(`handle hmr output for ${shortFile}`, {
@@ -35167,6 +35215,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
35167
35215
  externalConditions: resolvedEnvironments.ssr?.resolve.externalConditions
35168
35216
  }
35169
35217
  }, resolvedDefaultResolve.preserveSymlinks);
35218
+ if (config.envFile === false) logger.warn(import_picocolors.default.yellow("The `envFile` option is deprecated, please use `envDir: false` instead."));
35170
35219
  let envDir = config.envFile === false ? false : config.envDir;
35171
35220
  if (envDir !== false) envDir = config.envDir ? normalizePath(path.resolve(resolvedRoot, config.envDir)) : resolvedRoot;
35172
35221
  const userEnv = loadEnv(mode, envDir, resolveEnvPrefix(config));
@@ -35317,7 +35366,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
35317
35366
  build: resolvedBuildOptions,
35318
35367
  devtools: resolvedDevToolsConfig,
35319
35368
  environments: resolvedEnvironments,
35320
- webSocketToken: Buffer.from(crypto.getRandomValues(new Uint8Array(9))).toString("base64url"),
35369
+ webSocketToken: Buffer.from(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(9))).toString("base64url"),
35321
35370
  getSortedPlugins: void 0,
35322
35371
  getSortedPluginHooks: void 0,
35323
35372
  createResolver(options) {
@@ -35329,7 +35378,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
35329
35378
  return await resolve(ssr ? ssrEnvironment : clientEnvironment, id, importer, aliasOnly);
35330
35379
  };
35331
35380
  },
35332
- fsDenyGlob: picomatch(server.fs.deny.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`), {
35381
+ fsDenyGlob: pm(server.fs.deny.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`), {
35333
35382
  matchBase: false,
35334
35383
  nocase: true,
35335
35384
  dot: true
@@ -1626,6 +1626,8 @@ declare class BundledDev {
1626
1626
  private clients;
1627
1627
  private invalidateCalledModules;
1628
1628
  private debouncedFullReload;
1629
+ private fullReloadPending;
1630
+ private lastBuildError;
1629
1631
  memoryFiles: MemoryFiles;
1630
1632
  constructor(environment: DevEnvironment);
1631
1633
  private get devEngine();
@@ -2622,7 +2624,7 @@ interface FileSystemServeOptions {
2622
2624
  * This will have higher priority than `allow`.
2623
2625
  * picomatch patterns are supported.
2624
2626
  *
2625
- * @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
2627
+ * @default ['.env', '.env.*', '*.{crt,pem,key,p12,pfx,cer,der}', '.npmrc', '.yarnrc.yml', '**\/.git/**']
2626
2628
  */
2627
2629
  deny?: string[];
2628
2630
  }
@@ -102,7 +102,7 @@ function toWindowsPath(path) {
102
102
  }
103
103
  //#endregion
104
104
  //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
105
- var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
105
+ var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = /* @__PURE__ */ new Uint8Array(64), charToInt = /* @__PURE__ */ new Uint8Array(128);
106
106
  for (let i = 0; i < chars.length; i++) {
107
107
  let c = chars.charCodeAt(i);
108
108
  intToChar[i] = c, charToInt[c] = i;
@@ -340,7 +340,7 @@ var EvaluatedModuleNode = class {
340
340
  this.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();
341
341
  }
342
342
  };
343
- const prefixedBuiltins = new Set([
343
+ const prefixedBuiltins = /* @__PURE__ */ new Set([
344
344
  "node:sea",
345
345
  "node:sqlite",
346
346
  "node:test",
package/package.json CHANGED
@@ -1,21 +1,46 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "8.1.0-beta.0",
4
- "type": "module",
5
- "license": "MIT",
6
- "author": "Evan You",
3
+ "version": "8.1.0",
7
4
  "description": "Native-ESM powered web dev build tool",
8
- "bin": {
9
- "vite": "bin/vite.js"
10
- },
11
5
  "keywords": [
12
- "frontend",
6
+ "build-tool",
7
+ "dev-server",
13
8
  "framework",
9
+ "frontend",
14
10
  "hmr",
15
- "dev-server",
16
- "build-tool",
17
11
  "vite"
18
12
  ],
13
+ "homepage": "https://vite.dev",
14
+ "bugs": {
15
+ "url": "https://github.com/vitejs/vite/issues"
16
+ },
17
+ "license": "MIT",
18
+ "author": "Evan You",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/vitejs/vite.git",
22
+ "directory": "packages/vite"
23
+ },
24
+ "funding": "https://github.com/vitejs/vite?sponsor=1",
25
+ "bin": {
26
+ "vite": "bin/vite.js"
27
+ },
28
+ "files": [
29
+ "bin",
30
+ "dist",
31
+ "misc/**/*.js",
32
+ "client.d.ts",
33
+ "types"
34
+ ],
35
+ "type": "module",
36
+ "imports": {
37
+ "#module-sync-enabled": {
38
+ "module-sync": "./misc/true.js",
39
+ "default": "./misc/false.js"
40
+ },
41
+ "#types/*": "./types/*.d.ts",
42
+ "#dep-types/*": "./src/types/*.d.ts"
43
+ },
19
44
  "exports": {
20
45
  ".": "./dist/node/index.js",
21
46
  "./client": {
@@ -30,45 +55,13 @@
30
55
  "./types/internal/*": null,
31
56
  "./package.json": "./package.json"
32
57
  },
33
- "imports": {
34
- "#module-sync-enabled": {
35
- "module-sync": "./misc/true.js",
36
- "default": "./misc/false.js"
37
- },
38
- "#types/*": "./types/*.d.ts",
39
- "#dep-types/*": "./src/types/*.d.ts"
40
- },
41
- "files": [
42
- "bin",
43
- "dist",
44
- "misc/**/*.js",
45
- "client.d.ts",
46
- "types"
47
- ],
48
- "engines": {
49
- "node": "^20.19.0 || >=22.12.0"
50
- },
51
- "repository": {
52
- "type": "git",
53
- "url": "git+https://github.com/vitejs/vite.git",
54
- "directory": "packages/vite"
55
- },
56
- "bugs": {
57
- "url": "https://github.com/vitejs/vite/issues"
58
- },
59
- "homepage": "https://vite.dev",
60
- "funding": "https://github.com/vitejs/vite?sponsor=1",
61
- "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
62
58
  "dependencies": {
63
59
  "lightningcss": "^1.32.0",
64
60
  "picomatch": "^4.0.4",
65
61
  "postcss": "^8.5.15",
66
- "rolldown": "1.1.1",
62
+ "rolldown": "~1.1.2",
67
63
  "tinyglobby": "^0.2.17"
68
64
  },
69
- "optionalDependencies": {
70
- "fsevents": "~2.3.3"
71
- },
72
65
  "devDependencies": {
73
66
  "@babel/parser": "^7.29.7",
74
67
  "@jridgewell/remapping": "^2.3.5",
@@ -82,7 +75,7 @@
82
75
  "@vercel/detect-agent": "^1.2.3",
83
76
  "@vitejs/devtools": "^0.3.3",
84
77
  "@vitest/utils": "4.1.8",
85
- "@voidzero-dev/vite-task-client": "^0.1.1",
78
+ "@voidzero-dev/vite-task-client": "^0.2.0",
86
79
  "artichokie": "^0.4.3",
87
80
  "baseline-browser-mapping": "^2.10.37",
88
81
  "cac": "^7.0.0",
@@ -179,6 +172,13 @@
179
172
  "optional": true
180
173
  }
181
174
  },
175
+ "optionalDependencies": {
176
+ "fsevents": "~2.3.3"
177
+ },
178
+ "engines": {
179
+ "node": "^20.19.0 || >=22.12.0"
180
+ },
181
+ "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
182
182
  "scripts": {
183
183
  "dev": "premove dist && pnpm build-bundle -w",
184
184
  "build": "premove dist && pnpm build-bundle && pnpm build-types",