@voidzero-dev/vite-plus-core 0.1.23 → 0.1.24

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.
@@ -3060,7 +3060,7 @@ var node_default = createDebug;
3060
3060
  createDebug.default = createDebug;
3061
3061
  createDebug.debug = createDebug;
3062
3062
  //#endregion
3063
- //#region ../../node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.60.4/node_modules/@rollup/pluginutils/dist/es/index.js
3063
+ //#region ../../node_modules/.pnpm/@rollup+pluginutils@5.4.0_rollup@4.60.4/node_modules/@rollup/pluginutils/dist/es/index.js
3064
3064
  var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch$2(), 1);
3065
3065
  function isArray(arg) {
3066
3066
  return Array.isArray(arg);
@@ -3159,6 +3159,7 @@ function isWellFormedString(input) {
3159
3159
  if (hasStringIsWellFormed) return input.isWellFormed();
3160
3160
  return !/\p{Surrogate}/u.test(input);
3161
3161
  }
3162
+ const identifierNameRE = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
3162
3163
  const dataToEsm = function dataToEsm(data, options = {}) {
3163
3164
  var _a, _b;
3164
3165
  const t = options.compact ? "" : "indent" in options ? options.indent : " ";
@@ -3184,10 +3185,13 @@ const dataToEsm = function dataToEsm(data, options = {}) {
3184
3185
  namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
3185
3186
  } else {
3186
3187
  defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, "")}`);
3187
- if (options.includeArbitraryNames && isWellFormedString(key)) {
3188
- const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
3189
- namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
3190
- arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
3188
+ if (key !== "default") {
3189
+ const isIdentifierName = identifierNameRE.test(key);
3190
+ if (isIdentifierName || options.includeArbitraryNames && isWellFormedString(key)) {
3191
+ const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
3192
+ namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, "")};${n}`;
3193
+ arbitraryNameExportRows.push(`${variableName} as ${isIdentifierName ? key : JSON.stringify(key)}`);
3194
+ }
3191
3195
  }
3192
3196
  }
3193
3197
  const arbitraryExportCode = arbitraryNameExportRows.length > 0 ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}` : "";
@@ -3855,11 +3859,11 @@ function processSrcSetSync(srcs, replacer) {
3855
3859
  descriptor
3856
3860
  })));
3857
3861
  }
3858
- const windowsDriveRE = /^[A-Z]:/;
3862
+ const windowsDriveRE$1 = /^[A-Z]:/;
3859
3863
  const replaceWindowsDriveRE = /^([A-Z]):\//;
3860
3864
  const linuxAbsolutePathRE = /^\/[^/]/;
3861
3865
  function escapeToLinuxLikePath(path) {
3862
- if (windowsDriveRE.test(path)) return path.replace(replaceWindowsDriveRE, "/windows/$1/");
3866
+ if (windowsDriveRE$1.test(path)) return path.replace(replaceWindowsDriveRE, "/windows/$1/");
3863
3867
  if (linuxAbsolutePathRE.test(path)) return `/linux${path}`;
3864
3868
  return path;
3865
3869
  }
@@ -5636,9 +5640,10 @@ var Builder = class {
5636
5640
  }
5637
5641
  };
5638
5642
  //#endregion
5639
- //#region ../../node_modules/.pnpm/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.mjs
5643
+ //#region ../../node_modules/.pnpm/tinyglobby@0.2.17/node_modules/tinyglobby/dist/index.mjs
5640
5644
  const isReadonlyArray = Array.isArray;
5641
5645
  const BACKSLASHES = /\\/g;
5646
+ const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
5642
5647
  const isWin = process.platform === "win32";
5643
5648
  const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
5644
5649
  function getPartialMatcher(patterns, options = {}) {
@@ -5705,6 +5710,9 @@ function buildRelative(cwd, root) {
5705
5710
  return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
5706
5711
  };
5707
5712
  }
5713
+ function ensureNonDriveRelativePath(path) {
5714
+ return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
5715
+ }
5708
5716
  const splitPatternOptions = { parts: true };
5709
5717
  function splitPattern(path) {
5710
5718
  var _result$parts;
@@ -5766,7 +5774,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
5766
5774
  }
5767
5775
  const potentialRoot = posix$1.join(cwd, parentDir.slice(i * 3));
5768
5776
  if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
5769
- props.root = potentialRoot;
5777
+ props.root = ensureNonDriveRelativePath(potentialRoot);
5770
5778
  props.depthOffset = -n + i;
5771
5779
  }
5772
5780
  }
@@ -5786,7 +5794,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
5786
5794
  }
5787
5795
  props.depthOffset = newCommonPath.length;
5788
5796
  props.commonPath = newCommonPath;
5789
- props.root = newCommonPath.length > 0 ? posix$1.join(cwd, ...newCommonPath) : cwd;
5797
+ props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix$1.join(cwd, ...newCommonPath) : cwd);
5790
5798
  }
5791
5799
  return result;
5792
5800
  }
@@ -5875,18 +5883,15 @@ function formatPaths(paths, mapper) {
5875
5883
  }
5876
5884
  const defaultOptions = {
5877
5885
  caseSensitiveMatch: true,
5878
- cwd: process.cwd(),
5879
5886
  debug: !!process.env.TINYGLOBBY_DEBUG,
5880
5887
  expandDirectories: true,
5881
5888
  followSymbolicLinks: true,
5882
5889
  onlyFiles: true
5883
5890
  };
5884
5891
  function getOptions(options) {
5885
- const opts = {
5886
- ...defaultOptions,
5887
- ...options
5888
- };
5889
- opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd)).replace(BACKSLASHES, "/");
5892
+ const opts = Object.assign({}, options);
5893
+ for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
5894
+ opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
5890
5895
  opts.ignore = ensureStringArray(opts.ignore);
5891
5896
  opts.fs && (opts.fs = {
5892
5897
  readdir: opts.fs.readdir || readdir,
@@ -14750,12 +14755,47 @@ var require_chokidar = /* @__PURE__ */ __commonJSMin(((exports) => {
14750
14755
  exports.watch = watch;
14751
14756
  }));
14752
14757
  //#endregion
14753
- //#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js
14758
+ //#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/quote.js
14754
14759
  var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14760
+ var OPS = [
14761
+ "||",
14762
+ "&&",
14763
+ ";;",
14764
+ "|&",
14765
+ "<(",
14766
+ "<<<",
14767
+ ">>",
14768
+ ">&",
14769
+ "<&",
14770
+ "&",
14771
+ ";",
14772
+ "(",
14773
+ ")",
14774
+ "|",
14775
+ "<",
14776
+ ">"
14777
+ ];
14778
+ var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
14779
+ var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
14755
14780
  module.exports = function quote(xs) {
14756
14781
  return xs.map(function(s) {
14757
14782
  if (s === "") return "''";
14758
- if (s && typeof s === "object") return s.op.replace(/(.)/g, "\\$1");
14783
+ if (s && typeof s === "object") {
14784
+ if (s.op === "glob") {
14785
+ if (typeof s.pattern !== "string") throw new TypeError("glob token requires a string `pattern`");
14786
+ if (LINE_TERMINATORS.test(s.pattern)) throw new TypeError("glob `pattern` must not contain line terminators");
14787
+ return s.pattern.replace(GLOB_SHELL_SPECIAL, "\\$&");
14788
+ }
14789
+ if (typeof s.op === "string") {
14790
+ if (OPS.indexOf(s.op) < 0) throw new TypeError("invalid `op` value: " + JSON.stringify(s.op));
14791
+ return s.op.replace(/[\s\S]/g, "\\$&");
14792
+ }
14793
+ if (typeof s.comment === "string") {
14794
+ if (LINE_TERMINATORS.test(s.comment)) throw new TypeError("`comment` must not contain line terminators");
14795
+ return "#" + s.comment;
14796
+ }
14797
+ throw new TypeError("unrecognized object token shape");
14798
+ }
14759
14799
  if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, "\\$1") + "'";
14760
14800
  if (/["'\s]/.test(s)) return "\"" + s.replace(/(["\\$`!])/g, "\\$1") + "\"";
