vite 8.0.13 → 8.0.15

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.
@@ -1205,7 +1205,7 @@ var init_node = __esmMin((() => {
1205
1205
  createDebug.debug = createDebug;
1206
1206
  }));
1207
1207
  //#endregion
1208
- //#region ../../node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.59.0/node_modules/@rollup/pluginutils/dist/es/index.js
1208
+ //#region ../../node_modules/.pnpm/@rollup+pluginutils@5.4.0_rollup@4.59.0/node_modules/@rollup/pluginutils/dist/es/index.js
1209
1209
  function isArray(arg) {
1210
1210
  return Array.isArray(arg);
1211
1211
  }
@@ -1303,6 +1303,7 @@ function isWellFormedString(input) {
1303
1303
  if (hasStringIsWellFormed) return input.isWellFormed();
1304
1304
  return !/\p{Surrogate}/u.test(input);
1305
1305
  }
1306
+ const identifierNameRE = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
1306
1307
  const dataToEsm = function dataToEsm(data, options = {}) {
1307
1308
  var _a, _b;
1308
1309
  const t = options.compact ? "" : "indent" in options ? options.indent : " ";
@@ -1328,10 +1329,13 @@ const dataToEsm = function dataToEsm(data, options = {}) {
1328
1329
  namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
1329
1330
  } else {
1330
1331
  defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, "")}`);
1331
- if (options.includeArbitraryNames && isWellFormedString(key)) {
1332
- const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
1333
- namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
1334
- arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
1332
+ if (key !== "default") {
1333
+ const isIdentifierName = identifierNameRE.test(key);
1334
+ if (isIdentifierName || options.includeArbitraryNames && isWellFormedString(key)) {
1335
+ const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
1336
+ namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
1337
+ arbitraryNameExportRows.push(`${variableName} as ${isIdentifierName ? key : JSON.stringify(key)}`);
1338
+ }
1335
1339
  }
1336
1340
  }
1337
1341
  const arbitraryExportCode = arbitraryNameExportRows.length > 0 ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}` : "";
@@ -1564,11 +1568,10 @@ const replaceNestedIdRE = /\s*>\s*/g;
1564
1568
  const flattenId = (id) => {
1565
1569
  return limitFlattenIdLength(id.replaceAll(/_+/g, "$&__").replaceAll("/", "_").replaceAll(".", "__").replace(replaceNestedIdRE, "_n_").replace(invalidUrlPathCharRE, (c) => "_0" + c.charCodeAt(0).toString(16) + "_"));
1566
1570
  };
1567
- const FLATTEN_ID_HASH_LENGTH = 8;
1568
1571
  const FLATTEN_ID_MAX_FILE_LENGTH = 170;
1569
1572
  const limitFlattenIdLength = (id, limit = FLATTEN_ID_MAX_FILE_LENGTH) => {
1570
1573
  if (id.length <= limit) return id;
1571
- return id.slice(0, limit - (FLATTEN_ID_HASH_LENGTH + 1)) + "_" + getHash(id);
1574
+ return id.slice(0, limit - 9) + "_" + getHash(id);
1572
1575
  };
1573
1576
  const normalizeId = (id) => id.replace(replaceNestedIdRE, " > ");
1574
1577
  const NODE_BUILTIN_NAMESPACE = "node:";
@@ -2207,10 +2210,12 @@ function mergeWithDefaults(defaults, values) {
2207
2210
  return mergeWithDefaultsRecursively(deepClone(defaults), values);
2208
2211
  }
2209
2212
  const runtimeDeprecatedPath = new Set(["optimizeDeps", "ssr.optimizeDeps"]);
2210
- const rollupOptionsDeprecationCall = () => {
2211
- const method = process.env.VITE_DEPRECATION_TRACE ? "trace" : "warn";
2212
- console[method]("`optimizeDeps.rollupOptions` / `ssr.optimizeDeps.rollupOptions` is deprecated. Use `optimizeDeps.rolldownOptions` instead. Note that this option may be set by a plugin. " + (method === "trace" ? "Showing trace because VITE_DEPRECATION_TRACE is set." : "Set VITE_DEPRECATION_TRACE=1 to see where it is called."));
2213
- };
2213
+ const rollupOptionsDeprecationCall = (() => {
2214
+ return () => {
2215
+ const method = process.env.VITE_DEPRECATION_TRACE ? "trace" : "warn";
2216
+ console[method]("`optimizeDeps.rollupOptions` / `ssr.optimizeDeps.rollupOptions` is deprecated. Use `optimizeDeps.rolldownOptions` instead. Note that this option may be set by a plugin. " + (method === "trace" ? "Showing trace because VITE_DEPRECATION_TRACE is set." : "Set VITE_DEPRECATION_TRACE=1 to see where it is called."));
2217
+ };
2218
+ })();
2214
2219
  function setupRollupOptionCompat(buildConfig, path) {
2215
2220
  buildConfig.rolldownOptions ??= buildConfig.rollupOptions;
2216
2221
  if (runtimeDeprecatedPath.has(path) && buildConfig.rollupOptions && buildConfig.rolldownOptions !== buildConfig.rollupOptions) rollupOptionsDeprecationCall();
@@ -3599,7 +3604,7 @@ function getBtoa() {
3599
3604
  throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
3600
3605
  };
3601
3606
  }