14761
14801
  return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
@@ -14763,7 +14803,7 @@ var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14763
14803
  };
14764
14804
  }));
14765
14805
  //#endregion
14766
- //#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js
14806
+ //#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/parse.js
14767
14807
  var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14768
14808
  var CONTROL = "(?:" + [
14769
14809
  "\\|\\|",
@@ -14902,13 +14942,13 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14902
14942
  };
14903
14943
  }));
14904
14944
  //#endregion
14905
- //#region ../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js
14945
+ //#region ../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/index.js
14906
14946
  var require_shell_quote = /* @__PURE__ */ __commonJSMin(((exports) => {
14907
14947
  exports.quote = require_quote();
14908
14948
  exports.parse = require_parse$1();
14909
14949
  }));
14910
14950
  //#endregion
14911
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/macos.js
14951
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js
14912
14952
  var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14913
14953
  module.exports = {
14914
14954
  "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
@@ -14943,7 +14983,7 @@ var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14943
14983
  };
14944
14984
  }));
14945
14985
  //#endregion
14946
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/linux.js
14986
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js
14947
14987
  var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14948
14988
  module.exports = {
14949
14989
  atom: "atom",
@@ -14977,7 +15017,7 @@ var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14977
15017
  };
14978
15018
  }));
14979
15019
  //#endregion
14980
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/editor-info/windows.js
15020
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js
14981
15021
  var require_windows$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14982
15022
  module.exports = [
14983
15023
  "Brackets.exe",
@@ -15010,7 +15050,7 @@ var require_windows$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15010
15050
  ];
15011
15051
  }));
15012
15052
  //#endregion
15013
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/guess.js
15053
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js
15014
15054
  var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15015
15055
  const path$9 = __require$1("path");
15016
15056
  const shellQuote = require_shell_quote();
@@ -15018,60 +15058,74 @@ var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15018
15058
  const COMMON_EDITORS_MACOS = require_macos();
15019
15059
  const COMMON_EDITORS_LINUX = require_linux();
15020
15060
  const COMMON_EDITORS_WIN = require_windows$1();