3602
- const btoa$1 = /* @__PURE__ */ getBtoa();
3607
+ const btoa$1 = /*#__PURE__*/ getBtoa();
3603
3608
  var SourceMap = class {
3604
3609
  constructor(properties) {
3605
3610
  this.version = 3;
@@ -9903,12 +9908,47 @@ var require_chokidar = /* @__PURE__ */ __commonJSMin(((exports) => {
9903
9908
  exports.watch = watch;
9904
9909
  }));
9905
9910
  //#endregion
9906
- //#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js
9911
+ //#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/quote.js
9907
9912
  var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9913
+ var OPS = [
9914
+ "||",
9915
+ "&&",
9916
+ ";;",
9917
+ "|&",
9918
+ "<(",
9919
+ "<<<",
9920
+ ">>",
9921
+ ">&",
9922
+ "<&",
9923
+ "&",
9924
+ ";",
9925
+ "(",
9926
+ ")",
9927
+ "|",
9928
+ "<",
9929
+ ">"
9930
+ ];
9931
+ var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
9932
+ var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
9908
9933
  module.exports = function quote(xs) {
9909
9934
  return xs.map(function(s) {
9910
9935
  if (s === "") return "''";
9911
- if (s && typeof s === "object") return s.op.replace(/(.)/g, "\\$1");
9936
+ if (s && typeof s === "object") {
9937
+ if (s.op === "glob") {
9938
+ if (typeof s.pattern !== "string") throw new TypeError("glob token requires a string `pattern`");
9939
+ if (LINE_TERMINATORS.test(s.pattern)) throw new TypeError("glob `pattern` must not contain line terminators");
9940
+ return s.pattern.replace(GLOB_SHELL_SPECIAL, "\\$&");
9941
+ }
9942
+ if (typeof s.op === "string") {
9943
+ if (OPS.indexOf(s.op) < 0) throw new TypeError("invalid `op` value: " + JSON.stringify(s.op));
9944
+ return s.op.replace(/[\s\S]/g, "\\$&");
9945
+ }
9946
+ if (typeof s.comment === "string") {
9947
+ if (LINE_TERMINATORS.test(s.comment)) throw new TypeError("`comment` must not contain line terminators");
9948
+ return "#" + s.comment;
9949
+ }
9950
+ throw new TypeError("unrecognized object token shape");
9951
+ }
9912
9952
  if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, "\\$1") + "'";
9913
9953
  if (/["'\s]/.test(s)) return "\"" + s.replace(/(["\\$`!])/g, "\\$1") + "\"";
9914
9954
  return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
@@ -9916,7 +9956,7 @@ var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9916
9956
  };
9917
9957
  }));
9918
9958
  //#endregion
9919
- //#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js
9959
+ //#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/parse.js
9920
9960
  var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9921
9961
  var CONTROL = "(?:" + [
9922
9962
  "\\|\\|",
@@ -10055,13 +10095,13 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10055
10095
  };
10056
10096
  }));
10057
10097
  //#endregion
10058
- //#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js
10098
+ //#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/index.js
10059
10099
  var require_shell_quote = /* @__PURE__ */ __commonJSMin(((exports) => {
10060
10100
  exports.quote = require_quote();
10061
10101
  exports.parse = require_parse$1();
10062
10102
  }));
10063
10103
  //#endregion
10064
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/macos.js
10104
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.0/node_modules/launch-editor/editor-info/macos.js
10065
10105
  var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10066
10106
  module.exports = {
10067
10107
  "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
@@ -10096,7 +10136,7 @@ var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10096
10136
  };
10097
10137
  }));
10098
10138
  //#endregion
10099
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/linux.js
10139
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.0/node_modules/launch-editor/editor-info/linux.js
10100
10140
  var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10101
10141
  module.exports = {
10102
10142
  atom: "atom",
@@ -10130,7 +10170,7 @@ var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10130
10170
  };
10131
10171
  }));
10132
10172
  //#endregion
10133
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/windows.js
10173
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.0/node_modules/launch-editor/editor-info/windows.js
10134
10174
  var require_windows$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10135
10175
  module.exports = [
10136
10176
  "Brackets.exe",
@@ -10163,7 +10203,7 @@ var require_windows$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10163
10203
  ];
10164
10204
  }));
10165
10205
  //#endregion
10166
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/guess.js
10206
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.0/node_modules/launch-editor/guess.js
10167
10207
  var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10168
10208
  const path$9 = __require("path");
10169
10209
  const shellQuote = require_shell_quote();
@@ -10224,7 +10264,7 @@ var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10224
10264
  };
10225
10265
  }));
10226
10266
  //#endregion
10227
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/get-args.js
10267
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.0/node_modules/launch-editor/get-args.js
10228
10268
  var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10229
10269
  const path$8 = __require("path");
10230
10270
  module.exports = function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
@@ -10303,7 +10343,7 @@ var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10303
10343
  };
10304
10344
  }));
10305
10345
  //#endregion
10306
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/index.js
10346
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.0/node_modules/launch-editor/index.js
10307
10347
  var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10308