15021
- module.exports = function guessEditor(specifiedEditor) {
15061
+ function getEditorFromMacProcesses(output) {
15062
+ const processNames = Object.keys(COMMON_EDITORS_MACOS);
15063
+ const processList = output.split("\n");
15064
+ for (let i = 0; i < processNames.length; i++) {
15065
+ const processName = processNames[i];
15066
+ if (processList.includes(processName)) return COMMON_EDITORS_MACOS[processName];
15067
+ const processNameWithoutApplications = processName.replace("/Applications", "");
15068
+ if (output.indexOf(processNameWithoutApplications) !== -1) {
15069
+ if (processName !== COMMON_EDITORS_MACOS[processName]) return COMMON_EDITORS_MACOS[processName];
15070
+ const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
15071
+ if (runningProcess !== void 0) return runningProcess;
15072
+ }
15073
+ }
15074
+ }
15075
+ function getEditorFromWindowsProcesses(output) {
15076
+ const runningProcesses = output.split("\r\n");
15077
+ for (let i = 0; i < runningProcesses.length; i++) {
15078
+ const fullProcessPath = runningProcesses[i].trim();
15079
+ const shortProcessName = path$9.win32.basename(fullProcessPath);
15080
+ if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) return fullProcessPath;
15081
+ }
15082
+ }
15083
+ function getEditorFromLinuxProcesses(output) {
15084
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
15085
+ for (let i = 0; i < processNames.length; i++) {
15086
+ const processName = processNames[i];
15087
+ if (output.indexOf(processName) !== -1) return COMMON_EDITORS_LINUX[processName];
15088
+ }
15089
+ }
15090
+ function guessEditor(specifiedEditor) {
15022
15091
  if (specifiedEditor) return shellQuote.parse(specifiedEditor);
15023
15092
  if (process.env.LAUNCH_EDITOR) return [process.env.LAUNCH_EDITOR];
15024
15093
  if (process.versions.webcontainer) return [process.env.EDITOR || "code"];
15025
15094
  try {
15026
15095
  if (process.platform === "darwin") {
15027
- const output = childProcess$2.execSync("ps x -o comm=", { stdio: [
15096
+ const editor = getEditorFromMacProcesses(childProcess$2.execSync("ps x -o comm=", { stdio: [
15028
15097
  "pipe",
15029
15098
  "pipe",
15030
15099
  "ignore"
15031
- ] }).toString();
15032
- const processNames = Object.keys(COMMON_EDITORS_MACOS);
15033
- const processList = output.split("\n");
15034
- for (let i = 0; i < processNames.length; i++) {
15035
- const processName = processNames[i];
15036
- if (processList.includes(processName)) return [COMMON_EDITORS_MACOS[processName]];
15037
- const processNameWithoutApplications = processName.replace("/Applications", "");
15038
- if (output.indexOf(processNameWithoutApplications) !== -1) {
15039
- if (processName !== COMMON_EDITORS_MACOS[processName]) return [COMMON_EDITORS_MACOS[processName]];
15040
- const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
15041
- if (runningProcess !== void 0) return [runningProcess];
15042
- }
15043
- }
15100
+ ] }).toString());
15101
+ if (editor !== void 0) return [editor];
15044
15102
  } else if (process.platform === "win32") {
15045
- const runningProcesses = childProcess$2.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
15103
+ const editor = getEditorFromWindowsProcesses(childProcess$2.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
15046
15104
  "pipe",
15047
15105
  "pipe",
15048
15106
  "ignore"
15049
- ] }).toString().split("\r\n");
15050
- for (let i = 0; i < runningProcesses.length; i++) {
15051
- const fullProcessPath = runningProcesses[i].trim();
15052
- const shortProcessName = path$9.basename(fullProcessPath);
15053
- if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) return [fullProcessPath];
15054
- }
15107
+ ] }).toString());
15108
+ if (editor !== void 0) return [editor];
15055
15109
  } else if (process.platform === "linux") {
15056
- const output = childProcess$2.execSync("ps x --no-heading -o comm --sort=comm", { stdio: [
15110
+ const editor = getEditorFromLinuxProcesses(childProcess$2.execSync("ps x --no-heading -o comm --sort=comm", { stdio: [
15057
15111
  "pipe",
15058
15112
  "pipe",
15059
15113
  "ignore"
15060
- ] }).toString();
15061
- const processNames = Object.keys(COMMON_EDITORS_LINUX);
15062
- for (let i = 0; i < processNames.length; i++) {
15063
- const processName = processNames[i];
15064
- if (output.indexOf(processName) !== -1) return [COMMON_EDITORS_LINUX[processName]];
15065
- }
15114
+ ] }).toString());
15115
+ if (editor !== void 0) return [editor];
15066
15116
  }
15067
15117
  } catch (ignoreError) {}
15068
15118
  if (process.env.VISUAL) return [process.env.VISUAL];
15069
15119
  else if (process.env.EDITOR) return [process.env.EDITOR];
15070
15120
  return [null];
15071
- };
15121
+ }
15122
+ module.exports = guessEditor;
15123
+ module.exports.getEditorFromMacProcesses = getEditorFromMacProcesses;
15124
+ module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses;
15125
+ module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
15072
15126
  }));
15073
15127
  //#endregion
15074
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/get-args.js
15128
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js
15075
15129
  var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15076
15130
  const path$8 = __require$1("path");
15077
15131
  module.exports = function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
@@ -15150,7 +15204,7 @@ var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15150
15204
  };