10348
  /**
10309
10349
  * Copyright (c) 2015-present, Facebook, Inc.
@@ -10352,7 +10392,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
10352
10392
  columnNumber: match && match[3]
10353
10393
  };
10354
10394
  }
10355
- let _childProcess = null;
10395
+ let currentChildProcess = null;
10356
10396
  function launchEditor(file, specifiedEditor, onErrorCallback) {
10357
10397
  const parsed = parseFile(file);
10358
10398
  let { fileName } = parsed;
@@ -10373,7 +10413,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
10373
10413
  const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
10374
10414
  args.push.apply(args, extraArgs);
10375
10415
  } else args.push(fileName);
10376
- if (_childProcess && isTerminalEditor(editor)) _childProcess.kill("SIGKILL");
10416
+ if (currentChildProcess && isTerminalEditor(editor)) currentChildProcess.kill("SIGKILL");
10377
10417
  if (process.platform === "win32") {
10378
10418
  function escapeCmdArgs(cmdArgs) {
10379
10419
  return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
@@ -10384,16 +10424,16 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
10384
10424
  return str;
10385
10425
  }
10386
10426
  const launchCommand = [editor, ...args.map(escapeCmdArgs)].map(doubleQuoteIfNeeded).join(" ");
10387
- _childProcess = childProcess$1.exec(launchCommand, {
10427
+ currentChildProcess = childProcess$1.exec(launchCommand, {
10388
10428
  stdio: "inherit",
10389
10429
  shell: true
10390
10430
  });
10391
- } else _childProcess = childProcess$1.spawn(editor, args, { stdio: "inherit" });
10392
- _childProcess.on("exit", function(errorCode) {
10393
- _childProcess = null;
10431
+ } else currentChildProcess = childProcess$1.spawn(editor, args, { stdio: "inherit" });
10432
+ currentChildProcess.on("exit", function(errorCode) {
10433
+ currentChildProcess = null;
10394
10434
  if (errorCode) onErrorCallback(fileName, "(code " + errorCode + ")");
10395
10435
  });
10396
- _childProcess.on("error", function(error) {
10436
+ currentChildProcess.on("error", function(error) {
10397
10437
  let { code, message } = error;
10398
10438
  if ("ENOENT" === code) message = `${message} ('${editor}' command does not exist in 'PATH')`;
10399
10439
  onErrorCallback(fileName, message);
@@ -10402,7 +10442,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
10402
10442
  module.exports = launchEditor;
10403
10443
  }));
10404
10444
  //#endregion
10405
- //#region ../../node_modules/.pnpm/launch-editor-middleware@2.13.2/node_modules/launch-editor-middleware/index.js
10445
+ //#region ../../node_modules/.pnpm/launch-editor-middleware@2.14.0/node_modules/launch-editor-middleware/index.js
10406
10446
  var require_launch_editor_middleware = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10407
10447
  const path$6 = __require("path");
10408
10448
  const launch = require_launch_editor();
@@ -10574,6 +10614,10 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10574
10614
  agent: void 0
10575
10615
  };
10576
10616
  }
10617
+ 0 && (module.exports = {
10618
+ KNOWN_AGENTS,
10619
+ determineAgent
10620
+ });
10577
10621
  }));
10578
10622
  //#endregion
10579
10623
  //#region src/node/http.ts
@@ -10672,13 +10716,24 @@ async function httpServerStart(httpServer, serverOptions) {
10672
10716
  }
10673
10717
  function setClientErrorHandler(server, logger) {
10674
10718
  server.on("clientError", (err, socket) => {
10675
- let msg = "400 Bad Request";
10676
- if (err.code === "HPE_HEADER_OVERFLOW") {
10677
- msg = "431 Request Header Fields Too Large";
10678
- logger.warn(import_picocolors.default.yellow("Server responded with status code 431. See https://vite.dev/guide/troubleshooting.html#_431-request-header-fields-too-large."));
10719
+ let msg;
10720
+ switch (err.code) {
10721
+ case "HPE_HEADER_OVERFLOW":
10722
+ msg = "431 Request Header Fields Too Large";
10723
+ logger.warn(import_picocolors.default.yellow("Server responded with status code 431. See https://vite.dev/guide/troubleshooting.html#_431-request-header-fields-too-large."));
10724
+ break;
10725
+ case "HPE_CHUNK_EXTENSIONS_OVERFLOW":
10726
+ msg = "413 Payload Too Large";
10727
+ break;
10728
+ case "ERR_HTTP_REQUEST_TIMEOUT":
10729
+ msg = "408 Request Timeout";
10730
+ break;
10731
+ default:
10732
+ msg = "400 Bad Request";
10733
+ break;
10679
10734
  }
10680
10735
  if (err.code === "ECONNRESET" || !socket.writable) return;
10681
- socket.end(`HTTP/1.1 ${msg}\r\n\r\n`);
10736
+ socket.end(`HTTP/1.1 ${msg}\r\nConnection: close\r\n\r\n`);
10682
10737
  });
10683
10738
  }
10684
10739
  //#endregion
@@ -12516,7 +12571,7 @@ function checkPublicFile(url, config) {
12516
12571
  return tryStatSync(publicFile)?.isFile() ? publicFile : void 0;
12517
12572
  }
12518
12573
  //#endregion
12519
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js
12574
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js
12520
12575
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12521
12576
  const BINARY_TYPES = [
12522
12577
  "nodebuffer",
@@ -12539,7 +12594,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12539
12594
  };
12540
12595
  }));
12541
12596
  //#endregion
12542
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js
12597
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js
12543
12598
  var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12544
12599
  const { EMPTY_BUFFER } = require_constants();
12545
12600
  const FastBuffer = Buffer[Symbol.species];
@@ -12639,7 +12694,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12639
12694
  } catch (e) {}
12640
12695
  }));
12641
12696
  //#endregion
12642
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/limiter.js
12697
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js
12643
12698
  var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12644
12699
  const kDone = Symbol("kDone");
12645
12700
  const kRun = Symbol("kRun");
@@ -12690,7 +12745,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12690
12745
  module.exports = Limiter;
12691
12746
  }));
12692
12747
  //#endregion
12693
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/permessage-deflate.js
12748
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js
12694
12749
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12695
12750
  const zlib$1 = __require("zlib");
12696
12751
  const bufferUtil = require_buffer_util();
@@ -13023,7 +13078,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
13023
13078
  }
13024
13079
  }));
13025
13080
  //#endregion
13026
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/validation.js
13081
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js
13027
13082
  var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13028
13083
  const { isUtf8 } = __require("buffer");
13029
13084
  const { hasBlob } = require_constants();
@@ -13219,7 +13274,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13219
13274
  } catch (e) {}
13220
13275
  }));
13221
13276
  //#endregion
13222
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/receiver.js
13277
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js
13223
13278
  var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13224
13279
  const { Writable: Writable$1 } = __require("stream");
13225
13280
  const PerMessageDeflate = require_permessage_deflate();
@@ -13252,6 +13307,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13252
13307
  * extensions
13253
13308
  * @param {Boolean} [options.isServer=false] Specifies whether to operate in
13254
13309
  * client or server mode
13310
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
13311
+ * buffered data chunks
13312
+ * @param {Number} [options.maxFragments=0] The maximum number of message
13313
+ * fragments
13255
13314
  * @param {Number} [options.maxPayload=0] The maximum allowed message length
13256
13315
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
13257
13316
  * not to skip UTF-8 validation for text and close messages
@@ -13262,6 +13321,8 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13262
13321
  this._binaryType = options.binaryType || BINARY_TYPES[0];
13263
13322
  this._extensions = options.extensions || {};
13264
13323
  this._isServer = !!options.isServer;
13324
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
13325
+ this._maxFragments = options.maxFragments | 0;
13265
13326
  this._maxPayload = options.maxPayload | 0;
13266
13327
  this._skipUTF8Validation = !!options.skipUTF8Validation;
13267
13328
  this[kWebSocket] = void 0;
@@ -13291,6 +13352,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13291
13352
  */