15151
15205
  }));
15152
15206
  //#endregion
15153
- //#region ../../node_modules/.pnpm/launch-editor@2.13.2/node_modules/launch-editor/index.js
15207
+ //#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js
15154
15208
  var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15155
15209
  /**
15156
15210
  * Copyright (c) 2015-present, Facebook, Inc.
@@ -15199,11 +15253,12 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
15199
15253
  columnNumber: match && match[3]
15200
15254
  };
15201
15255
  }
15202
- let _childProcess = null;
15256
+ let currentChildProcess = null;
15203
15257
  function launchEditor(file, specifiedEditor, onErrorCallback) {
15204
15258
  const parsed = parseFile(file);
15205
15259
  let { fileName } = parsed;
15206
15260
  const { lineNumber, columnNumber } = parsed;
15261
+ if (process.platform === "win32" && path$7.resolve(fileName).startsWith("\\\\")) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
15207
15262
  if (!fs$6.existsSync(fileName)) return;
15208
15263
  if (typeof specifiedEditor === "function") {
15209
15264
  onErrorCallback = specifiedEditor;
@@ -15220,7 +15275,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
15220
15275
  const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
15221
15276
  args.push.apply(args, extraArgs);
15222
15277
  } else args.push(fileName);
15223
- if (_childProcess && isTerminalEditor(editor)) _childProcess.kill("SIGKILL");
15278
+ if (currentChildProcess && isTerminalEditor(editor)) currentChildProcess.kill("SIGKILL");
15224
15279
  if (process.platform === "win32") {
15225
15280
  function escapeCmdArgs(cmdArgs) {
15226
15281
  return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
@@ -15231,16 +15286,16 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
15231
15286
  return str;
15232
15287
  }
15233
15288
  const launchCommand = [editor, ...args.map(escapeCmdArgs)].map(doubleQuoteIfNeeded).join(" ");
15234
- _childProcess = childProcess$1.exec(launchCommand, {
15289
+ currentChildProcess = childProcess$1.exec(launchCommand, {
15235
15290
  stdio: "inherit",
15236
15291
  shell: true
15237
15292
  });
15238
- } else _childProcess = childProcess$1.spawn(editor, args, { stdio: "inherit" });
15239
- _childProcess.on("exit", function(errorCode) {
15240
- _childProcess = null;
15293
+ } else currentChildProcess = childProcess$1.spawn(editor, args, { stdio: "inherit" });
15294
+ currentChildProcess.on("exit", function(errorCode) {
15295
+ currentChildProcess = null;
15241
15296
  if (errorCode) onErrorCallback(fileName, "(code " + errorCode + ")");
15242
15297
  });
15243
- _childProcess.on("error", function(error) {
15298
+ currentChildProcess.on("error", function(error) {
15244
15299
  let { code, message } = error;
15245
15300
  if ("ENOENT" === code) message = `${message} ('${editor}' command does not exist in 'PATH')`;
15246
15301
  onErrorCallback(fileName, message);
@@ -15249,7 +15304,7 @@ var require_launch_editor = /* @__PURE__ */ __commonJSMin(((exports, module) =>
15249
15304
  module.exports = launchEditor;
15250
15305
  }));
15251
15306
  //#endregion
15252
- //#region ../../node_modules/.pnpm/launch-editor-middleware@2.13.2/node_modules/launch-editor-middleware/index.js
15307
+ //#region ../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js
15253
15308
  var require_launch_editor_middleware = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15254
15309
  const path$6 = __require$1("path");
15255
15310
  const launch = require_launch_editor();
@@ -15523,13 +15578,24 @@ async function httpServerStart(httpServer, serverOptions) {
15523
15578
  }
15524
15579
  function setClientErrorHandler(server, logger) {
15525
15580
  server.on("clientError", (err, socket) => {
15526
- let msg = "400 Bad Request";
15527
- if (err.code === "HPE_HEADER_OVERFLOW") {
15528
- msg = "431 Request Header Fields Too Large";
15529
- 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."));
15581
+ let msg;
15582
+ switch (err.code) {
15583
+ case "HPE_HEADER_OVERFLOW":
15584
+ msg = "431 Request Header Fields Too Large";
15585
+ 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."));
15586
+ break;
15587
+ case "HPE_CHUNK_EXTENSIONS_OVERFLOW":
15588
+ msg = "413 Payload Too Large";
15589
+ break;
15590
+ case "ERR_HTTP_REQUEST_TIMEOUT":
15591
+ msg = "408 Request Timeout";
15592
+ break;
15593
+ default:
15594
+ msg = "400 Bad Request";
15595
+ break;
15530
15596
  }
15531
15597
  if (err.code === "ECONNRESET" || !socket.writable) return;
15532
- socket.end(`HTTP/1.1 ${msg}\r\n\r\n`);
15598
+ socket.end(`HTTP/1.1 ${msg}\r\nConnection: close\r\n\r\n`);
15533
15599
  });
15534
15600
  }
15535
15601
  //#endregion
@@ -17362,7 +17428,7 @@ function checkPublicFile(url, config) {
17362
17428
  return tryStatSync(publicFile)?.isFile() ? publicFile : void 0;
17363
17429
  }
17364
17430
  //#endregion
17365
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/constants.js
17431
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js
17366
17432
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17367
17433
  const BINARY_TYPES = [
17368
17434
  "nodebuffer",
@@ -17385,7 +17451,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17385
17451
  };
17386
17452
  }));