13292
13353
  _write(chunk, encoding, cb) {
13293
13354
  if (this._opcode === 8 && this._state == GET_INFO) return cb();
13355
+ if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
13356
+ cb(this.createError(RangeError, "Too many buffered chunks", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
13357
+ return;
13358
+ }
13294
13359
  this._bufferedBytes += chunk.length;
13295
13360
  this._buffers.push(chunk);
13296
13361
  this.startLoop(cb);
@@ -13518,6 +13583,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13518
13583
  return;
13519
13584
  }
13520
13585
  if (data.length) {
13586
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
13587
+ cb(this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
13588
+ return;
13589
+ }
13521
13590
  this._messageLength = this._totalPayloadLength;
13522
13591
  this._fragments.push(data);
13523
13592
  }
@@ -13539,6 +13608,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13539
13608
  cb(this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));
13540
13609
  return;
13541
13610
  }
13611
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
13612
+ cb(this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
13613
+ return;
13614
+ }
13542
13615
  this._fragments.push(buf);
13543
13616
  }
13544
13617
  this.dataMessage(cb);
@@ -13666,10 +13739,11 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13666
13739
  module.exports = Receiver;
13667
13740
  }));
13668
13741
  //#endregion
13669
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/sender.js
13742
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js
13670
13743
  var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13671
13744
  const { Duplex: Duplex$3 } = __require("stream");
13672
13745
  const { randomFillSync } = __require("crypto");
13746
+ const { types: { isUint8Array } } = __require("util");
13673
13747
  const PerMessageDeflate = require_permessage_deflate();
13674
13748
  const { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
13675
13749
  const { isBlob, isValidStatusCode } = require_validation();
@@ -13813,7 +13887,8 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13813
13887
  buf = Buffer.allocUnsafe(2 + length);
13814
13888
  buf.writeUInt16BE(code, 0);
13815
13889
  if (typeof data === "string") buf.write(data, 2);
13816
- else buf.set(data, 2);
13890
+ else if (isUint8Array(data)) buf.set(data, 2);
13891
+ else throw new TypeError("Second argument must be a string or a Uint8Array");
13817
13892
  }
13818
13893
  const options = {
13819
13894
  [kByteLength]: buf.length,
@@ -14158,7 +14233,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14158
14233
  }
14159
14234
  }));
14160
14235
  //#endregion
14161
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/event-target.js
14236
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js
14162
14237
  var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14163
14238
  const { kForOnEventAttribute, kListener } = require_constants();
14164
14239
  const kCode = Symbol("kCode");
@@ -14389,7 +14464,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14389
14464
  }
14390
14465
  }));
14391
14466
  //#endregion
14392
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/extension.js
14467
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js
14393
14468
  var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14394
14469
  const { tokenChars } = require_validation();
14395
14470
  /**
@@ -14532,7 +14607,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14532
14607
  };
14533
14608
  }));
14534
14609
  //#endregion
14535
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket.js
14610
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js
14536
14611
  var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14537
14612
  const EventEmitter$2 = __require("events");
14538
14613
  const https$3 = __require("https");
@@ -14694,6 +14769,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14694
14769
  * multiple times in the same tick
14695
14770
  * @param {Function} [options.generateMask] The function used to generate the
14696
14771
  * masking key
14772
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
14773
+ * buffered data chunks
14774
+ * @param {Number} [options.maxFragments=0] The maximum number of message
14775
+ * fragments
14697
14776
  * @param {Number} [options.maxPayload=0] The maximum allowed message size
14698
14777
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
14699
14778
  * not to skip UTF-8 validation for text and close messages
@@ -14705,6 +14784,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14705
14784
  binaryType: this.binaryType,
14706
14785
  extensions: this._extensions,
14707
14786
  isServer: this._isServer,
14787
+ maxBufferedChunks: options.maxBufferedChunks,
14788
+ maxFragments: options.maxFragments,
14708
14789
  maxPayload: options.maxPayload,
14709
14790
  skipUTF8Validation: options.skipUTF8Validation
14710
14791
  });
@@ -15031,6 +15112,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15031
15112
  * masking key
15032
15113
  * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
15033
15114
  * handshake request
15115
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
15116
+ * buffered data chunks
15117
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
15118
+ * fragments
15034
15119
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
15035
15120
  * size
15036
15121
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
@@ -15051,6 +15136,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15051
15136
  autoPong: true,
15052
15137
  closeTimeout: CLOSE_TIMEOUT,
15053
15138
  protocolVersion: protocolVersions[1],
15139
+ maxBufferedChunks: 1024 * 1024,
15140
+ maxFragments: 128 * 1024,
15054
15141
  maxPayload: 100 * 1024 * 1024,
15055
15142
  skipUTF8Validation: false,
15056
15143
  perMessageDeflate: true,
@@ -15240,6 +15327,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15240
15327
  websocket.setSocket(socket, head, {
15241
15328
  allowSynchronousEvents: opts.allowSynchronousEvents,
15242
15329
  generateMask: opts.generateMask,
15330
+ maxBufferedChunks: opts.maxBufferedChunks,
15331
+ maxFragments: opts.maxFragments,
15243
15332
  maxPayload: opts.maxPayload,
15244
15333
  skipUTF8Validation: opts.skipUTF8Validation
15245
15334
  });
@@ -15507,7 +15596,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15507
15596
  }
15508
15597
  }));
15509
15598
  //#endregion
15510
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/stream.js
15599
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/stream.js
15511
15600
  var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15512
15601
  require_websocket();
15513
15602
  const { Duplex: Duplex$1 } = __require("stream");
@@ -15623,7 +15712,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15623
15712
  module.exports = createWebSocketStream;
15624
15713
  }));
15625
15714
  //#endregion
15626
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/subprotocol.js
15715
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js
15627
15716
  var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15628
15717
  const { tokenChars } = require_validation();
15629
15718
  /**
@@ -15662,7 +15751,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15662
15751
  module.exports = { parse };
15663
15752
  }));
15664
15753
  //#endregion
15665
- //#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket-server.js
15754
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js
15666
15755
  var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15667
15756
  const EventEmitter$1 = __require("events");
15668
15757
  const http$4 = __require("http");
@@ -15701,6 +15790,10 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
15701
15790
  * called
15702
15791
  * @param {Function} [options.handleProtocols] A hook to handle protocols
15703
15792
  * @param {String} [options.host] The hostname where to bind the server
15793
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
15794
+ * buffered data chunks
15795
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
15796
+ * fragments
15704
15797
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
15705
15798
  * size
15706
15799
  * @param {Boolean} [options.noServer=false] Enable no server mode
@@ -15722,6 +15815,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
15722
15815
  options = {
15723
15816
  allowSynchronousEvents: true,
15724
15817
  autoPong: true,
15818
+ maxBufferedChunks: 1024 * 1024,
15819
+ maxFragments: 128 * 1024,
15725
15820
  maxPayload: 100 * 1024 * 1024,
15726
15821
  skipUTF8Validation: false,
15727
15822
  perMessageDeflate: false,
@@ -15951,6 +16046,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
15951
16046
  socket.removeListener("error", socketOnError);
15952
16047
  ws.setSocket(socket, head, {
15953
16048
  allowSynchronousEvents: this.options.allowSynchronousEvents,
16049
+ maxBufferedChunks: this.options.maxBufferedChunks,
16050
+ maxFragments: this.options.maxFragments,
15954
16051
  maxPayload: this.options.maxPayload,
15955
16052
  skipUTF8Validation: this.options.skipUTF8Validation
15956
16053
  });
@@ -19556,7 +19653,7 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19556
19653
  };
19557
19654
  }));
19558
19655
  //#endregion
19559
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/req.js
19656
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/req.js
19560
19657
  var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19561
19658
  const { createRequire: createRequire$1 } = __require("node:module");
19562
19659
  const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = __require("node:url");
@@ -19598,7 +19695,7 @@ var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19598
19695
  module.exports = req;
19599
19696
  }));
19600
19697
  //#endregion
19601
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/options.js
19698
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/options.js
19602
19699
  var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19603
19700
  const req = require_req();
19604
19701
  /**
@@ -19632,7 +19729,7 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19632
19729
  module.exports = options;
19633
19730
  }));
19634
19731
  //#endregion
19635
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js
19732
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/plugins.js
19636
19733
  var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19637
19734
  const req = require_req();
19638
19735
  /**
@@ -19686,7 +19783,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19686
19783
  module.exports = plugins;
19687
19784
  }));
19688
19785
  //#endregion
19689
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/index.js
19786
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/index.js
19690
19787
  var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19691
19788
  const { resolve: resolve$3 } = __require("node:path");
19692
19789
  const config = require_src$1();
@@ -20117,7 +20214,7 @@ function createIdResolver(config, options) {
20117
20214
  tryIndex: true,
20118
20215
  ...options,
20119
20216
  idOnly: true
20120
- }, environment.config)], void 0, false);
20217
+ }, environment.config, true)], void 0, false);
20121
20218
  pluginContainerMap.set(environment, pluginContainer);
20122
20219
  }
20123
20220
  return await pluginContainer.resolveId(id, importer, { scan });
@@ -21925,9 +22022,8 @@ async function compileLightningCSS(environment, id, src, deps, workerController,
21925
22022
  };
21926
22023
  }
21927
22024
  function getLightningCssErrorMessageForIeSyntaxes(code) {
21928
- const commonIeMessage = ", which was used in the past to support old Internet Explorer versions. This is not a valid CSS syntax and will be ignored by modern browsers. \nWhile this is not supported by LightningCSS, you can set `css.lightningcss.errorRecovery: true` to strip these codes.";
21929
- if (/[\s;{]\*[a-zA-Z-][\w-]+\s*:/.test(code)) return ".\nThis file contains star property hack (e.g. `*zoom`)" + commonIeMessage;
21930
- if (/min-width:\s*0\\0/.test(code)) return ".\nThis file contains @media zero hack (e.g. `@media (min-width: 0\\0)`)" + commonIeMessage;
22025
+ if (/[\s;{]\*[a-zA-Z-][\w-]+\s*:/.test(code)) return ".\nThis file contains star property hack (e.g. `*zoom`), which was used in the past to support old Internet Explorer versions. This is not a valid CSS syntax and will be ignored by modern browsers. \nWhile this is not supported by LightningCSS, you can set `css.lightningcss.errorRecovery: true` to strip these codes.";
22026
+ if (/min-width:\s*0\\0/.test(code)) return ".\nThis file contains @media zero hack (e.g. `@media (min-width: 0\\0)`), which was used in the past to support old Internet Explorer versions. This is not a valid CSS syntax and will be ignored by modern browsers. \nWhile this is not supported by LightningCSS, you can set `css.lightningcss.errorRecovery: true` to strip these codes.";
21931
22027
  }
21932
22028
  const map = {
21933
22029
  chrome: "chrome",
@@ -22077,7 +22173,7 @@ function resolveLibCssFilename(libOptions, root, packageCache) {
22077
22173
  //#endregion
22078
22174
  //#region src/node/plugins/modulePreloadPolyfill.ts
22079
22175
  const modulePreloadPolyfillId = "vite/modulepreload-polyfill";
22080
- const resolvedModulePreloadPolyfillId = "\0" + modulePreloadPolyfillId + ".js";
22176
+ const resolvedModulePreloadPolyfillId = "\0vite/modulepreload-polyfill.js";
22081
22177
  function modulePreloadPolyfillPlugin() {
22082
22178
  return {
22083
22179
  name: "vite:modulepreload-polyfill",
@@ -25259,13 +25355,16 @@ const wordCharRE = /\w/;
25259
25355
  function isBareRelative(url) {
25260
25356
  return wordCharRE.test(url[0]) && !url.includes(":");
25261
25357
  }
25358
+ function getHtmlDirnameForRelativeUrl(htmlPath) {
25359
+ return htmlPath.endsWith("/") ? htmlPath : path.posix.dirname(htmlPath);
25360
+ }
25262
25361
  const processNodeUrl = (url, useSrcSetReplacer, config, htmlPath, originalUrl, server, isClassicScriptLink) => {
25263
25362
  const replacer = (url) => {
25264
25363
  if (url[0] === "/" && url[1] !== "/" || (url[0] === "." || isBareRelative(url)) && originalUrl && originalUrl !== "/" && htmlPath === "/index.html") url = path.posix.join(config.base, url);
25265
25364
  let preTransformUrl;
25266
25365
  if (!isClassicScriptLink && shouldPreTransform(url, config)) {
25267
25366
  if (url[0] === "/" && url[1] !== "/") preTransformUrl = url;
25268
- else if (url[0] === "." || isBareRelative(url)) preTransformUrl = path.posix.join(config.base, path.posix.dirname(htmlPath), url);
25367
+ else if (url[0] === "." || isBareRelative(url)) preTransformUrl = path.posix.join(config.base, getHtmlDirnameForRelativeUrl(htmlPath), url);
25269
25368
  }
25270
25369
  if (server) {
25271
25370
  const mod = server.environments.client.moduleGraph.urlToModuleMap.get(preTransformUrl || url);
@@ -25291,8 +25390,8 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
25291
25390
  let proxyModuleUrl;
25292
25391
  const trailingSlash = htmlPath.endsWith("/");
25293
25392
  if (!trailingSlash && fs.existsSync(filename)) {
25294
- proxyModulePath = htmlPath;
25295
- proxyModuleUrl = proxyModulePath;
25393
+ proxyModulePath = htmlPath.startsWith(FS_PREFIX) ? filename : htmlPath;
25394
+ proxyModuleUrl = htmlPath;
25296
25395
  } else {
25297
25396
  proxyModulePath = `\0${`${htmlPath}${trailingSlash ? "index.html" : ""}`}`;
25298
25397
  proxyModuleUrl = wrapId(proxyModulePath);
@@ -26225,8 +26324,8 @@ async function _createServer(inlineConfig = {}, options) {
26225
26324
  },
26226
26325
  printUrls() {
26227
26326
  if (server.resolvedUrls) printServerUrls(server.resolvedUrls, serverConfig.host, config.logger.info);
26228
- else if (middlewareMode) throw new Error("cannot print server URLs in middleware mode.");
26229
- else throw new Error("cannot print server URLs before server.listen is called.");
26327
+ else if (middlewareMode) throw new Error("Cannot print server URLs in middleware mode.");
26328
+ else throw new Error("Cannot print server URLs before server.listen is called.");
26230
26329
  },
26231
26330
  bindCLIShortcuts(options) {
26232
26331
  bindCLIShortcuts(server, options);
@@ -29044,6 +29143,7 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
29044
29143
  if (!matches.length) return null;
29045
29144
  const s = new MagicString(code);
29046
29145
  const staticImports = (await Promise.all(matches.map(async ({ globsResolved, isRelative, options, index, start, end, onlyKeys, onlyValues }) => {
29146
+ if (!dir && !options.base && isRelative) throw new Error("In virtual modules, all globs must start with '/'");
29047
29147
  const files = (await glob(globsResolved, {
29048
29148
  absolute: true,
29049
29149
  cwd: getCommonBase(globsResolved) ?? root,
@@ -29056,7 +29156,6 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
29056
29156
  const staticImports = [];
29057
29157
  const resolvePaths = (file) => {
29058
29158
  if (!dir) {
29059
- if (!options.base && isRelative) throw new Error("In virtual modules, all globs must start with '/'");
29060
29159
  const importPath = `/${relative$1(root, file)}`;
29061
29160
  let filePath = options.base ? `${relative$1(posix.join(root, options.base), file)}` : importPath;
29062
29161
  if (options.base && !filePath.startsWith("./") && !filePath.startsWith("../")) filePath = `./${filePath}`;
@@ -29071,7 +29170,6 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
29071
29170
  if (options.base) {
29072
29171
  filePath = relative$1(posix.join(options.base[0] === "/" ? root : dir, options.base), file);
29073
29172
  if (!filePath.startsWith("./") && !filePath.startsWith("../")) filePath = `./${filePath}`;
29074
- if (options.base[0] === "/") importPath = `/${relative$1(root, file)}`;
29075
29173
  } else if (isRelative) filePath = importPath;
29076
29174
  else {
29077
29175
  filePath = relative$1(root, file);
@@ -29256,7 +29354,7 @@ function createFilterForTransform(idFilter, codeFilter, moduleTypeFilter, cwd) {
29256
29354
  };
29257
29355
  }
29258
29356
  //#endregion
29259
- //#region ../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/helpers.js
29357
+ //#region ../../node_modules/.pnpm/@vitest+utils@4.1.7/node_modules/@vitest/utils/dist/helpers.js
29260
29358
  function notNullish(v) {
29261
29359
  return v != null;
29262
29360
  }
@@ -29264,7 +29362,7 @@ function isPrimitive(value) {
29264
29362
  return value === null || typeof value !== "function" && typeof value !== "object";
29265
29363
  }
29266
29364
  //#endregion
29267
- //#region ../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
29365
+ //#region ../../node_modules/.pnpm/@vitest+utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
29268
29366
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
29269
29367
  function normalizeWindowsPath(input = "") {
29270
29368
  if (!input) return input;
@@ -29343,7 +29441,7 @@ const isAbsolute$2 = function(p) {
29343
29441
  return _IS_ABSOLUTE_RE.test(p);
29344
29442
  };
29345
29443
  //#endregion
29346
- //#region ../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/source-map.js
29444
+ //#region ../../node_modules/.pnpm/@vitest+utils@4.1.7/node_modules/@vitest/utils/dist/source-map.js
29347
29445
  var comma = ",".charCodeAt(0);
29348
29446
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
29349
29447
  var intToChar = new Uint8Array(64);
@@ -30816,12 +30914,13 @@ async function computeEntries(environment) {
30816
30914
  }
30817
30915
  async function prepareRolldownScanner(environment, entries, deps, missing) {
30818
30916
  const { plugins: pluginsFromConfig = [], ...rolldownOptions } = environment.config.optimizeDeps.rolldownOptions ?? {};
30819
- const plugins = await asyncFlatten(arraify(pluginsFromConfig));
30820
- plugins.push(...rolldownScanPlugin(environment, deps, missing, entries));
30821
30917
  const transformOptions = deepClone(rolldownOptions.transform) ?? {};
30822
30918
  if (transformOptions.jsx === void 0) transformOptions.jsx = {};
30823
30919
  else if (transformOptions.jsx === "react" || transformOptions.jsx === "react-jsx") transformOptions.jsx = getRollupJsxPresets(transformOptions.jsx);
30824
30920
  if (typeof transformOptions.jsx === "object") transformOptions.jsx.development ??= !environment.config.isProduction;
30921
+ const transformSyncJsxOptions = transformOptions.jsx === false ? void 0 : transformOptions.jsx;
30922
+ const plugins = await asyncFlatten(arraify(pluginsFromConfig));
30923
+ plugins.push(...rolldownScanPlugin(environment, deps, missing, entries, transformSyncJsxOptions));
30825
30924
  async function build() {
30826
30925
  await scan({
30827
30926
  ...rolldownOptions,
@@ -30860,7 +30959,7 @@ const typeRE = /\btype\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
30860
30959
  const langRE = /\blang\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
30861
30960
  const svelteScriptModuleRE = /\bcontext\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+))/i;
30862
30961
  const svelteModuleRE = /\smodule\b/i;
30863
- function rolldownScanPlugin(environment, depImports, missing, entries) {
30962
+ function rolldownScanPlugin(environment, depImports, missing, entries, jsxOptions) {
30864
30963
  const seen = /* @__PURE__ */ new Map();