17387
17453
  //#endregion
17388
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/buffer-util.js
17454
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js
17389
17455
  var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17390
17456
  const { EMPTY_BUFFER } = require_constants();
17391
17457
  const FastBuffer = Buffer[Symbol.species];
@@ -17485,7 +17551,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17485
17551
  } catch (e) {}
17486
17552
  }));
17487
17553
  //#endregion
17488
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/limiter.js
17554
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js
17489
17555
  var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17490
17556
  const kDone = Symbol("kDone");
17491
17557
  const kRun = Symbol("kRun");
@@ -17536,7 +17602,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17536
17602
  module.exports = Limiter;
17537
17603
  }));
17538
17604
  //#endregion
17539
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/permessage-deflate.js
17605
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js
17540
17606
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17541
17607
  const zlib$1 = __require$1("zlib");
17542
17608
  const bufferUtil = require_buffer_util();
@@ -17869,7 +17935,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
17869
17935
  }
17870
17936
  }));
17871
17937
  //#endregion
17872
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/validation.js
17938
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js
17873
17939
  var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17874
17940
  const { isUtf8 } = __require$1("buffer");
17875
17941
  const { hasBlob } = require_constants();
@@ -18065,7 +18131,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18065
18131
  } catch (e) {}
18066
18132
  }));
18067
18133
  //#endregion
18068
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/receiver.js
18134
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js
18069
18135
  var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18070
18136
  const { Writable: Writable$1 } = __require$1("stream");
18071
18137
  const PerMessageDeflate = require_permessage_deflate();
@@ -18098,6 +18164,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18098
18164
  * extensions
18099
18165
  * @param {Boolean} [options.isServer=false] Specifies whether to operate in
18100
18166
  * client or server mode
18167
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
18168
+ * buffered data chunks
18169
+ * @param {Number} [options.maxFragments=0] The maximum number of message
18170
+ * fragments
18101
18171
  * @param {Number} [options.maxPayload=0] The maximum allowed message length
18102
18172
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
18103
18173
  * not to skip UTF-8 validation for text and close messages
@@ -18108,6 +18178,8 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18108
18178
  this._binaryType = options.binaryType || BINARY_TYPES[0];
18109
18179
  this._extensions = options.extensions || {};
18110
18180
  this._isServer = !!options.isServer;
18181
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
18182
+ this._maxFragments = options.maxFragments | 0;
18111
18183
  this._maxPayload = options.maxPayload | 0;
18112
18184
  this._skipUTF8Validation = !!options.skipUTF8Validation;
18113
18185
  this[kWebSocket] = void 0;
@@ -18137,6 +18209,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18137
18209
  */
18138
18210
  _write(chunk, encoding, cb) {
18139
18211
  if (this._opcode === 8 && this._state == GET_INFO) return cb();
18212
+ if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
18213
+ cb(this.createError(RangeError, "Too many buffered chunks", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
18214
+ return;
18215
+ }
18140
18216
  this._bufferedBytes += chunk.length;
18141
18217
  this._buffers.push(chunk);
18142
18218
  this.startLoop(cb);
@@ -18364,6 +18440,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18364
18440
  return;
18365
18441
  }
18366
18442
  if (data.length) {
18443
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
18444
+ cb(this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
18445
+ return;
18446
+ }
18367
18447
  this._messageLength = this._totalPayloadLength;
18368
18448
  this._fragments.push(data);
18369
18449
  }
@@ -18385,6 +18465,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18385
18465
  cb(this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));
18386
18466
  return;
18387
18467
  }
18468
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
18469
+ cb(this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
18470
+ return;
18471
+ }
18388
18472
  this._fragments.push(buf);
18389
18473
  }
18390
18474
  this.dataMessage(cb);
@@ -18512,7 +18596,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18512
18596
  module.exports = Receiver;
18513
18597
  }));
18514
18598
  //#endregion
18515
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/sender.js
18599
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js
18516
18600
  var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
18517
18601
  const { Duplex: Duplex$3 } = __require$1("stream");
18518
18602
  const { randomFillSync } = __require$1("crypto");
@@ -19006,7 +19090,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19006
19090
  }
19007
19091
  }));
19008
19092
  //#endregion
19009
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/event-target.js
19093
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js
19010
19094
  var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19011
19095
  const { kForOnEventAttribute, kListener } = require_constants();
19012
19096
  const kCode = Symbol("kCode");
@@ -19237,7 +19321,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19237
19321
  }
19238
19322
  }));
19239
19323
  //#endregion
19240
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/extension.js
19324
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js
19241
19325
  var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19242
19326
  const { tokenChars } = require_validation();