30865
30964
  async function resolveId(id, importer, options) {
30866
30965
  return environment.pluginContainer.resolveId(id, importer && normalizePath(importer), {
@@ -30894,6 +30993,7 @@ function rolldownScanPlugin(environment, depImports, missing, entries) {
30894
30993
  let transpiledContents;
30895
30994
  if (loader !== "js") {
30896
30995
  const result = transformSync(id, contents, {
30996
+ ...jsxOptions !== void 0 ? { jsx: jsxOptions } : {},
30897
30997
  lang: loader,
30898
30998
  tsconfig: false
30899
30999
  });
@@ -31726,15 +31826,17 @@ async function prepareRolldownOptimizerRun(environment, depsInfo, processingCach
31726
31826
  await bundle.close();
31727
31827
  throw new Error("The build was canceled");
31728
31828
  }
31729
- const result = await bundle.write({
31730
- ...rolldownOptions.output,
31731
- format: "esm",
31732
- sourcemap: true,
31733
- dir: processingCacheDir,
31734
- entryFileNames: "[name].js"
31735
- });
31736
- await bundle.close();
31737
- return result;
31829
+ try {
31830
+ return await bundle.write({
31831
+ ...rolldownOptions.output,
31832
+ format: "esm",
31833
+ sourcemap: true,
31834
+ dir: processingCacheDir,
31835
+ entryFileNames: "[name].js"
31836
+ });
31837
+ } finally {
31838
+ await bundle.close();
31839
+ }
31738
31840
  }
31739
31841
  function cancel() {
31740
31842
  canceled = true;
@@ -31912,7 +32014,7 @@ async function extractExportsData(environment, filePath) {
31912
32014
  } catch {
31913
32015
  const lang = rolldownOptions.moduleTypes?.[path.extname(filePath)] || "jsx";
31914
32016
  debug$2?.(`Unable to parse: ${filePath}.\n Trying again with a ${lang} transform.`);
31915
- if (lang !== "jsx" && lang !== "tsx" && lang !== "ts") throw new Error(`Unable to parse : ${filePath}.`);
32017
+ if (lang !== "jsx" && lang !== "tsx" && lang !== "ts") throw new Error(`Unable to parse: ${filePath}.`);
31916
32018
  parseResult = parse$2((await transformWithOxc(entryContent, filePath, { lang }, void 0, environment.config)).code);
31917
32019
  usedJsxLoader = true;
31918
32020
  }
@@ -32134,7 +32236,7 @@ const perEnvironmentOrWorkerPlugin = (name, overrideEnvConfig, f) => {
32134
32236
  }
32135
32237
  }];
32136
32238
  };
32137
- function oxcResolvePlugin(resolveOptions, overrideEnvConfig) {
32239
+ function oxcResolvePlugin(resolveOptions, overrideEnvConfig, isJsPluginContainer = false) {
32138
32240
  return [...resolveOptions.optimizeDeps && !resolveOptions.isBuild ? [optimizerResolvePlugin(resolveOptions)] : [], ...perEnvironmentOrWorkerPlugin("vite:resolve-builtin", overrideEnvConfig, (partialEnv, getEnv) => {
32139
32241
  const depsOptimizerEnabled = resolveOptions.optimizeDeps && !resolveOptions.isBuild && !partialEnv.config.isBundled && !isDepOptimizationDisabled(partialEnv.config.optimizeDeps);
32140
32242
  const getDepsOptimizer = () => {
@@ -32202,8 +32304,8 @@ function oxcResolvePlugin(resolveOptions, overrideEnvConfig) {
32202
32304
  scan
32203
32305
  });
32204
32306
  },
32205
- ...partialEnv.config.command === "serve" ? { async onWarn(msg) {
32206
- getEnv().logger.warn(`warning: ${msg}`, {
32307
+ ...partialEnv.config.command === "serve" || isJsPluginContainer ? { async onWarn(msg) {
32308
+ partialEnv.config.logger.warn(`warning: ${msg}`, {
32207
32309
  clear: true,
32208
32310
  timestamp: true
32209
32311
  });
@@ -33764,7 +33866,7 @@ async function preview(inlineConfig = {}) {
33764
33866
  resolvedUrls: null,
33765
33867
  printUrls() {
33766
33868
  if (server.resolvedUrls) printServerUrls(server.resolvedUrls, options.host, logger.info);
33767
- else throw new Error("cannot print server URLs before server is listening.");
33869
+ else throw new Error("Cannot print server URLs before server is listening.");
33768
33870
  },
33769
33871
  bindCLIShortcuts(options) {
33770
33872
  bindCLIShortcuts(server, options);
@@ -34861,15 +34963,10 @@ function collectAllModules(bundle, fileName, allModules, analyzedModules = /* @_
34861
34963
  if (analyzedModules.has(fileName)) return;
34862
34964
  analyzedModules.add(fileName);
34863
34965
  const chunk = bundle[fileName];
34966
+ if (!chunk) return;
34864
34967
  for (const mod of chunk.moduleIds) allModules.add(mod);
34865
- for (const i of chunk.imports) {
34866
- analyzedModules.add(i);
34867
- collectAllModules(bundle, i, allModules, analyzedModules);
34868
- }
34869
- for (const i of chunk.dynamicImports) {
34870
- analyzedModules.add(i);
34871
- collectAllModules(bundle, i, allModules, analyzedModules);
34872
- }
34968
+ for (const i of chunk.imports) collectAllModules(bundle, i, allModules, analyzedModules);
34969
+ for (const i of chunk.dynamicImports) collectAllModules(bundle, i, allModules, analyzedModules);
34873
34970
  }
34874
34971
  const _require = createRequire(
34875
34972
  /** #__KEEP__ */