19243
19327
  /**
@@ -19380,7 +19464,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19380
19464
  };
19381
19465
  }));
19382
19466
  //#endregion
19383
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/websocket.js
19467
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js
19384
19468
  var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19385
19469
  const EventEmitter$2 = __require$1("events");
19386
19470
  const https$3 = __require$1("https");
@@ -19542,6 +19626,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19542
19626
  * multiple times in the same tick
19543
19627
  * @param {Function} [options.generateMask] The function used to generate the
19544
19628
  * masking key
19629
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
19630
+ * buffered data chunks
19631
+ * @param {Number} [options.maxFragments=0] The maximum number of message
19632
+ * fragments
19545
19633
  * @param {Number} [options.maxPayload=0] The maximum allowed message size
19546
19634
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
19547
19635
  * not to skip UTF-8 validation for text and close messages
@@ -19553,6 +19641,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19553
19641
  binaryType: this.binaryType,
19554
19642
  extensions: this._extensions,
19555
19643
  isServer: this._isServer,
19644
+ maxBufferedChunks: options.maxBufferedChunks,
19645
+ maxFragments: options.maxFragments,
19556
19646
  maxPayload: options.maxPayload,
19557
19647
  skipUTF8Validation: options.skipUTF8Validation
19558
19648
  });
@@ -19879,6 +19969,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19879
19969
  * masking key
19880
19970
  * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
19881
19971
  * handshake request
19972
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
19973
+ * buffered data chunks
19974
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
19975
+ * fragments
19882
19976
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
19883
19977
  * size
19884
19978
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
@@ -19899,6 +19993,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
19899
19993
  autoPong: true,
19900
19994
  closeTimeout: CLOSE_TIMEOUT,
19901
19995
  protocolVersion: protocolVersions[1],
19996
+ maxBufferedChunks: 1024 * 1024,
19997
+ maxFragments: 128 * 1024,
19902
19998
  maxPayload: 100 * 1024 * 1024,
19903
19999
  skipUTF8Validation: false,
19904
20000
  perMessageDeflate: true,
@@ -20088,6 +20184,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20088
20184
  websocket.setSocket(socket, head, {
20089
20185
  allowSynchronousEvents: opts.allowSynchronousEvents,
20090
20186
  generateMask: opts.generateMask,
20187
+ maxBufferedChunks: opts.maxBufferedChunks,
20188
+ maxFragments: opts.maxFragments,
20091
20189
  maxPayload: opts.maxPayload,
20092
20190
  skipUTF8Validation: opts.skipUTF8Validation
20093
20191
  });
@@ -20355,7 +20453,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20355
20453
  }
20356
20454
  }));
20357
20455
  //#endregion
20358
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/stream.js
20456
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/stream.js
20359
20457
  var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20360
20458
  require_websocket();
20361
20459
  const { Duplex: Duplex$1 } = __require$1("stream");
@@ -20471,7 +20569,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20471
20569
  module.exports = createWebSocketStream;
20472
20570
  }));
20473
20571
  //#endregion
20474
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/subprotocol.js
20572
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js
20475
20573
  var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20476
20574
  const { tokenChars } = require_validation();
20477
20575
  /**
@@ -20510,7 +20608,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20510
20608
  module.exports = { parse };
20511
20609
  }));
20512
20610
  //#endregion
20513
- //#region ../../node_modules/.pnpm/ws@8.20.1/node_modules/ws/lib/websocket-server.js
20611
+ //#region ../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket-server.js
20514
20612
  var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
20515
20613
  const EventEmitter$1 = __require$1("events");
20516
20614
  const http$4 = __require$1("http");
@@ -20549,6 +20647,10 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
20549
20647
  * called
20550
20648
  * @param {Function} [options.handleProtocols] A hook to handle protocols
20551
20649
  * @param {String} [options.host] The hostname where to bind the server
20650
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
20651
+ * buffered data chunks
20652
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
20653
+ * fragments
20552
20654
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
20553
20655
  * size
20554
20656
  * @param {Boolean} [options.noServer=false] Enable no server mode
@@ -20570,6 +20672,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
20570
20672
  options = {
20571
20673
  allowSynchronousEvents: true,
20572
20674
  autoPong: true,
20675
+ maxBufferedChunks: 1024 * 1024,
20676
+ maxFragments: 128 * 1024,
20573
20677
  maxPayload: 100 * 1024 * 1024,
20574
20678
  skipUTF8Validation: false,
20575
20679
  perMessageDeflate: false,
@@ -20799,6 +20903,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
20799
20903
  socket.removeListener("error", socketOnError);
20800
20904
  ws.setSocket(socket, head, {
20801
20905
  allowSynchronousEvents: this.options.allowSynchronousEvents,
20906
+ maxBufferedChunks: this.options.maxBufferedChunks,
20907
+ maxFragments: this.options.maxFragments,
20802
20908
  maxPayload: this.options.maxPayload,
20803
20909
  skipUTF8Validation: this.options.skipUTF8Validation
20804
20910
  });
@@ -25136,7 +25242,7 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25136
25242
  };
25137
25243
  }));
25138
25244
  //#endregion
25139
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.3_yaml@2.9.0/node_modules/postcss-load-config/src/req.js
25245
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/req.js
25140
25246
  var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25141
25247
  const { createRequire: createRequire$2 } = __require$1("node:module");
25142
25248
  const { fileURLToPath: fileURLToPath$2, pathToFileURL: pathToFileURL$1 } = __require$1("node:url");
@@ -25178,7 +25284,7 @@ var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25178
25284
  module.exports = req;
25179
25285
  }));
25180
25286
  //#endregion
25181
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.3_yaml@2.9.0/node_modules/postcss-load-config/src/options.js
25287
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/options.js
25182
25288
  var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25183
25289
  const req = require_req();
25184
25290
  /**
@@ -25212,7 +25318,7 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25212
25318
  module.exports = options;
25213
25319
  }));
25214
25320
  //#endregion
25215
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.3_yaml@2.9.0/node_modules/postcss-load-config/src/plugins.js
25321
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/plugins.js
25216
25322
  var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25217
25323
  const req = require_req();
25218
25324
  /**
@@ -25266,7 +25372,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25266
25372
  module.exports = plugins;
25267
25373
  }));
25268
25374
  //#endregion
25269
- //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.3_yaml@2.9.0/node_modules/postcss-load-config/src/index.js
25375
+ //#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.15_tsx@4.22.4_yaml@2.9.0/node_modules/postcss-load-config/src/index.js
25270
25376
  var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25271
25377
  const { resolve: resolve$3 } = __require$1("node:path");
25272
25378
  const config = require_src$1();
@@ -25697,7 +25803,7 @@ function createIdResolver(config, options) {
25697
25803
  tryIndex: true,
25698
25804
  ...options,
25699
25805
  idOnly: true
25700
- }, environment.config)], void 0, false);
25806
+ }, environment.config, true)], void 0, false);
25701
25807
  pluginContainerMap.set(environment, pluginContainer);
25702
25808
  }
25703
25809
  return await pluginContainer.resolveId(id, importer, { scan });
@@ -29712,12 +29818,15 @@ function isFileServingAllowed(configOrUrl, urlOrServer) {
29712
29818
  function isFileInTargetPath(targetPath, filePath) {
29713
29819
  return isSameFilePath(targetPath, filePath) || isParentDirectory(targetPath, filePath);
29714
29820
  }
29821
+ const windowsDriveRE = /^[A-Z]:/i;
29715
29822
  /**
29716
29823
  * Warning: parameters are not validated, only works with normalized absolute paths
29717
29824
  */
29718
29825
  function isFileLoadingAllowed(config, filePath) {
29719
29826
  const { fs } = config.server;
29720
29827
  if (!fs.strict) return true;
29828
+ if (isWindows && filePath.includes("~")) return false;
29829
+ if ((isWindows && windowsDriveRE.test(filePath) ? filePath.slice(2) : filePath).includes(":")) return false;
29721
29830
  const filePathWithoutTrailingSlash = filePath.endsWith("/") ? filePath.slice(0, -1) : filePath;
29722
29831
  if (config.fsDenyGlob(filePathWithoutTrailingSlash)) return false;
29723
29832
  if (config.safeModulePaths.has(filePath)) return true;
@@ -30873,8 +30982,8 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
30873
30982
  let proxyModuleUrl;
30874
30983
  const trailingSlash = htmlPath.endsWith("/");
30875
30984
  if (!trailingSlash && fs.existsSync(filename)) {
30876
- proxyModulePath = htmlPath;
30877
- proxyModuleUrl = proxyModulePath;
30985
+ proxyModulePath = htmlPath.startsWith(FS_PREFIX) ? filename : htmlPath;
30986
+ proxyModuleUrl = htmlPath;
30878
30987
  } else {
30879
30988
  proxyModulePath = `\0${`${htmlPath}${trailingSlash ? "index.html" : ""}`}`;
30880
30989
  proxyModuleUrl = wrapId(proxyModulePath);
@@ -31807,8 +31916,8 @@ async function _createServer(inlineConfig = {}, options) {
31807
31916
  },
31808
31917
  printUrls() {
31809
31918
  if (server.resolvedUrls) printServerUrls(server.resolvedUrls, serverConfig.host, config.logger.info);
31810
- else if (middlewareMode) throw new Error("cannot print server URLs in middleware mode.");
31811
- else throw new Error("cannot print server URLs before server.listen is called.");
31919
+ else if (middlewareMode) throw new Error("Cannot print server URLs in middleware mode.");
31920
+ else throw new Error("Cannot print server URLs before server.listen is called.");
31812
31921
  },
31813
31922
  bindCLIShortcuts(options) {
31814
31923
  bindCLIShortcuts(server, options);
@@ -34626,6 +34735,7 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
34626
34735
  if (!matches.length) return null;
34627
34736
  const s = new MagicString(code);
34628
34737
  const staticImports = (await Promise.all(matches.map(async ({ globsResolved, isRelative, options, index, start, end, onlyKeys, onlyValues }) => {
34738
+ if (!dir && !options.base && isRelative) throw new Error("In virtual modules, all globs must start with '/'");
34629
34739
  const files = (await glob(globsResolved, {
34630
34740
  absolute: true,
34631
34741
  cwd: getCommonBase(globsResolved) ?? root,
@@ -34638,7 +34748,6 @@ async function transformGlobImport(code, id, root, resolveId, restoreQueryExtens
34638
34748
  const staticImports = [];
34639
34749
  const resolvePaths = (file) => {
34640
34750
  if (!dir) {
34641
- if (!options.base && isRelative) throw new Error("In virtual modules, all globs must start with '/'");
34642
34751
  const importPath = `/${relative$2(root, file)}`;
34643
34752
  let filePath = options.base ? `${relative$2(posix.join(root, options.base), file)}` : importPath;
34644
34753
  if (options.base && !filePath.startsWith("./") && !filePath.startsWith("../")) filePath = `./${filePath}`;
@@ -37309,15 +37418,17 @@ async function prepareRolldownOptimizerRun(environment, depsInfo, processingCach
37309
37418
  await bundle.close();
37310
37419
  throw new Error("The build was canceled");
37311
37420
  }
37312
- const result = await bundle.write({
37313
- ...rolldownOptions.output,
37314
- format: "esm",
37315
- sourcemap: true,
37316
- dir: processingCacheDir,
37317
- entryFileNames: "[name].js"
37318
- });
37319
- await bundle.close();
37320
- return result;
37421
+ try {
37422
+ return await bundle.write({
37423
+ ...rolldownOptions.output,
37424
+ format: "esm",
37425
+ sourcemap: true,
37426
+ dir: processingCacheDir,
37427
+ entryFileNames: "[name].js"
37428
+ });
37429
+ } finally {
37430
+ await bundle.close();
37431
+ }
37321
37432
  }
37322
37433
  function cancel() {
37323
37434
  canceled = true;
@@ -37495,7 +37606,7 @@ async function extractExportsData(environment, filePath) {
37495
37606
  } catch {
37496
37607
  const lang = rolldownOptions.moduleTypes?.[path.extname(filePath)] || "jsx";
37497
37608
  debug$2?.(`Unable to parse: ${filePath}.\n Trying again with a ${lang} transform.`);
37498
- if (lang !== "jsx" && lang !== "tsx" && lang !== "ts") throw new Error(`Unable to parse : ${filePath}.`);
37609
+ if (lang !== "jsx" && lang !== "tsx" && lang !== "ts") throw new Error(`Unable to parse: ${filePath}.`);
37499
37610
  parseResult = parse$2((await transformWithOxc(entryContent, filePath, { lang }, void 0, environment.config)).code);
37500
37611
  usedJsxLoader = true;
37501
37612
  }
@@ -37717,7 +37828,7 @@ const perEnvironmentOrWorkerPlugin = (name, overrideEnvConfig, f) => {
37717
37828
  }
37718
37829
  }];
37719
37830
  };
37720
- function oxcResolvePlugin(resolveOptions, overrideEnvConfig) {
37831
+ function oxcResolvePlugin(resolveOptions, overrideEnvConfig, isJsPluginContainer = false) {
37721
37832
  return [...resolveOptions.optimizeDeps && !resolveOptions.isBuild ? [optimizerResolvePlugin(resolveOptions)] : [], ...perEnvironmentOrWorkerPlugin("vite:resolve-builtin", overrideEnvConfig, (partialEnv, getEnv) => {
37722
37833
  const depsOptimizerEnabled = resolveOptions.optimizeDeps && !resolveOptions.isBuild && !partialEnv.config.isBundled && !isDepOptimizationDisabled(partialEnv.config.optimizeDeps);
37723
37834
  const getDepsOptimizer = () => {
@@ -37785,8 +37896,8 @@ function oxcResolvePlugin(resolveOptions, overrideEnvConfig) {
37785
37896
  scan
37786
37897
  });
37787
37898
  },
37788
- ...partialEnv.config.command === "serve" ? { async onWarn(msg) {
37789
- getEnv().logger.warn(`warning: ${msg}`, {
37899
+ ...partialEnv.config.command === "serve" || isJsPluginContainer ? { async onWarn(msg) {
37900
+ partialEnv.config.logger.warn(`warning: ${msg}`, {
37790
37901
  clear: true,
37791
37902
  timestamp: true
37792
37903
  });
@@ -39347,7 +39458,7 @@ async function preview(inlineConfig = {}) {
39347
39458
  resolvedUrls: null,
39348
39459
  printUrls() {
39349
39460
  if (server.resolvedUrls) printServerUrls(server.resolvedUrls, options.host, logger.info);
39350
- else throw new Error("cannot print server URLs before server is listening.");
39461
+ else throw new Error("Cannot print server URLs before server is listening.");
39351
39462
  },
39352
39463
  bindCLIShortcuts(options) {
39353
39464
  bindCLIShortcuts(server, options);
@@ -40444,15 +40555,10 @@ function collectAllModules(bundle, fileName, allModules, analyzedModules = /* @_
40444
40555
  if (analyzedModules.has(fileName)) return;
40445
40556
  analyzedModules.add(fileName);
40446
40557
  const chunk = bundle[fileName];
40558
+ if (!chunk) return;
40447
40559
  for (const mod of chunk.moduleIds) allModules.add(mod);
40448
- for (const i of chunk.imports) {
40449
- analyzedModules.add(i);
40450
- collectAllModules(bundle, i, allModules, analyzedModules);
40451
- }
40452
- for (const i of chunk.dynamicImports) {
40453
- analyzedModules.add(i);
40454
- collectAllModules(bundle, i, allModules, analyzedModules);
40455
- }
40560
+ for (const i of chunk.imports) collectAllModules(bundle, i, allModules, analyzedModules);
40561
+ for (const i of chunk.dynamicImports) collectAllModules(bundle, i, allModules, analyzedModules);
40456
40562
  }
40457
40563
  const _require = createRequire(
40458
40564
  /** #__KEEP__ */