vite 4.3.1 → 4.3.3

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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -2,6 +2,7 @@ import fs$l, { promises as promises$2 } from 'node:fs';
2
2
  import fsp from 'node:fs/promises';
3
3
  import path$o, { dirname as dirname$2, join as join$2, posix as posix$1, isAbsolute as isAbsolute$2, relative as relative$2, basename as basename$2, extname as extname$1 } from 'node:path';
4
4
  import { fileURLToPath, URL as URL$3, URLSearchParams, parse as parse$i, pathToFileURL } from 'node:url';
5
+ import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
5
6
  import { performance as performance$1 } from 'node:perf_hooks';
6
7
  import { createRequire as createRequire$1, builtinModules } from 'node:module';
7
8
  import require$$0$3 from 'tty';
@@ -25,7 +26,6 @@ import { promises } from 'node:dns';
25
26
  import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, ENV_ENTRY, DEFAULT_MAIN_FIELDS, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, SPECIAL_QUERY_RE, DEP_VERSION_RE, CSS_LANGS_RE, KNOWN_ASSET_TYPES, CLIENT_DIR, JS_TYPES_RE, ESBUILD_MODULES_TARGET, VERSION as VERSION$1, VITE_PACKAGE_DIR, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js';
26
27
  import require$$5$1 from 'crypto';
27
28
  import { Buffer as Buffer$1 } from 'node:buffer';
28
- import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
29
29
  import require$$0$8, { createRequire as createRequire$2 } from 'module';
30
30
  import assert$1 from 'node:assert';
31
31
  import process$1 from 'node:process';
@@ -84,11 +84,7 @@ function getAugmentedNamespace(n) {
84
84
  return a;
85
85
  }
86
86
 
87
- var picocolorsExports = {};
88
- var picocolors = {
89
- get exports(){ return picocolorsExports; },
90
- set exports(v){ picocolorsExports = v; },
91
- };
87
+ var picocolors = {exports: {}};
92
88
 
93
89
  let tty = require$$0$3;
94
90
 
@@ -147,7 +143,10 @@ let createColors = (enabled = isColorSupported) => ({
147
143
  });
148
144
 
149
145
  picocolors.exports = createColors();
150
- picocolorsExports.createColors = createColors;
146
+ picocolors.exports.createColors = createColors;
147
+
148
+ var picocolorsExports = picocolors.exports;
149
+ var colors$1 = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
151
150
 
152
151
  function matches$1(pattern, importee) {
153
152
  if (pattern instanceof RegExp) {
@@ -429,12 +428,6 @@ function walk$4(ast, { enter, leave }) {
429
428
  return instance.visit(ast, null);
430
429
  }
431
430
 
432
- var picomatchExports = {};
433
- var picomatch$5 = {
434
- get exports(){ return picomatchExports; },
435
- set exports(v){ picomatchExports = v; },
436
- };
437
-
438
431
  var utils$k = {};
439
432
 
440
433
  const path$n = require$$0$4;
@@ -678,7 +671,7 @@ var constants$6 = {
678
671
  output = `(?:^(?!${output}).*$)`;
679
672
  }
680
673
  return output;
681
- };
674
+ };
682
675
  } (utils$k));
683
676
 
684
677
  const utils$j = utils$k;
@@ -2183,9 +2176,9 @@ const isObject$4 = val => val && typeof val === 'object' && !Array.isArray(val);
2183
2176
  * @api public
2184
2177
  */
2185
2178
 
2186
- const picomatch$4 = (glob, options, returnState = false) => {
2179
+ const picomatch$5 = (glob, options, returnState = false) => {
2187
2180
  if (Array.isArray(glob)) {
2188
- const fns = glob.map(input => picomatch$4(input, options, returnState));
2181
+ const fns = glob.map(input => picomatch$5(input, options, returnState));
2189
2182
  const arrayMatcher = str => {
2190
2183
  for (const isMatch of fns) {
2191
2184
  const state = isMatch(str);
@@ -2205,8 +2198,8 @@ const picomatch$4 = (glob, options, returnState = false) => {
2205
2198
  const opts = options || {};
2206
2199
  const posix = utils$h.isWindows(options);
2207
2200
  const regex = isState
2208
- ? picomatch$4.compileRe(glob, options)
2209
- : picomatch$4.makeRe(glob, options, false, true);
2201
+ ? picomatch$5.compileRe(glob, options)
2202
+ : picomatch$5.makeRe(glob, options, false, true);
2210
2203
 
2211
2204
  const state = regex.state;
2212
2205
  delete regex.state;
@@ -2214,11 +2207,11 @@ const picomatch$4 = (glob, options, returnState = false) => {
2214
2207
  let isIgnored = () => false;
2215
2208
  if (opts.ignore) {
2216
2209
  const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
2217
- isIgnored = picomatch$4(opts.ignore, ignoreOpts, returnState);
2210
+ isIgnored = picomatch$5(opts.ignore, ignoreOpts, returnState);
2218
2211
  }
2219
2212
 
2220
2213
  const matcher = (input, returnObject = false) => {
2221
- const { isMatch, match, output } = picomatch$4.test(input, regex, options, { glob, posix });
2214
+ const { isMatch, match, output } = picomatch$5.test(input, regex, options, { glob, posix });
2222
2215
  const result = { glob, state, regex, posix, input, output, match, isMatch };
2223
2216
 
2224
2217
  if (typeof opts.onResult === 'function') {
@@ -2268,7 +2261,7 @@ const picomatch$4 = (glob, options, returnState = false) => {
2268
2261
  * @api public
2269
2262
  */
2270
2263
 
2271
- picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
2264
+ picomatch$5.test = (input, regex, options, { glob, posix } = {}) => {
2272
2265
  if (typeof input !== 'string') {
2273
2266
  throw new TypeError('Expected input to be a string');
2274
2267
  }
@@ -2289,7 +2282,7 @@ picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
2289
2282
 
2290
2283
  if (match === false || opts.capture === true) {
2291
2284
  if (opts.matchBase === true || opts.basename === true) {
2292
- match = picomatch$4.matchBase(input, regex, options, posix);
2285
+ match = picomatch$5.matchBase(input, regex, options, posix);
2293
2286
  } else {
2294
2287
  match = regex.exec(output);
2295
2288
  }
@@ -2312,8 +2305,8 @@ picomatch$4.test = (input, regex, options, { glob, posix } = {}) => {
2312
2305
  * @api public
2313
2306
  */
2314
2307
 
2315
- picomatch$4.matchBase = (input, glob, options, posix = utils$h.isWindows(options)) => {
2316
- const regex = glob instanceof RegExp ? glob : picomatch$4.makeRe(glob, options);
2308
+ picomatch$5.matchBase = (input, glob, options, posix = utils$h.isWindows(options)) => {
2309
+ const regex = glob instanceof RegExp ? glob : picomatch$5.makeRe(glob, options);
2317
2310
  return regex.test(path$m.basename(input));
2318
2311
  };
2319
2312
 
@@ -2334,7 +2327,7 @@ picomatch$4.matchBase = (input, glob, options, posix = utils$h.isWindows(options
2334
2327
  * @api public
2335
2328
  */
2336
2329
 
2337
- picomatch$4.isMatch = (str, patterns, options) => picomatch$4(patterns, options)(str);
2330
+ picomatch$5.isMatch = (str, patterns, options) => picomatch$5(patterns, options)(str);
2338
2331
 
2339
2332
  /**
2340
2333
  * Parse a glob pattern to create the source string for a regular
@@ -2350,8 +2343,8 @@ picomatch$4.isMatch = (str, patterns, options) => picomatch$4(patterns, options)
2350
2343
  * @api public
2351
2344
  */
2352
2345
 
2353
- picomatch$4.parse = (pattern, options) => {
2354
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$4.parse(p, options));
2346
+ picomatch$5.parse = (pattern, options) => {
2347
+ if (Array.isArray(pattern)) return pattern.map(p => picomatch$5.parse(p, options));
2355
2348
  return parse$g(pattern, { ...options, fastpaths: false });
2356
2349
  };
2357
2350
 
@@ -2382,7 +2375,7 @@ picomatch$4.parse = (pattern, options) => {
2382
2375
  * @api public
2383
2376
  */
2384
2377
 
2385
- picomatch$4.scan = (input, options) => scan$1(input, options);
2378
+ picomatch$5.scan = (input, options) => scan$1(input, options);
2386
2379
 
2387
2380
  /**
2388
2381
  * Compile a regular expression from the `state` object returned by the
@@ -2396,7 +2389,7 @@ picomatch$4.scan = (input, options) => scan$1(input, options);
2396
2389
  * @api public
2397
2390
  */
2398
2391
 
2399
- picomatch$4.compileRe = (state, options, returnOutput = false, returnState = false) => {
2392
+ picomatch$5.compileRe = (state, options, returnOutput = false, returnState = false) => {
2400
2393
  if (returnOutput === true) {
2401
2394
  return state.output;
2402
2395
  }
@@ -2410,7 +2403,7 @@ picomatch$4.compileRe = (state, options, returnOutput = false, returnState = fal
2410
2403
  source = `^(?!${source}).*$`;
2411
2404
  }
2412
2405
 
2413
- const regex = picomatch$4.toRegex(source, options);
2406
+ const regex = picomatch$5.toRegex(source, options);
2414
2407
  if (returnState === true) {
2415
2408
  regex.state = state;
2416
2409
  }
@@ -2437,7 +2430,7 @@ picomatch$4.compileRe = (state, options, returnOutput = false, returnState = fal
2437
2430
  * @api public
2438
2431
  */
2439
2432
 
2440
- picomatch$4.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2433
+ picomatch$5.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
2441
2434
  if (!input || typeof input !== 'string') {
2442
2435
  throw new TypeError('Expected a non-empty string');
2443
2436
  }
@@ -2452,7 +2445,7 @@ picomatch$4.makeRe = (input, options = {}, returnOutput = false, returnState = f
2452
2445
  parsed = parse$g(input, options);
2453
2446
  }
2454
2447
 
2455
- return picomatch$4.compileRe(parsed, options, returnOutput, returnState);
2448
+ return picomatch$5.compileRe(parsed, options, returnOutput, returnState);
2456
2449
  };
2457
2450
 
2458
2451
  /**
@@ -2472,7 +2465,7 @@ picomatch$4.makeRe = (input, options = {}, returnOutput = false, returnState = f
2472
2465
  * @api public
2473
2466
  */
2474
2467
 
2475
- picomatch$4.toRegex = (source, options) => {
2468
+ picomatch$5.toRegex = (source, options) => {
2476
2469
  try {
2477
2470
  const opts = options || {};
2478
2471
  return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
@@ -2487,20 +2480,17 @@ picomatch$4.toRegex = (source, options) => {
2487
2480
  * @return {Object}
2488
2481
  */
2489
2482
 
2490
- picomatch$4.constants = constants$4;
2483
+ picomatch$5.constants = constants$4;
2491
2484
 
2492
2485
  /**
2493
2486
  * Expose "picomatch"
2494
2487
  */
2495
2488
 
2496
- var picomatch_1 = picomatch$4;
2497
-
2498
- (function (module) {
2489
+ var picomatch_1 = picomatch$5;
2499
2490
 
2500
- module.exports = picomatch_1;
2501
- } (picomatch$5));
2491
+ var picomatch$3 = picomatch_1;
2502
2492
 
2503
- var picomatch$3 = /*@__PURE__*/getDefaultExportFromCjs(picomatchExports);
2493
+ var picomatch$4 = /*@__PURE__*/getDefaultExportFromCjs(picomatch$3);
2504
2494
 
2505
2495
  const extractors = {
2506
2496
  ArrayPattern(names, param) {
@@ -2680,7 +2670,7 @@ const createFilter$1 = function createFilter(include, exclude, options) {
2680
2670
  test: (what) => {
2681
2671
  // this refactor is a tad overly verbose but makes for easy debugging
2682
2672
  const pattern = getMatcherString(id, resolutionBase);
2683
- const fn = picomatch$3(pattern, { dot: true });
2673
+ const fn = picomatch$4(pattern, { dot: true });
2684
2674
  const result = fn(what);
2685
2675
  return result;
2686
2676
  }
@@ -2836,6 +2826,8 @@ var commondir = function (basedir, relfiles) {
2836
2826
  return res.length > 1 ? res.join('/') : '/'
2837
2827
  };
2838
2828
 
2829
+ var getCommonDir = /*@__PURE__*/getDefaultExportFromCjs(commondir);
2830
+
2839
2831
  var old$1 = {};
2840
2832
 
2841
2833
  // Copyright Joyent, Inc. and other Node contributors.
@@ -4374,22 +4366,14 @@ let Minimatch$1 = class Minimatch {
4374
4366
 
4375
4367
  minimatch$1.Minimatch = Minimatch$1;
4376
4368
 
4377
- var inheritsExports = {};
4378
- var inherits = {
4379
- get exports(){ return inheritsExports; },
4380
- set exports(v){ inheritsExports = v; },
4381
- };
4369
+ var inherits = {exports: {}};
4382
4370
 
4383
- var inherits_browserExports = {};
4384
- var inherits_browser = {
4385
- get exports(){ return inherits_browserExports; },
4386
- set exports(v){ inherits_browserExports = v; },
4387
- };
4371
+ var inherits_browser = {exports: {}};
4388
4372
 
4389
4373
  var hasRequiredInherits_browser;
4390
4374
 
4391
4375
  function requireInherits_browser () {
4392
- if (hasRequiredInherits_browser) return inherits_browserExports;
4376
+ if (hasRequiredInherits_browser) return inherits_browser.exports;
4393
4377
  hasRequiredInherits_browser = 1;
4394
4378
  if (typeof Object.create === 'function') {
4395
4379
  // implementation from standard node.js 'util' module
@@ -4418,20 +4402,20 @@ function requireInherits_browser () {
4418
4402
  }
4419
4403
  };
4420
4404
  }
4421
- return inherits_browserExports;
4405
+ return inherits_browser.exports;
4422
4406
  }
4423
4407
 
4424
- (function (module) {
4425
- try {
4426
- var util = require('util');
4427
- /* istanbul ignore next */
4428
- if (typeof util.inherits !== 'function') throw '';
4429
- module.exports = util.inherits;
4430
- } catch (e) {
4431
- /* istanbul ignore next */
4432
- module.exports = requireInherits_browser();
4433
- }
4434
- } (inherits));
4408
+ try {
4409
+ var util$2 = require('util');
4410
+ /* istanbul ignore next */
4411
+ if (typeof util$2.inherits !== 'function') throw '';
4412
+ inherits.exports = util$2.inherits;
4413
+ } catch (e) {
4414
+ /* istanbul ignore next */
4415
+ inherits.exports = requireInherits_browser();
4416
+ }
4417
+
4418
+ var inheritsExports = inherits.exports;
4435
4419
 
4436
4420
  var common$c = {};
4437
4421
 
@@ -5199,15 +5183,11 @@ function wrappy$2 (fn, cb) {
5199
5183
  }
5200
5184
  }
5201
5185
 
5202
- var onceExports = {};
5203
- var once$2 = {
5204
- get exports(){ return onceExports; },
5205
- set exports(v){ onceExports = v; },
5206
- };
5186
+ var once$2 = {exports: {}};
5207
5187
 
5208
5188
  var wrappy$1 = wrappy_1;
5209
5189
  once$2.exports = wrappy$1(once$1);
5210
- onceExports.strict = wrappy$1(onceStrict);
5190
+ once$2.exports.strict = wrappy$1(onceStrict);
5211
5191
 
5212
5192
  once$1.proto = once$1(function () {
5213
5193
  Object.defineProperty(Function.prototype, 'once', {
@@ -5248,6 +5228,8 @@ function onceStrict (fn) {
5248
5228
  return f
5249
5229
  }
5250
5230
 
5231
+ var onceExports = once$2.exports;
5232
+
5251
5233
  var wrappy = wrappy_1;
5252
5234
  var reqs = Object.create(null);
5253
5235
  var once = onceExports;
@@ -6098,7 +6080,7 @@ function requireGlob () {
6098
6080
  }
6099
6081
 
6100
6082
  var globExports = requireGlob();
6101
- var glob = /*@__PURE__*/getDefaultExportFromCjs(globExports);
6083
+ var glob$1 = /*@__PURE__*/getDefaultExportFromCjs(globExports);
6102
6084
 
6103
6085
  const comma = ','.charCodeAt(0);
6104
6086
  const semicolon = ';'.charCodeAt(0);
@@ -7431,7 +7413,7 @@ function isReference(node, parent) {
7431
7413
  return false;
7432
7414
  }
7433
7415
 
7434
- var version$3 = "24.0.1";
7416
+ var version$3 = "24.1.0";
7435
7417
  var peerDependencies = {
7436
7418
  rollup: "^2.68.0||^3.0.0"
7437
7419
  };
@@ -7596,7 +7578,7 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
7596
7578
  isNegated
7597
7579
  ? dynamicRequireModules.delete(targetPath)
7598
7580
  : dynamicRequireModules.set(targetPath, resolvedPath);
7599
- for (const path of glob.sync(isNegated ? pattern.substr(1) : pattern)) {
7581
+ for (const path of glob$1.sync(isNegated ? pattern.substr(1) : pattern)) {
7600
7582
  const resolvedPath = resolve$3(path);
7601
7583
  const requirePath = normalizePathSlashes(resolvedPath);
7602
7584
  if (isDirectory(resolvedPath)) {
@@ -7611,7 +7593,7 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
7611
7593
  }
7612
7594
  }
7613
7595
  return {
7614
- commonDir: dirNames.size ? commondir([...dirNames, dynamicRequireRoot]) : null,
7596
+ commonDir: dirNames.size ? getCommonDir([...dirNames, dynamicRequireRoot]) : null,
7615
7597
  dynamicRequireModules
7616
7598
  };
7617
7599
  }
@@ -7835,13 +7817,16 @@ async function getStaticRequireProxy(id, requireReturnsDefault, loadModule) {
7835
7817
  } = await loadModule({ id });
7836
7818
  if (!commonjsMeta) {
7837
7819
  return getUnknownRequireProxy(id, requireReturnsDefault);
7838
- } else if (commonjsMeta.isCommonJS) {
7820
+ }
7821
+ if (commonjsMeta.isCommonJS) {
7839
7822
  return `export { __moduleExports as default } from ${JSON.stringify(id)};`;
7840
- } else if (!requireReturnsDefault) {
7823
+ }
7824
+ if (!requireReturnsDefault) {
7841
7825
  return `import { getAugmentedNamespace } from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
7842
7826
  id
7843
7827
  )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
7844
- } else if (
7828
+ }
7829
+ if (
7845
7830
  requireReturnsDefault !== true &&
7846
7831
  (requireReturnsDefault === 'namespace' ||
7847
7832
  !commonjsMeta.hasDefaultExport ||
@@ -8331,11 +8316,16 @@ function getKeypath(node) {
8331
8316
 
8332
8317
  const KEY_COMPILED_ESM = '__esModule';
8333
8318
 
8334
- function isDefineCompiledEsm(node) {
8319
+ function getDefineCompiledEsmType(node) {
8320
+ const definedPropertyWithExports = getDefinePropertyCallName(node, 'exports');
8335
8321
  const definedProperty =
8336
- getDefinePropertyCallName(node, 'exports') || getDefinePropertyCallName(node, 'module.exports');
8322
+ definedPropertyWithExports || getDefinePropertyCallName(node, 'module.exports');
8337
8323
  if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {
8338
- return isTruthy(definedProperty.value);
8324
+ return isTruthy(definedProperty.value)
8325
+ ? definedPropertyWithExports
8326
+ ? 'exports'
8327
+ : 'module'
8328
+ : false;
8339
8329
  }
8340
8330
  return false;
8341
8331
  }
@@ -8379,20 +8369,6 @@ function isShorthandProperty(parent) {
8379
8369
  return parent && parent.type === 'Property' && parent.shorthand;
8380
8370
  }
8381
8371
 
8382
- function hasDefineEsmProperty(node) {
8383
- return node.properties.some((property) => {
8384
- if (
8385
- property.type === 'Property' &&
8386
- property.key.type === 'Identifier' &&
8387
- property.key.name === '__esModule' &&
8388
- isTruthy(property.value)
8389
- ) {
8390
- return true;
8391
- }
8392
- return false;
8393
- });
8394
- }
8395
-
8396
8372
  function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges) {
8397
8373
  const args = [];
8398
8374
  const passedArgs = [];
@@ -8402,19 +8378,22 @@ function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRan
8402
8378
  }
8403
8379
  if (uses.exports) {
8404
8380
  args.push('exports');
8405
- passedArgs.push(exportsName);
8381
+ passedArgs.push(uses.module ? `${moduleName}.exports` : exportsName);
8406
8382
  }
8407
8383
  magicString
8408
8384
  .trim()
8409
8385
  .indent('\t', { exclude: indentExclusionRanges })
8410
8386
  .prepend(`(function (${args.join(', ')}) {\n`)
8411
- .append(`\n} (${passedArgs.join(', ')}));`);
8387
+ // For some reason, this line is only indented correctly when using a
8388
+ // require-wrapper if we have this leading space
8389
+ .append(` \n} (${passedArgs.join(', ')}));`);
8412
8390
  }
8413
8391
 
8414
8392
  function rewriteExportsAndGetExportsBlock(
8415
8393
  magicString,
8416
8394
  moduleName,
8417
8395
  exportsName,
8396
+ exportedExportsName,
8418
8397
  wrapped,
8419
8398
  moduleExportsAssignments,
8420
8399
  firstTopLevelModuleExportsAssignment,
@@ -8425,7 +8404,6 @@ function rewriteExportsAndGetExportsBlock(
8425
8404
  code,
8426
8405
  HELPERS_NAME,
8427
8406
  exportMode,
8428
- detectWrappedDefault,
8429
8407
  defaultIsModuleExports,
8430
8408
  usesRequireWrapper,
8431
8409
  requireName
@@ -8453,17 +8431,20 @@ function rewriteExportsAndGetExportsBlock(
8453
8431
  exportDeclarations,
8454
8432
  moduleExportsAssignments,
8455
8433
  firstTopLevelModuleExportsAssignment,
8456
- exportsName
8434
+ exportsName,
8435
+ defaultIsModuleExports,
8436
+ HELPERS_NAME
8457
8437
  );
8458
8438
  } else {
8459
- exports.push(`${exportsName} as __moduleExports`);
8439
+ if (exportMode === 'module') {
8440
+ exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`);
8441
+ exports.push(`${exportedExportsName} as __moduleExports`);
8442
+ } else {
8443
+ exports.push(`${exportsName} as __moduleExports`);
8444
+ }
8460
8445
  if (wrapped) {
8461
- getExportsWhenWrapping(
8462
- exportDeclarations,
8463
- exportsName,
8464
- detectWrappedDefault,
8465
- HELPERS_NAME,
8466
- defaultIsModuleExports
8446
+ exportDeclarations.push(
8447
+ getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)
8467
8448
  );
8468
8449
  } else {
8469
8450
  getExports(
@@ -8476,17 +8457,19 @@ function rewriteExportsAndGetExportsBlock(
8476
8457
  topLevelAssignments,
8477
8458
  moduleName,
8478
8459
  exportsName,
8460
+ exportedExportsName,
8479
8461
  defineCompiledEsmExpressions,
8480
8462
  HELPERS_NAME,
8481
- defaultIsModuleExports
8463
+ defaultIsModuleExports,
8464
+ exportMode
8482
8465
  );
8483
8466
  }
8484
8467
  }
8485
8468
  if (exports.length) {
8486
- exportDeclarations.push(`export { ${exports.join(', ')} };`);
8469
+ exportDeclarations.push(`export { ${exports.join(', ')} }`);
8487
8470
  }
8488
8471
 
8489
- return `\n\n${exportDeclarations.join('\n')}`;
8472
+ return `\n\n${exportDeclarations.join(';\n')};`;
8490
8473
  }
8491
8474
 
8492
8475
  function getExportsWhenUsingRequireWrapper(
@@ -8501,35 +8484,32 @@ function getExportsWhenUsingRequireWrapper(
8501
8484
  requireName,
8502
8485
  defineCompiledEsmExpressions
8503
8486
  ) {
8504
- if (!wrapped) {
8505
- if (exportMode === 'replace') {
8506
- for (const { left } of moduleExportsAssignments) {
8507
- magicString.overwrite(left.start, left.end, exportsName);
8508
- }
8509
- } else {
8510
- // Collect and rewrite module.exports assignments
8511
- for (const { left } of moduleExportsAssignments) {
8512
- magicString.overwrite(left.start, left.end, `${moduleName}.exports`);
8513
- }
8514
- // Collect and rewrite named exports
8515
- for (const [exportName, { nodes }] of exportsAssignmentsByName) {
8516
- for (const node of nodes) {
8517
- magicString.overwrite(node.start, node.left.end, `${exportsName}.${exportName}`);
8518
- }
8519
- }
8520
- // Collect and rewrite exports.__esModule assignments
8521
- for (const expression of defineCompiledEsmExpressions) {
8522
- const moduleExportsExpression =
8523
- expression.type === 'CallExpression' ? expression.arguments[0] : expression.left.object;
8487
+ exports.push(`${requireName} as __require`);
8488
+ if (wrapped) return;
8489
+ if (exportMode === 'replace') {
8490
+ rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName);
8491
+ } else {
8492
+ rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, `${moduleName}.exports`);
8493
+ // Collect and rewrite named exports
8494
+ for (const [exportName, { nodes }] of exportsAssignmentsByName) {
8495
+ for (const { node, type } of nodes) {
8524
8496
  magicString.overwrite(
8525
- moduleExportsExpression.start,
8526
- moduleExportsExpression.end,
8527
- exportsName
8497
+ node.start,
8498
+ node.left.end,
8499
+ `${
8500
+ exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
8501
+ }.${exportName}`
8528
8502
  );
8529
8503
  }
8530
8504
  }
8505
+ replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
8506
+ defineCompiledEsmExpressions,
8507
+ magicString,
8508
+ exportMode,
8509
+ moduleName,
8510
+ exportsName
8511
+ );
8531
8512
  }
8532
- exports.push(`${requireName} as __require`);
8533
8513
  }
8534
8514
 
8535
8515
  function getExportsForReplacedModuleExports(
@@ -8538,34 +8518,30 @@ function getExportsForReplacedModuleExports(
8538
8518
  exportDeclarations,
8539
8519
  moduleExportsAssignments,
8540
8520
  firstTopLevelModuleExportsAssignment,
8541
- exportsName
8521
+ exportsName,
8522
+ defaultIsModuleExports,
8523
+ HELPERS_NAME
8542
8524
  ) {
8543
8525
  for (const { left } of moduleExportsAssignments) {
8544
8526
  magicString.overwrite(left.start, left.end, exportsName);
8545
8527
  }
8546
8528
  magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, 'var ');
8547
8529
  exports.push(`${exportsName} as __moduleExports`);
8548
- exportDeclarations.push(`export default ${exportsName};`);
8549
- }
8550
-
8551
- function getExportsWhenWrapping(
8552
- exportDeclarations,
8553
- exportsName,
8554
- detectWrappedDefault,
8555
- HELPERS_NAME,
8556
- defaultIsModuleExports
8557
- ) {
8558
8530
  exportDeclarations.push(
8559
- `export default ${
8560
- detectWrappedDefault && defaultIsModuleExports === 'auto'
8561
- ? `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportsName})`
8562
- : defaultIsModuleExports === false
8563
- ? `${exportsName}.default`
8564
- : exportsName
8565
- };`
8531
+ getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME)
8566
8532
  );
8567
8533
  }
8568
8534
 
8535
+ function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) {
8536
+ return `export default ${
8537
+ defaultIsModuleExports === true
8538
+ ? exportedExportsName
8539
+ : defaultIsModuleExports === false
8540
+ ? `${exportedExportsName}.default`
8541
+ : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})`
8542
+ }`;
8543
+ }
8544
+
8569
8545
  function getExports(
8570
8546
  magicString,
8571
8547
  exports,
@@ -8576,9 +8552,11 @@ function getExports(
8576
8552
  topLevelAssignments,
8577
8553
  moduleName,
8578
8554
  exportsName,
8555
+ exportedExportsName,
8579
8556
  defineCompiledEsmExpressions,
8580
8557
  HELPERS_NAME,
8581
- defaultIsModuleExports
8558
+ defaultIsModuleExports,
8559
+ exportMode
8582
8560
  ) {
8583
8561
  let deconflictedDefaultExportName;
8584
8562
  // Collect and rewrite module.exports assignments
@@ -8590,8 +8568,10 @@ function getExports(
8590
8568
  for (const [exportName, { nodes }] of exportsAssignmentsByName) {
8591
8569
  const deconflicted = deconflictedExportNames[exportName];
8592
8570
  let needsDeclaration = true;
8593
- for (const node of nodes) {
8594
- let replacement = `${deconflicted} = ${exportsName}.${exportName}`;
8571
+ for (const { node, type } of nodes) {
8572
+ let replacement = `${deconflicted} = ${
8573
+ exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
8574
+ }.${exportName}`;
8595
8575
  if (needsDeclaration && topLevelAssignments.has(node)) {
8596
8576
  replacement = `var ${replacement}`;
8597
8577
  needsDeclaration = false;
@@ -8609,26 +8589,62 @@ function getExports(
8609
8589
  }
8610
8590
  }
8611
8591
 
8612
- // Collect and rewrite exports.__esModule assignments
8613
- let isRestorableCompiledEsm = false;
8614
- for (const expression of defineCompiledEsmExpressions) {
8615
- isRestorableCompiledEsm = true;
8616
- const moduleExportsExpression =
8617
- expression.type === 'CallExpression' ? expression.arguments[0] : expression.left.object;
8618
- magicString.overwrite(moduleExportsExpression.start, moduleExportsExpression.end, exportsName);
8619
- }
8592
+ const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
8593
+ defineCompiledEsmExpressions,
8594
+ magicString,
8595
+ exportMode,
8596
+ moduleName,
8597
+ exportsName
8598
+ );
8620
8599
 
8621
- if (!isRestorableCompiledEsm || defaultIsModuleExports === true) {
8622
- exports.push(`${exportsName} as default`);
8623
- } else if (moduleExportsAssignments.length === 0 || defaultIsModuleExports === false) {
8624
- exports.push(`${deconflictedDefaultExportName || exportsName} as default`);
8600
+ if (
8601
+ defaultIsModuleExports === false ||
8602
+ (defaultIsModuleExports === 'auto' &&
8603
+ isRestorableCompiledEsm &&
8604
+ moduleExportsAssignments.length === 0)
8605
+ ) {
8606
+ // If there is no deconflictedDefaultExportName, then we use the namespace as
8607
+ // fallback because there can be no "default" property on the namespace
8608
+ exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
8609
+ } else if (
8610
+ defaultIsModuleExports === true ||
8611
+ (!isRestorableCompiledEsm && moduleExportsAssignments.length === 0)
8612
+ ) {
8613
+ exports.push(`${exportedExportsName} as default`);
8625
8614
  } else {
8626
8615
  exportDeclarations.push(
8627
- `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportsName});`
8616
+ getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)
8628
8617
  );
8629
8618
  }
8630
8619
  }
8631
8620
 
8621
+ function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) {
8622
+ for (const { left } of moduleExportsAssignments) {
8623
+ magicString.overwrite(left.start, left.end, exportsName);
8624
+ }
8625
+ }
8626
+
8627
+ function replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
8628
+ defineCompiledEsmExpressions,
8629
+ magicString,
8630
+ exportMode,
8631
+ moduleName,
8632
+ exportsName
8633
+ ) {
8634
+ let isRestorableCompiledEsm = false;
8635
+ for (const { node, type } of defineCompiledEsmExpressions) {
8636
+ isRestorableCompiledEsm = true;
8637
+ const moduleExportsExpression =
8638
+ node.type === 'CallExpression' ? node.arguments[0] : node.left.object;
8639
+ magicString.overwrite(
8640
+ moduleExportsExpression.start,
8641
+ moduleExportsExpression.end,
8642
+ exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
8643
+ );
8644
+ }
8645
+ return isRestorableCompiledEsm;
8646
+ }
8647
+
8632
8648
  function isRequireExpression(node, scope) {
8633
8649
  if (!node) return false;
8634
8650
  if (node.type !== 'CallExpression') return false;
@@ -8717,19 +8733,18 @@ function getRequireHandlers() {
8717
8733
  commonjsMeta
8718
8734
  ) {
8719
8735
  const imports = [];
8720
- imports.push(`import * as ${helpersName} from "${HELPERS_ID}";`);
8736
+ imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`);
8721
8737
  if (dynamicRequireName) {
8722
8738
  imports.push(
8723
8739
  `import { ${
8724
8740
  isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT
8725
- } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}";`
8741
+ } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"`
8726
8742
  );
8727
8743
  }
8728
8744
  if (exportMode === 'module') {
8729
8745
  imports.push(
8730
- `import { __module as ${moduleName}, exports as ${exportsName} } from ${JSON.stringify(
8731
- wrapId$1(id, MODULE_SUFFIX)
8732
- )}`
8746
+ `import { __module as ${moduleName} } from ${JSON.stringify(wrapId$1(id, MODULE_SUFFIX))}`,
8747
+ `var ${exportsName} = ${moduleName}.exports`
8733
8748
  );
8734
8749
  } else if (exportMode === 'exports') {
8735
8750
  imports.push(
@@ -8755,7 +8770,7 @@ function getRequireHandlers() {
8755
8770
  getIgnoreTryCatchRequireStatementMode,
8756
8771
  magicString
8757
8772
  );
8758
- return imports.length ? `${imports.join('\n')}\n\n` : '';
8773
+ return imports.length ? `${imports.join(';\n')};\n\n` : '';
8759
8774
  }
8760
8775
 
8761
8776
  return {
@@ -8815,9 +8830,9 @@ function processRequireExpressions(
8815
8830
  }
8816
8831
  if (needsImport) {
8817
8832
  if (isCommonJS === IS_WRAPPED_COMMONJS) {
8818
- imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)};`);
8833
+ imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)}`);
8819
8834
  } else {
8820
- imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)};`);
8835
+ imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)}`);
8821
8836
  }
8822
8837
  }
8823
8838
  }
@@ -8842,6 +8857,14 @@ const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/
8842
8857
 
8843
8858
  const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
8844
8859
 
8860
+ // There are three different types of CommonJS modules, described by their
8861
+ // "exportMode":
8862
+ // - exports: Only assignments to (module.)exports properties
8863
+ // - replace: A single assignment to module.exports itself
8864
+ // - module: Anything else
8865
+ // Special cases:
8866
+ // - usesRequireWrapper
8867
+ // - isWrapped
8845
8868
  async function transformCommonjs(
8846
8869
  parse,
8847
8870
  code,
@@ -8878,7 +8901,6 @@ async function transformCommonjs(
8878
8901
  let programDepth = 0;
8879
8902
  let currentTryBlockEnd = null;
8880
8903
  let shouldWrap = false;
8881
- let reexports = false;
8882
8904
 
8883
8905
  const globals = new Set();
8884
8906
  // A conditionalNode is a node for which execution is not guaranteed. If such a node is a require
@@ -8952,31 +8974,20 @@ async function transformCommonjs(
8952
8974
  } else if (!firstTopLevelModuleExportsAssignment) {
8953
8975
  firstTopLevelModuleExportsAssignment = node;
8954
8976
  }
8955
-
8956
- if (defaultIsModuleExports === false) {
8957
- shouldWrap = true;
8958
- } else if (defaultIsModuleExports === 'auto') {
8959
- if (node.right.type === 'ObjectExpression') {
8960
- if (hasDefineEsmProperty(node.right)) {
8961
- shouldWrap = true;
8962
- }
8963
- } else if (isRequireExpression(node.right, scope)) {
8964
- shouldWrap = true;
8965
- reexports = true;
8966
- }
8967
- }
8968
8977
  } else if (exportName === KEY_COMPILED_ESM) {
8969
8978
  if (programDepth > 3) {
8970
8979
  shouldWrap = true;
8971
8980
  } else {
8972
- topLevelDefineCompiledEsmExpressions.push(node);
8981
+ // The "type" is either "module" or "exports" to discern
8982
+ // assignments to module.exports vs exports if needed
8983
+ topLevelDefineCompiledEsmExpressions.push({ node, type: flattened.name });
8973
8984
  }
8974
8985
  } else {
8975
8986
  const exportsAssignments = exportsAssignmentsByName.get(exportName) || {
8976
8987
  nodes: [],
8977
8988
  scopes: new Set()
8978
8989
  };
8979
- exportsAssignments.nodes.push(node);
8990
+ exportsAssignments.nodes.push({ node, type: flattened.name });
8980
8991
  exportsAssignments.scopes.add(scope);
8981
8992
  exportsAccessScopes.add(scope);
8982
8993
  exportsAssignmentsByName.set(exportName, exportsAssignments);
@@ -8993,11 +9004,12 @@ async function transformCommonjs(
8993
9004
  }
8994
9005
  return;
8995
9006
  case 'CallExpression': {
8996
- if (isDefineCompiledEsm(node)) {
9007
+ const defineCompiledEsmType = getDefineCompiledEsmType(node);
9008
+ if (defineCompiledEsmType) {
8997
9009
  if (programDepth === 3 && parent.type === 'ExpressionStatement') {
8998
9010
  // skip special handling for [module.]exports until we know we render this
8999
9011
  skippedNodes.add(node.arguments[0]);
9000
- topLevelDefineCompiledEsmExpressions.push(node);
9012
+ topLevelDefineCompiledEsmExpressions.push({ node, type: defineCompiledEsmType });
9001
9013
  } else {
9002
9014
  shouldWrap = true;
9003
9015
  }
@@ -9015,6 +9027,7 @@ async function transformCommonjs(
9015
9027
  uses.require = true;
9016
9028
  const requireNode = node.callee.object;
9017
9029
  replacedDynamicRequires.push(requireNode);
9030
+ skippedNodes.add(node.callee);
9018
9031
  return;
9019
9032
  }
9020
9033
 
@@ -9257,11 +9270,6 @@ async function transformCommonjs(
9257
9270
 
9258
9271
  // We cannot wrap ES/mixed modules
9259
9272
  shouldWrap = !isEsModule && (shouldWrap || (uses.exports && moduleExportsAssignments.length > 0));
9260
- const detectWrappedDefault =
9261
- shouldWrap &&
9262
- (reexports ||
9263
- topLevelDefineCompiledEsmExpressions.length > 0 ||
9264
- code.indexOf('__esModule') >= 0);
9265
9273
 
9266
9274
  if (
9267
9275
  !(
@@ -9299,6 +9307,9 @@ async function transformCommonjs(
9299
9307
  ? 'exports'
9300
9308
  : 'module';
9301
9309
 
9310
+ const exportedExportsName =
9311
+ exportMode === 'module' ? deconflict([], globals, `${nameBase}Exports`) : exportsName;
9312
+
9302
9313
  const importBlock = await rewriteRequireExpressionsAndGetImportBlock(
9303
9314
  magicString,
9304
9315
  topLevelDeclarations,
@@ -9323,6 +9334,7 @@ async function transformCommonjs(
9323
9334
  magicString,
9324
9335
  moduleName,
9325
9336
  exportsName,
9337
+ exportedExportsName,
9326
9338
  shouldWrap,
9327
9339
  moduleExportsAssignments,
9328
9340
  firstTopLevelModuleExportsAssignment,
@@ -9333,7 +9345,6 @@ async function transformCommonjs(
9333
9345
  code,
9334
9346
  helpersName,
9335
9347
  exportMode,
9336
- detectWrappedDefault,
9337
9348
  defaultIsModuleExports,
9338
9349
  usesRequireWrapper,
9339
9350
  requireName
@@ -9347,15 +9358,16 @@ async function transformCommonjs(
9347
9358
  magicString.trim().indent('\t', {
9348
9359
  exclude: indentExclusionRanges
9349
9360
  });
9361
+ const exported = exportMode === 'module' ? `${moduleName}.exports` : exportsName;
9350
9362
  magicString.prepend(
9351
9363
  `var ${isRequiredName};
9352
9364
 
9353
9365
  function ${requireName} () {
9354
- \tif (${isRequiredName}) return ${exportsName};
9366
+ \tif (${isRequiredName}) return ${exported};
9355
9367
  \t${isRequiredName} = 1;
9356
9368
  `
9357
9369
  ).append(`
9358
- \treturn ${exportsName};
9370
+ \treturn ${exported};
9359
9371
  }`);
9360
9372
  if (exportMode === 'replace') {
9361
9373
  magicString.prepend(`var ${exportsName};\n`);
@@ -9585,15 +9597,9 @@ function commonjs(options = {}) {
9585
9597
  }
9586
9598
 
9587
9599
  if (isWrappedId(id, MODULE_SUFFIX)) {
9588
- const module = getName(unwrapId$1(id, MODULE_SUFFIX));
9589
- const moduleExports = `${module}Exports`;
9600
+ const name = getName(unwrapId$1(id, MODULE_SUFFIX));
9590
9601
  return {
9591
- code: `var ${moduleExports} = {};
9592
- var ${module} = {
9593
- get exports(){ return ${moduleExports}; },
9594
- set exports(v){ ${moduleExports} = v; },
9595
- };
9596
- export {${module} as __module, ${moduleExports} as exports}`,
9602
+ code: `var ${name} = {exports: {}}; export {${name} as __module}`,
9597
9603
  meta: { commonjs: { isCommonJS: false } }
9598
9604
  };
9599
9605
  }
@@ -9917,11 +9923,11 @@ function stripFilename(path) {
9917
9923
  return path.slice(0, index + 1);
9918
9924
  }
9919
9925
 
9920
- const COLUMN = 0;
9921
- const SOURCES_INDEX = 1;
9922
- const SOURCE_LINE = 2;
9923
- const SOURCE_COLUMN = 3;
9924
- const NAMES_INDEX = 4;
9926
+ const COLUMN$1 = 0;
9927
+ const SOURCES_INDEX$1 = 1;
9928
+ const SOURCE_LINE$1 = 2;
9929
+ const SOURCE_COLUMN$1 = 3;
9930
+ const NAMES_INDEX$1 = 4;
9925
9931
 
9926
9932
  function maybeSort(mappings, owned) {
9927
9933
  const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
@@ -9945,7 +9951,7 @@ function nextUnsortedSegmentLine(mappings, start) {
9945
9951
  }
9946
9952
  function isSorted(line) {
9947
9953
  for (let j = 1; j < line.length; j++) {
9948
- if (line[j][COLUMN] < line[j - 1][COLUMN]) {
9954
+ if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) {
9949
9955
  return false;
9950
9956
  }
9951
9957
  }
@@ -9957,7 +9963,7 @@ function sortSegments(line, owned) {
9957
9963
  return line.sort(sortComparator);
9958
9964
  }
9959
9965
  function sortComparator(a, b) {
9960
- return a[COLUMN] - b[COLUMN];
9966
+ return a[COLUMN$1] - b[COLUMN$1];
9961
9967
  }
9962
9968
 
9963
9969
  let found = false;
@@ -9980,7 +9986,7 @@ let found = false;
9980
9986
  function binarySearch(haystack, needle, low, high) {
9981
9987
  while (low <= high) {
9982
9988
  const mid = low + ((high - low) >> 1);
9983
- const cmp = haystack[mid][COLUMN] - needle;
9989
+ const cmp = haystack[mid][COLUMN$1] - needle;
9984
9990
  if (cmp === 0) {
9985
9991
  found = true;
9986
9992
  return mid;
@@ -9997,14 +10003,14 @@ function binarySearch(haystack, needle, low, high) {
9997
10003
  }
9998
10004
  function upperBound(haystack, needle, index) {
9999
10005
  for (let i = index + 1; i < haystack.length; index = i++) {
10000
- if (haystack[i][COLUMN] !== needle)
10006
+ if (haystack[i][COLUMN$1] !== needle)
10001
10007
  break;
10002
10008
  }
10003
10009
  return index;
10004
10010
  }
10005
10011
  function lowerBound(haystack, needle, index) {
10006
10012
  for (let i = index - 1; i >= 0; index = i--) {
10007
- if (haystack[i][COLUMN] !== needle)
10013
+ if (haystack[i][COLUMN$1] !== needle)
10008
10014
  break;
10009
10015
  }
10010
10016
  return index;
@@ -10026,7 +10032,7 @@ function memoizedBinarySearch(haystack, needle, state, key) {
10026
10032
  let high = haystack.length - 1;
10027
10033
  if (key === lastKey) {
10028
10034
  if (needle === lastNeedle) {
10029
- found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
10035
+ found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
10030
10036
  return lastIndex;
10031
10037
  }
10032
10038
  if (needle >= lastNeedle) {
@@ -10123,7 +10129,7 @@ class TraceMap {
10123
10129
  if (segment.length === 1)
10124
10130
  return OMapping(null, null, null, null);
10125
10131
  const { names, resolvedSources } = map;
10126
- return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
10132
+ return OMapping(resolvedSources[segment[SOURCES_INDEX$1]], segment[SOURCE_LINE$1] + 1, segment[SOURCE_COLUMN$1], segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null);
10127
10133
  };
10128
10134
  })();
10129
10135
  function OMapping(source, line, column, name) {
@@ -10176,11 +10182,19 @@ class SetArray {
10176
10182
  };
10177
10183
  })();
10178
10184
 
10185
+ const COLUMN = 0;
10186
+ const SOURCES_INDEX = 1;
10187
+ const SOURCE_LINE = 2;
10188
+ const SOURCE_COLUMN = 3;
10189
+ const NAMES_INDEX = 4;
10190
+
10191
+ const NO_NAME = -1;
10179
10192
  /**
10180
- * A low-level API to associate a generated position with an original source position. Line and
10181
- * column here are 0-based, unlike `addMapping`.
10193
+ * Same as `addSegment`, but will only add the segment if it generates useful information in the
10194
+ * resulting map. This only works correctly if segments are added **in order**, meaning you should
10195
+ * not add a segment with a lower generated line/column than one that came before.
10182
10196
  */
10183
- let addSegment;
10197
+ let maybeAddSegment;
10184
10198
  /**
10185
10199
  * Adds/removes the content of the source file to the source map.
10186
10200
  */
@@ -10189,12 +10203,14 @@ let setSourceContent;
10189
10203
  * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
10190
10204
  * a sourcemap, or to JSON.stringify.
10191
10205
  */
10192
- let decodedMap;
10206
+ let toDecodedMap;
10193
10207
  /**
10194
10208
  * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
10195
10209
  * a sourcemap, or to JSON.stringify.
10196
10210
  */
10197
- let encodedMap;
10211
+ let toEncodedMap;
10212
+ // This split declaration is only so that terser can elminiate the static initialization block.
10213
+ let addSegmentInternal;
10198
10214
  /**
10199
10215
  * Provides the state to generate a sourcemap.
10200
10216
  */
@@ -10209,32 +10225,19 @@ class GenMapping {
10209
10225
  }
10210
10226
  }
10211
10227
  (() => {
10212
- addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {
10213
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
10214
- const line = getLine(mappings, genLine);
10215
- if (source == null) {
10216
- const seg = [genColumn];
10217
- const index = getColumnIndex(line, genColumn, seg);
10218
- return insert(line, index, seg);
10219
- }
10220
- const sourcesIndex = put(sources, source);
10221
- const seg = name
10222
- ? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)]
10223
- : [genColumn, sourcesIndex, sourceLine, sourceColumn];
10224
- const index = getColumnIndex(line, genColumn, seg);
10225
- if (sourcesIndex === sourcesContent.length)
10226
- sourcesContent[sourcesIndex] = null;
10227
- insert(line, index, seg);
10228
+ maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
10229
+ return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
10228
10230
  };
10229
10231
  setSourceContent = (map, source, content) => {
10230
10232
  const { _sources: sources, _sourcesContent: sourcesContent } = map;
10231
10233
  sourcesContent[put(sources, source)] = content;
10232
10234
  };
10233
- decodedMap = (map) => {
10235
+ toDecodedMap = (map) => {
10234
10236
  const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
10237
+ removeEmptyFinalLines(mappings);
10235
10238
  return {
10236
10239
  version: 3,
10237
- file,
10240
+ file: file || undefined,
10238
10241
  names: names.array,
10239
10242
  sourceRoot: sourceRoot || undefined,
10240
10243
  sources: sources.array,
@@ -10242,10 +10245,31 @@ class GenMapping {
10242
10245
  mappings,
10243
10246
  };
10244
10247
  };
10245
- encodedMap = (map) => {
10246
- const decoded = decodedMap(map);
10248
+ toEncodedMap = (map) => {
10249
+ const decoded = toDecodedMap(map);
10247
10250
  return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) });
10248
10251
  };
10252
+ // Internal helpers
10253
+ addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
10254
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;
10255
+ const line = getLine(mappings, genLine);
10256
+ const index = getColumnIndex(line, genColumn);
10257
+ if (!source) {
10258
+ if (skipable && skipSourceless(line, index))
10259
+ return;
10260
+ return insert(line, index, [genColumn]);
10261
+ }
10262
+ const sourcesIndex = put(sources, source);
10263
+ const namesIndex = name ? put(names, name) : NO_NAME;
10264
+ if (sourcesIndex === sourcesContent.length)
10265
+ sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
10266
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
10267
+ return;
10268
+ }
10269
+ return insert(line, index, name
10270
+ ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
10271
+ : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
10272
+ };
10249
10273
  })();
10250
10274
  function getLine(mappings, index) {
10251
10275
  for (let i = mappings.length; i <= index; i++) {
@@ -10253,63 +10277,63 @@ function getLine(mappings, index) {
10253
10277
  }
10254
10278
  return mappings[index];
10255
10279
  }
10256
- function getColumnIndex(line, column, seg) {
10280
+ function getColumnIndex(line, genColumn) {
10257
10281
  let index = line.length;
10258
- for (let i = index - 1; i >= 0; i--, index--) {
10282
+ for (let i = index - 1; i >= 0; index = i--) {
10259
10283
  const current = line[i];
10260
- const col = current[0];
10261
- if (col > column)
10262
- continue;
10263
- if (col < column)
10264
- break;
10265
- const cmp = compare$1(current, seg);
10266
- if (cmp === 0)
10267
- return index;
10268
- if (cmp < 0)
10284
+ if (genColumn >= current[COLUMN])
10269
10285
  break;
10270
10286
  }
10271
10287
  return index;
10272
10288
  }
10273
- function compare$1(a, b) {
10274
- let cmp = compareNum(a.length, b.length);
10275
- if (cmp !== 0)
10276
- return cmp;
10277
- // We've already checked genColumn
10278
- if (a.length === 1)
10279
- return 0;
10280
- cmp = compareNum(a[1], b[1]);
10281
- if (cmp !== 0)
10282
- return cmp;
10283
- cmp = compareNum(a[2], b[2]);
10284
- if (cmp !== 0)
10285
- return cmp;
10286
- cmp = compareNum(a[3], b[3]);
10287
- if (cmp !== 0)
10288
- return cmp;
10289
- if (a.length === 4)
10290
- return 0;
10291
- return compareNum(a[4], b[4]);
10292
- }
10293
- function compareNum(a, b) {
10294
- return a - b;
10295
- }
10296
10289
  function insert(array, index, value) {
10297
- if (index === -1)
10298
- return;
10299
10290
  for (let i = array.length; i > index; i--) {
10300
10291
  array[i] = array[i - 1];
10301
10292
  }
10302
10293
  array[index] = value;
10303
10294
  }
10295
+ function removeEmptyFinalLines(mappings) {
10296
+ const { length } = mappings;
10297
+ let len = length;
10298
+ for (let i = len - 1; i >= 0; len = i, i--) {
10299
+ if (mappings[i].length > 0)
10300
+ break;
10301
+ }
10302
+ if (len < length)
10303
+ mappings.length = len;
10304
+ }
10305
+ function skipSourceless(line, index) {
10306
+ // The start of a line is already sourceless, so adding a sourceless segment to the beginning
10307
+ // doesn't generate any useful information.
10308
+ if (index === 0)
10309
+ return true;
10310
+ const prev = line[index - 1];
10311
+ // If the previous segment is also sourceless, then adding another sourceless segment doesn't
10312
+ // genrate any new information. Else, this segment will end the source/named segment and point to
10313
+ // a sourceless position, which is useful.
10314
+ return prev.length === 1;
10315
+ }
10316
+ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
10317
+ // A source/named segment at the start of a line gives position at that genColumn
10318
+ if (index === 0)
10319
+ return false;
10320
+ const prev = line[index - 1];
10321
+ // If the previous segment is sourceless, then we're transitioning to a source.
10322
+ if (prev.length === 1)
10323
+ return false;
10324
+ // If the previous segment maps to the exact same source position, then this segment doesn't
10325
+ // provide any new position information.
10326
+ return (sourcesIndex === prev[SOURCES_INDEX] &&
10327
+ sourceLine === prev[SOURCE_LINE] &&
10328
+ sourceColumn === prev[SOURCE_COLUMN] &&
10329
+ namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
10330
+ }
10304
10331
 
10305
- const SOURCELESS_MAPPING = {
10306
- source: null,
10307
- column: null,
10308
- line: null,
10309
- name: null,
10310
- content: null,
10311
- };
10332
+ const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null);
10312
10333
  const EMPTY_SOURCES = [];
10334
+ function SegmentObject(source, line, column, name, content) {
10335
+ return { source, line, column, name, content };
10336
+ }
10313
10337
  function Source(map, sources, source, content) {
10314
10338
  return {
10315
10339
  map,
@@ -10337,15 +10361,14 @@ function OriginalSource(source, content) {
10337
10361
  * resolving each mapping in terms of the original source files.
10338
10362
  */
10339
10363
  function traceMappings(tree) {
10364
+ // TODO: Eventually support sourceRoot, which has to be removed because the sources are already
10365
+ // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
10340
10366
  const gen = new GenMapping({ file: tree.map.file });
10341
10367
  const { sources: rootSources, map } = tree;
10342
10368
  const rootNames = map.names;
10343
10369
  const rootMappings = decodedMappings(map);
10344
10370
  for (let i = 0; i < rootMappings.length; i++) {
10345
10371
  const segments = rootMappings[i];
10346
- let lastSource = null;
10347
- let lastSourceLine = null;
10348
- let lastSourceColumn = null;
10349
10372
  for (let j = 0; j < segments.length; j++) {
10350
10373
  const segment = segments[j];
10351
10374
  const genCol = segment[0];
@@ -10360,18 +10383,9 @@ function traceMappings(tree) {
10360
10383
  if (traced == null)
10361
10384
  continue;
10362
10385
  }
10363
- // So we traced a segment down into its original source file. Now push a
10364
- // new segment pointing to this location.
10365
10386
  const { column, line, name, content, source } = traced;
10366
- if (line === lastSourceLine && column === lastSourceColumn && source === lastSource) {
10367
- continue;
10368
- }
10369
- lastSourceLine = line;
10370
- lastSourceColumn = column;
10371
- lastSource = source;
10372
- // Sigh, TypeScript can't figure out source/line/column are either all null, or all non-null...
10373
- addSegment(gen, i, genCol, source, line, column, name);
10374
- if (content != null)
10387
+ maybeAddSegment(gen, i, genCol, source, line, column, name);
10388
+ if (source && content != null)
10375
10389
  setSourceContent(gen, source, content);
10376
10390
  }
10377
10391
  }
@@ -10383,7 +10397,7 @@ function traceMappings(tree) {
10383
10397
  */
10384
10398
  function originalPositionFor(source, line, column, name) {
10385
10399
  if (!source.map) {
10386
- return { column, line, name, source: source.source, content: source.content };
10400
+ return SegmentObject(source.source, line, column, name, source.content);
10387
10401
  }
10388
10402
  const segment = traceSegment(source.map, line, column);
10389
10403
  // If we couldn't find a segment, then this doesn't exist in the sourcemap.
@@ -10464,7 +10478,7 @@ function build$2(map, loader, importer, importerDepth) {
10464
10478
  */
10465
10479
  let SourceMap$1 = class SourceMap {
10466
10480
  constructor(map, options) {
10467
- const out = options.decodedMappings ? decodedMap(map) : encodedMap(map);
10481
+ const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
10468
10482
  this.version = out.version; // SourceMap spec says this should be first.
10469
10483
  this.file = out.file;
10470
10484
  this.mappings = out.mappings;
@@ -10501,17 +10515,9 @@ function remapping(input, loader, options) {
10501
10515
  return new SourceMap$1(traceMappings(tree), opts);
10502
10516
  }
10503
10517
 
10504
- var srcExports$1 = {};
10505
- var src$2 = {
10506
- get exports(){ return srcExports$1; },
10507
- set exports(v){ srcExports$1 = v; },
10508
- };
10518
+ var src$2 = {exports: {}};
10509
10519
 
10510
- var browserExports$1 = {};
10511
- var browser$2 = {
10512
- get exports(){ return browserExports$1; },
10513
- set exports(v){ browserExports$1 = v; },
10514
- };
10520
+ var browser$2 = {exports: {}};
10515
10521
 
10516
10522
  /**
10517
10523
  * Helpers.
@@ -10971,7 +10977,7 @@ function requireCommon () {
10971
10977
  var hasRequiredBrowser$1;
10972
10978
 
10973
10979
  function requireBrowser$1 () {
10974
- if (hasRequiredBrowser$1) return browserExports$1;
10980
+ if (hasRequiredBrowser$1) return browser$2.exports;
10975
10981
  hasRequiredBrowser$1 = 1;
10976
10982
  (function (module, exports) {
10977
10983
  /**
@@ -11240,16 +11246,12 @@ function requireBrowser$1 () {
11240
11246
  } catch (error) {
11241
11247
  return '[UnexpectedJSONParseError]: ' + error.message;
11242
11248
  }
11243
- };
11244
- } (browser$2, browserExports$1));
11245
- return browserExports$1;
11249
+ };
11250
+ } (browser$2, browser$2.exports));
11251
+ return browser$2.exports;
11246
11252
  }
11247
11253
 
11248
- var nodeExports$1 = {};
11249
- var node$1 = {
11250
- get exports(){ return nodeExports$1; },
11251
- set exports(v){ nodeExports$1 = v; },
11252
- };
11254
+ var node$1 = {exports: {}};
11253
11255
 
11254
11256
  /**
11255
11257
  * Module dependencies.
@@ -11258,7 +11260,7 @@ var node$1 = {
11258
11260
  var hasRequiredNode$1;
11259
11261
 
11260
11262
  function requireNode$1 () {
11261
- if (hasRequiredNode$1) return nodeExports$1;
11263
+ if (hasRequiredNode$1) return node$1.exports;
11262
11264
  hasRequiredNode$1 = 1;
11263
11265
  (function (module, exports) {
11264
11266
  const tty = require$$0$3;
@@ -11519,9 +11521,9 @@ function requireNode$1 () {
11519
11521
  formatters.O = function (v) {
11520
11522
  this.inspectOpts.colors = this.useColors;
11521
11523
  return util.inspect(v, this.inspectOpts);
11522
- };
11523
- } (node$1, nodeExports$1));
11524
- return nodeExports$1;
11524
+ };
11525
+ } (node$1, node$1.exports));
11526
+ return node$1.exports;
11525
11527
  }
11526
11528
 
11527
11529
  /**
@@ -11529,14 +11531,13 @@ function requireNode$1 () {
11529
11531
  * treat as a browser.
11530
11532
  */
11531
11533
 
11532
- (function (module) {
11533
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
11534
- module.exports = requireBrowser$1();
11535
- } else {
11536
- module.exports = requireNode$1();
11537
- }
11538
- } (src$2));
11534
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
11535
+ src$2.exports = requireBrowser$1();
11536
+ } else {
11537
+ src$2.exports = requireNode$1();
11538
+ }
11539
11539
 
11540
+ var srcExports$1 = src$2.exports;
11540
11541
  var debug$g = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1);
11541
11542
 
11542
11543
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
@@ -12001,13 +12002,13 @@ function timeFrom(start, subtract = 0) {
12001
12002
  const time = performance$1.now() - start - subtract;
12002
12003
  const timeString = (time.toFixed(2) + `ms`).padEnd(5, ' ');
12003
12004
  if (time < 10) {
12004
- return picocolorsExports.green(timeString);
12005
+ return colors$1.green(timeString);
12005
12006
  }
12006
12007
  else if (time < 50) {
12007
- return picocolorsExports.yellow(timeString);
12008
+ return colors$1.yellow(timeString);
12008
12009
  }
12009
12010
  else {
12010
- return picocolorsExports.red(timeString);
12011
+ return colors$1.red(timeString);
12011
12012
  }
12012
12013
  }
12013
12014
  /**
@@ -12018,10 +12019,10 @@ function prettifyUrl(url, root) {
12018
12019
  const isAbsoluteFile = url.startsWith(root);
12019
12020
  if (isAbsoluteFile || url.startsWith(FS_PREFIX)) {
12020
12021
  const file = path$o.relative(root, isAbsoluteFile ? url : fsPathFromId(url));
12021
- return picocolorsExports.dim(file);
12022
+ return colors$1.dim(file);
12022
12023
  }
12023
12024
  else {
12024
- return picocolorsExports.dim(url);
12025
+ return colors$1.dim(url);
12025
12026
  }
12026
12027
  }
12027
12028
  function isObject$2(value) {
@@ -12214,7 +12215,7 @@ function windowsMappedRealpathSync(path) {
12214
12215
  }
12215
12216
  return realPath;
12216
12217
  }
12217
- const parseNetUseRE = /^(\w+) +(\w:) +([^ ]+)\s/;
12218
+ const parseNetUseRE = /^(\w+)? +(\w:) +([^ ]+)\s/;
12218
12219
  let firstSafeRealPathSyncRun = false;
12219
12220
  function windowsSafeRealPathSync(path) {
12220
12221
  if (!firstSafeRealPathSyncRun) {
@@ -12224,6 +12225,12 @@ function windowsSafeRealPathSync(path) {
12224
12225
  return fs$l.realpathSync(path);
12225
12226
  }
12226
12227
  function optimizeSafeRealPathSync() {
12228
+ // Skip if using Node <16.18 due to MAX_PATH issue: https://github.com/vitejs/vite/issues/12931
12229
+ const nodeVersion = process.versions.node.split('.').map(Number);
12230
+ if (nodeVersion[0] < 16 || (nodeVersion[0] === 16 && nodeVersion[1] < 18)) {
12231
+ safeRealpathSync = fs$l.realpathSync;
12232
+ return;
12233
+ }
12227
12234
  exec('net use', (error, stdout) => {
12228
12235
  if (error)
12229
12236
  return;
@@ -12735,11 +12742,11 @@ function createLogger(level = 'info', options = {}) {
12735
12742
  const format = () => {
12736
12743
  if (options.timestamp) {
12737
12744
  const tag = type === 'info'
12738
- ? picocolorsExports.cyan(picocolorsExports.bold(prefix))
12745
+ ? colors$1.cyan(colors$1.bold(prefix))
12739
12746
  : type === 'warn'
12740
- ? picocolorsExports.yellow(picocolorsExports.bold(prefix))
12741
- : picocolorsExports.red(picocolorsExports.bold(prefix));
12742
- return `${picocolorsExports.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
12747
+ ? colors$1.yellow(colors$1.bold(prefix))
12748
+ : colors$1.red(colors$1.bold(prefix));
12749
+ return `${colors$1.dim(new Date().toLocaleTimeString())} ${tag} ${msg}`;
12743
12750
  }
12744
12751
  else {
12745
12752
  return msg;
@@ -12752,7 +12759,7 @@ function createLogger(level = 'info', options = {}) {
12752
12759
  if (type === lastType && msg === lastMsg) {
12753
12760
  sameCount++;
12754
12761
  clear();
12755
- console[method](format(), picocolorsExports.yellow(`(x${sameCount + 1})`));
12762
+ console[method](format(), colors$1.yellow(`(x${sameCount + 1})`));
12756
12763
  }
12757
12764
  else {
12758
12765
  sameCount = 0;
@@ -12802,24 +12809,24 @@ function createLogger(level = 'info', options = {}) {
12802
12809
  return logger;
12803
12810
  }
12804
12811
  function printServerUrls(urls, optionsHost, info) {
12805
- const colorUrl = (url) => picocolorsExports.cyan(url.replace(/:(\d+)\//, (_, port) => `:${picocolorsExports.bold(port)}/`));
12812
+ const colorUrl = (url) => colors$1.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors$1.bold(port)}/`));
12806
12813
  for (const url of urls.local) {
12807
- info(` ${picocolorsExports.green('➜')} ${picocolorsExports.bold('Local')}: ${colorUrl(url)}`);
12814
+ info(` ${colors$1.green('➜')} ${colors$1.bold('Local')}: ${colorUrl(url)}`);
12808
12815
  }
12809
12816
  for (const url of urls.network) {
12810
- info(` ${picocolorsExports.green('➜')} ${picocolorsExports.bold('Network')}: ${colorUrl(url)}`);
12817
+ info(` ${colors$1.green('➜')} ${colors$1.bold('Network')}: ${colorUrl(url)}`);
12811
12818
  }
12812
12819
  if (urls.network.length === 0 && optionsHost === undefined) {
12813
- info(picocolorsExports.dim(` ${picocolorsExports.green('➜')} ${picocolorsExports.bold('Network')}: use `) +
12814
- picocolorsExports.bold('--host') +
12815
- picocolorsExports.dim(' to expose'));
12820
+ info(colors$1.dim(` ${colors$1.green('➜')} ${colors$1.bold('Network')}: use `) +
12821
+ colors$1.bold('--host') +
12822
+ colors$1.dim(' to expose'));
12816
12823
  }
12817
12824
  }
12818
12825
 
12819
12826
  const groups = [
12820
- { name: 'Assets', color: picocolorsExports.green },
12821
- { name: 'CSS', color: picocolorsExports.magenta },
12822
- { name: 'JS', color: picocolorsExports.cyan },
12827
+ { name: 'Assets', color: colors$1.green },
12828
+ { name: 'CSS', color: colors$1.magenta },
12829
+ { name: 'JS', color: colors$1.cyan },
12823
12830
  ];
12824
12831
  const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml)$/;
12825
12832
  function buildReporterPlugin(config) {
@@ -12855,7 +12862,7 @@ function buildReporterPlugin(config) {
12855
12862
  return compressed.length;
12856
12863
  }
12857
12864
  const logTransform = throttle((id) => {
12858
- writeLine(`transforming (${transformedCount}) ${picocolorsExports.dim(path$o.relative(config.root, id))}`);
12865
+ writeLine(`transforming (${transformedCount}) ${colors$1.dim(path$o.relative(config.root, id))}`);
12859
12866
  });
12860
12867
  return {
12861
12868
  name: 'vite:reporter',
@@ -12888,7 +12895,7 @@ function buildReporterPlugin(config) {
12888
12895
  process.stdout.clearLine(0);
12889
12896
  process.stdout.cursorTo(0);
12890
12897
  }
12891
- config.logger.info(`${picocolorsExports.green(`✓`)} ${transformedCount} modules transformed.`);
12898
+ config.logger.info(`${colors$1.green(`✓`)} ${transformedCount} modules transformed.`);
12892
12899
  }
12893
12900
  },
12894
12901
  renderStart() {
@@ -12975,21 +12982,21 @@ function buildReporterPlugin(config) {
12975
12982
  const isLarge = group.name === 'JS' && entry.size / 1000 > chunkLimit;
12976
12983
  if (isLarge)
12977
12984
  hasLargeChunks = true;
12978
- const sizeColor = isLarge ? picocolorsExports.yellow : picocolorsExports.dim;
12979
- let log = picocolorsExports.dim(relativeOutDir + '/');
12985
+ const sizeColor = isLarge ? colors$1.yellow : colors$1.dim;
12986
+ let log = colors$1.dim(relativeOutDir + '/');
12980
12987
  log +=
12981
12988
  !config.build.lib && entry.name.startsWith(assetsDir)
12982
- ? picocolorsExports.dim(assetsDir) +
12989
+ ? colors$1.dim(assetsDir) +
12983
12990
  group.color(entry.name
12984
12991
  .slice(assetsDir.length)
12985
12992
  .padEnd(longest + 2 - assetsDir.length))
12986
12993
  : group.color(entry.name.padEnd(longest + 2));
12987
- log += picocolorsExports.bold(sizeColor(displaySize(entry.size).padStart(sizePad)));
12994
+ log += colors$1.bold(sizeColor(displaySize(entry.size).padStart(sizePad)));
12988
12995
  if (entry.compressedSize) {
12989
- log += picocolorsExports.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`);
12996
+ log += colors$1.dim(` │ gzip: ${displaySize(entry.compressedSize).padStart(compressPad)}`);
12990
12997
  }
12991
12998
  if (entry.mapSize) {
12992
- log += picocolorsExports.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`);
12999
+ log += colors$1.dim(` │ map: ${displaySize(entry.mapSize).padStart(mapPad)}`);
12993
13000
  }
12994
13001
  config.logger.info(log);
12995
13002
  }
@@ -13004,7 +13011,7 @@ function buildReporterPlugin(config) {
13004
13011
  config.build.minify &&
13005
13012
  !config.build.lib &&
13006
13013
  !config.build.ssr) {
13007
- config.logger.warn(picocolorsExports.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kBs after minification. Consider:\n` +
13014
+ config.logger.warn(colors$1.yellow(`\n(!) Some chunks are larger than ${chunkLimit} kBs after minification. Consider:\n` +
13008
13015
  `- Using dynamic import() to code-split the application\n` +
13009
13016
  `- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\n` +
13010
13017
  `- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`));
@@ -13012,7 +13019,7 @@ function buildReporterPlugin(config) {
13012
13019
  },
13013
13020
  closeBundle() {
13014
13021
  if (shouldLogInfo && !config.build.watch) {
13015
- config.logger.info(`${picocolorsExports.green(`✓`)} built in ${displayTime(Date.now() - startTime)}`);
13022
+ config.logger.info(`${colors$1.green(`✓ built in ${displayTime(Date.now() - startTime)}`)}`);
13016
13023
  }
13017
13024
  },
13018
13025
  };
@@ -14004,7 +14011,7 @@ function resolveEsbuildTranspileOptions(config, format) {
14004
14011
  }
14005
14012
  }
14006
14013
  function prettifyMessage(m, code) {
14007
- let res = picocolorsExports.yellow(m.text);
14014
+ let res = colors$1.yellow(m.text);
14008
14015
  if (m.location) {
14009
14016
  const lines = code.split(/\r?\n/g);
14010
14017
  const line = Number(m.location.line);
@@ -14043,7 +14050,7 @@ async function initTSConfckParseOptions(workspaceRoot) {
14043
14050
  })),
14044
14051
  resolveWithEmptyIfConfigNotFound: true,
14045
14052
  };
14046
- debug$f?.(timeFrom(start), 'tsconfck init', picocolorsExports.dim(workspaceRoot));
14053
+ debug$f?.(timeFrom(start), 'tsconfck init', colors$1.dim(workspaceRoot));
14047
14054
  return options;
14048
14055
  }
14049
14056
  async function loadTsconfigJsonForFile(filename) {
@@ -14334,6 +14341,8 @@ var jsonStableStringify = function (obj, opts) {
14334
14341
  }({ '': obj }, '', obj, 0));
14335
14342
  };
14336
14343
 
14344
+ var jsonStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(jsonStableStringify);
14345
+
14337
14346
  const mimes$1 = {
14338
14347
  "ez": "application/andrew-inset",
14339
14348
  "aw": "application/applixware",
@@ -16113,7 +16122,7 @@ async function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false
16113
16122
  content.length < Number(config.build.assetsInlineLimit) &&
16114
16123
  !isGitLfsPlaceholder(content))) {
16115
16124
  if (config.build.lib && isGitLfsPlaceholder(content)) {
16116
- config.logger.warn(picocolorsExports.yellow(`Inlined file ${id} was not downloaded via Git LFS`));
16125
+ config.logger.warn(colors$1.yellow(`Inlined file ${id} was not downloaded via Git LFS`));
16117
16126
  }
16118
16127
  const mimeType = lookup(file) ?? 'application/octet-stream';
16119
16128
  // base64 inlined as a string
@@ -16263,7 +16272,7 @@ function manifestPlugin(config) {
16263
16272
  ? config.build.manifest
16264
16273
  : 'manifest.json',
16265
16274
  type: 'asset',
16266
- source: jsonStableStringify(manifest, { space: 2 }),
16275
+ source: jsonStableStringify$1(manifest, { space: 2 }),
16267
16276
  });
16268
16277
  }
16269
16278
  },
@@ -16316,10 +16325,10 @@ function dataURIPlugin() {
16316
16325
  };
16317
16326
  }
16318
16327
 
16319
- /* es-module-lexer 1.2.0 */
16320
- const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const D=[],k=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let K;C.ip()&&(K=J(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),D.push({n:K,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],K=B<0?void 0:E.slice(B,g),D=K?K[0]:"";k.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?J(I):I,ln:'"'===D||"'"===D?J(K):K});}function J(A){try{return (0, eval)(A)}catch(A){}}return [D,k,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMvLgABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDAAUGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUGw8gALfwBBsPIACwdwEwZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAmFpAAgCaWQACQJpcAAKAmVzAAsCZWUADANlbHMADQNlbGUADgJyaQAPAnJlABABZgARBXBhcnNlABILX19oZWFwX2Jhc2UDAQrAOy5oAQF/QQAgADYC9AlBACgC0AkiASAAQQF0aiIAQQA7AQBBACAAQQJqIgA2AvgJQQAgADYC/AlBAEEANgLUCUEAQQA2AuQJQQBBADYC3AlBAEEANgLYCUEAQQA2AuwJQQBBADYC4AkgAQufAQEDf0EAKALkCSEEQQBBACgC/AkiBTYC5AlBACAENgLoCUEAIAVBIGo2AvwJIARBHGpB1AkgBBsgBTYCAEEAKALICSEEQQAoAsQJIQYgBSABNgIAIAUgADYCCCAFIAIgAkECakEAIAYgA0YbIAQgA0YbNgIMIAUgAzYCFCAFQQA2AhAgBSACNgIEIAVBADYCHCAFQQAoAsQJIANGOgAYC1YBAX9BACgC7AkiBEEQakHYCSAEG0EAKAL8CSIENgIAQQAgBDYC7AlBACAEQRRqNgL8CSAEQQA2AhAgBCADNgIMIAQgAjYCCCAEIAE2AgQgBCAANgIACwgAQQAoAoAKCxUAQQAoAtwJKAIAQQAoAtAJa0EBdQseAQF/QQAoAtwJKA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kAAA==","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
16328
+ /* es-module-lexer 1.2.1 */
16329
+ const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$e(E,g="@"){if(!C)return init.then((()=>parse$e(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const D=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,D,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const K=[],k=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let D;C.ip()&&(D=J(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),K.push({n:D,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],D=B<0?void 0:E.slice(B,g),K=D?D[0]:"";k.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?J(I):I,ln:'"'===K||"'"===K?J(D):D});}function J(A){try{return (0, eval)(A)}catch(A){}}return [K,k,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMvLgABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDAAUGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUGw8gALfwBBs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//A3ELqwEBBH8CQAJAQQAoAqAKIgIvAQAiA0HhAEYNACABIQQgACEFDAELQQAgAkEEajYCoApBARAnIQJBACgCoAohBQJAAkAgAkEiRg0AIAJBJ0YNACACECoaQQAoAqAKIQQMAQsgAhAYQQBBACgCoApBAmoiBDYCoAoLQQEQJyEDQQAoAqAKIQILAkAgAiAFRg0AIAUgBEEAIAAgACABRiICG0EAIAEgAhsQAgsgAwtyAQR/QQAoAqAKIQBBACgCpAohAQJAAkADQCAAQQJqIQIgACABTw0BAkACQCACLwEAIgNBpH9qDgIBBAALIAIhACADQXZqDgQCAQECAQsgAEEEaiEADAALC0EAIAI2AqAKECJBAA8LQQAgAjYCoApB3QALSQEDf0EAIQMCQCACRQ0AAkADQCAALQAAIgQgAS0AACIFRw0BIAFBAWohASAAQQFqIQAgAkF/aiICDQAMAgsLIAQgBWshAwsgAwsL4gECAEGACAvEAQAAeABwAG8AcgB0AG0AcABvAHIAdABlAHQAYQByAG8AbQB1AG4AYwB0AGkAbwBuAHMAcwBlAHIAdAB2AG8AeQBpAGUAZABlAGwAZQBjAG8AbgB0AGkAbgBpAG4AcwB0AGEAbgB0AHkAYgByAGUAYQByAGUAdAB1AHIAZABlAGIAdQBnAGcAZQBhAHcAYQBpAHQAaAByAHcAaABpAGwAZQBmAG8AcgBpAGYAYwBhAHQAYwBmAGkAbgBhAGwAbABlAGwAcwAAQcQJCxABAAAAAgAAAAAEAAAwOQAA","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
16321
16330
 
16322
- var convertSourceMap = {};
16331
+ var convertSourceMap$1 = {};
16323
16332
 
16324
16333
  (function (exports) {
16325
16334
 
@@ -16553,8 +16562,10 @@ var convertSourceMap = {};
16553
16562
  exports.generateMapFileComment = function (file, options) {
16554
16563
  var data = 'sourceMappingURL=' + file;
16555
16564
  return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
16556
- };
16557
- } (convertSourceMap));
16565
+ };
16566
+ } (convertSourceMap$1));
16567
+
16568
+ var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1);
16558
16569
 
16559
16570
  const debug$e = createDebugger('vite:sourcemap', {
16560
16571
  onlyWhenFocused: true,
@@ -16635,7 +16646,7 @@ function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logge
16635
16646
  }
16636
16647
  }
16637
16648
 
16638
- function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",2),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)}
16649
+ function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,f){let s,u,l=r(n,o),c=function(e){let n=new Set(["default",...e.conditions||[]]);return e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node"),n}(f||{}),a=i[l];if(void 0===a){let e,n,r,t;for(t in i)n&&t.length<n.length||("/"===t[t.length-1]&&l.startsWith(t)?(u=l.substring(t.length),n=t):t.length>1&&(r=t.indexOf("*",1),~r&&(e=RegExp("^"+t.substring(0,r)+"(.*)"+t.substring(1+r)).exec(l),e&&e[1]&&(u=e[1],n=t))));a=i[n];}return a||e(n,l),s=t(a,c),s||e(n,l,1),u&&function(e,n){let r,t=0,i=e.length,o=/[*]/g,f=/[/]$/;for(;t<i;t++)e[t]=o.test(r=e[t])?r.replace(o,n):f.test(r)?r+n:r;}(s,u),s}function r(e,n,r){if(e===n||"."===n)return ".";let t=e+"/",i=t.length,o=n.slice(0,i)===t,f=o?n.slice(i):n;return "#"===f[0]?f:o||!r?"./"===f.slice(0,2)?f:"./"+f:f}function t(e,n,r){if(e){if("string"==typeof e)return r&&r.add(e),[e];let i,o;if(Array.isArray(e)){for(o=r||new Set,i=0;i<e.length;i++)t(e[i],n,o);if(!r&&o.size)return [...o]}else for(i in e)if(n.has(i))return t(e[i],n,r)}}function o(e,r,t){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,r||".",t)}}function f(e,r,t){if(e.imports)return n(e.name,e.imports,r,t)}
16639
16650
 
16640
16651
  // This file was generated. Do not modify manually!
16641
16652
  var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
@@ -22767,7 +22778,7 @@ function resolvePlugin(resolveOptions) {
22767
22778
  // We don't need to resolve these paths since they are already resolved
22768
22779
  // always return here even if res doesn't exist since /@fs/ is explicit
22769
22780
  // if the file doesn't exist it should be a 404.
22770
- debug$d?.(`[@fs] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22781
+ debug$d?.(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22771
22782
  return ensureVersionQuery(res, id, options, depsOptimizer);
22772
22783
  }
22773
22784
  // URL
@@ -22775,7 +22786,7 @@ function resolvePlugin(resolveOptions) {
22775
22786
  if (asSrc && id[0] === '/' && (rootInRoot || !id.startsWith(root))) {
22776
22787
  const fsPath = path$o.resolve(root, id.slice(1));
22777
22788
  if ((res = tryFsResolve(fsPath, options))) {
22778
- debug$d?.(`[url] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22789
+ debug$d?.(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22779
22790
  return ensureVersionQuery(res, id, options, depsOptimizer);
22780
22791
  }
22781
22792
  }
@@ -22805,7 +22816,7 @@ function resolvePlugin(resolveOptions) {
22805
22816
  }
22806
22817
  if ((res = tryFsResolve(fsPath, options))) {
22807
22818
  res = ensureVersionQuery(res, id, options, depsOptimizer);
22808
- debug$d?.(`[relative] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22819
+ debug$d?.(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22809
22820
  // If this isn't a script imported from a .html file, include side effects
22810
22821
  // hints so the non-used code is properly tree-shaken during build time.
22811
22822
  if (!options.idOnly &&
@@ -22828,14 +22839,14 @@ function resolvePlugin(resolveOptions) {
22828
22839
  const basedir = importer ? path$o.dirname(importer) : process.cwd();
22829
22840
  const fsPath = path$o.resolve(basedir, id);
22830
22841
  if ((res = tryFsResolve(fsPath, options))) {
22831
- debug$d?.(`[drive-relative] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22842
+ debug$d?.(`[drive-relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22832
22843
  return ensureVersionQuery(res, id, options, depsOptimizer);
22833
22844
  }
22834
22845
  }
22835
22846
  // absolute fs paths
22836
22847
  if (isNonDriveRelativeAbsolutePath(id) &&
22837
22848
  (res = tryFsResolve(id, options))) {
22838
- debug$d?.(`[fs] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
22849
+ debug$d?.(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
22839
22850
  return ensureVersionQuery(res, id, options, depsOptimizer);
22840
22851
  }
22841
22852
  // external
@@ -22882,7 +22893,7 @@ function resolvePlugin(resolveOptions) {
22882
22893
  else {
22883
22894
  if (!asSrc) {
22884
22895
  debug$d?.(`externalized node built-in "${id}" to empty module. ` +
22885
- `(imported by: ${picocolorsExports.white(picocolorsExports.dim(importer))})`);
22896
+ `(imported by: ${colors$1.white(colors$1.dim(importer))})`);
22886
22897
  }
22887
22898
  else if (isProduction) {
22888
22899
  this.warn(`Module "${id}" has been externalized for browser compatibility, imported by "${importer}". ` +
@@ -22894,7 +22905,7 @@ function resolvePlugin(resolveOptions) {
22894
22905
  }
22895
22906
  }
22896
22907
  }
22897
- debug$d?.(`[fallthrough] ${picocolorsExports.dim(id)}`);
22908
+ debug$d?.(`[fallthrough] ${colors$1.dim(id)}`);
22898
22909
  },
22899
22910
  load(id) {
22900
22911
  if (id.startsWith(browserExternalId)) {
@@ -23137,8 +23148,13 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr = f
23137
23148
  }
23138
23149
  let resolvedId = id;
23139
23150
  if (deepMatch && !pkg?.data.exports && path$o.extname(id) !== resolvedExt) {
23140
- resolvedId = resolved.id.slice(resolved.id.indexOf(id));
23141
- debug$d?.(`[processResult] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(resolvedId)}`);
23151
+ // id date-fns/locale
23152
+ // resolve.id ...date-fns/esm/locale/index.js
23153
+ const index = resolved.id.indexOf(id);
23154
+ if (index > -1) {
23155
+ resolvedId = resolved.id.slice(index);
23156
+ debug$d?.(`[processResult] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedId)}`);
23157
+ }
23142
23158
  }
23143
23159
  return { ...resolved, id: resolvedId, external: true };
23144
23160
  };
@@ -23170,7 +23186,8 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr = f
23170
23186
  exclude = options.ssrConfig?.optimizeDeps?.exclude;
23171
23187
  include = options.ssrConfig?.optimizeDeps?.include;
23172
23188
  }
23173
- const skipOptimization = !isJsType ||
23189
+ const skipOptimization = depsOptimizer?.options.noDiscovery ||
23190
+ !isJsType ||
23174
23191
  (importer && isInNodeModules(importer)) ||
23175
23192
  exclude?.includes(pkgId) ||
23176
23193
  exclude?.includes(id) ||
@@ -23352,7 +23369,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
23352
23369
  const entryPointPath = path$o.join(dir, entry);
23353
23370
  const resolvedEntryPoint = tryFsResolve(entryPointPath, options, true, true, skipPackageJson);
23354
23371
  if (resolvedEntryPoint) {
23355
- debug$d?.(`[package entry] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(resolvedEntryPoint)}`);
23372
+ debug$d?.(`[package entry] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedEntryPoint)}`);
23356
23373
  setResolvedCache('.', resolvedEntryPoint, targetWeb);
23357
23374
  return resolvedEntryPoint;
23358
23375
  }
@@ -23368,34 +23385,28 @@ function packageEntryFailure(id, details) {
23368
23385
  `The package may have incorrect main/module/exports specified in its package.json` +
23369
23386
  (details ? ': ' + details : '.'));
23370
23387
  }
23371
- const conditionalConditions = new Set(['production', 'development', 'module']);
23372
23388
  function resolveExportsOrImports(pkg, key, options, targetWeb, type) {
23373
- const overrideConditions = options.overrideConditions
23374
- ? new Set(options.overrideConditions)
23375
- : undefined;
23376
- const conditions = [];
23377
- if ((!overrideConditions || overrideConditions.has('production')) &&
23378
- options.isProduction) {
23379
- conditions.push('production');
23380
- }
23381
- if ((!overrideConditions || overrideConditions.has('development')) &&
23382
- !options.isProduction) {
23383
- conditions.push('development');
23384
- }
23385
- if ((!overrideConditions || overrideConditions.has('module')) &&
23386
- !options.isRequire) {
23387
- conditions.push('module');
23388
- }
23389
- if (options.overrideConditions) {
23390
- conditions.push(...options.overrideConditions.filter((condition) => conditionalConditions.has(condition)));
23391
- }
23392
- else if (options.conditions.length > 0) {
23393
- conditions.push(...options.conditions);
23394
- }
23389
+ const additionalConditions = new Set(options.overrideConditions || [
23390
+ 'production',
23391
+ 'development',
23392
+ 'module',
23393
+ ...options.conditions,
23394
+ ]);
23395
+ const conditions = [...additionalConditions].filter((condition) => {
23396
+ switch (condition) {
23397
+ case 'production':
23398
+ return options.isProduction;
23399
+ case 'development':
23400
+ return !options.isProduction;
23401
+ case 'module':
23402
+ return !options.isRequire;
23403
+ }
23404
+ return true;
23405
+ });
23395
23406
  const fn = type === 'imports' ? f : o;
23396
23407
  const result = fn(pkg, key, {
23397
- browser: targetWeb && !conditions.includes('node'),
23398
- require: options.isRequire && !conditions.includes('import'),
23408
+ browser: targetWeb && !additionalConditions.has('node'),
23409
+ require: options.isRequire && !additionalConditions.has('import'),
23399
23410
  conditions,
23400
23411
  });
23401
23412
  return result ? result[0] : undefined;
@@ -23444,7 +23455,7 @@ function resolveDeepImport(id, { webResolvedImports, setResolvedCache, getResolv
23444
23455
  const resolved = tryFsResolve(path$o.join(dir, relativeId), options, !exportsField, // try index only if no exports field
23445
23456
  targetWeb);
23446
23457
  if (resolved) {
23447
- debug$d?.(`[node/deep-import] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(resolved)}`);
23458
+ debug$d?.(`[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}`);
23448
23459
  setResolvedCache(id, resolved, targetWeb);
23449
23460
  return resolved;
23450
23461
  }
@@ -23461,7 +23472,7 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
23461
23472
  if ((res = bareImportRE.test(browserMappedPath)
23462
23473
  ? tryNodeResolve(browserMappedPath, importer, options, true)?.id
23463
23474
  : tryFsResolve(path$o.join(pkg.dir, browserMappedPath), options))) {
23464
- debug$d?.(`[browser mapped] ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(res)}`);
23475
+ debug$d?.(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
23465
23476
  let result = { id: res };
23466
23477
  if (options.idOnly) {
23467
23478
  return result;
@@ -24193,7 +24204,7 @@ var utils$f = {};
24193
24204
  };
24194
24205
  flat(args);
24195
24206
  return result;
24196
- };
24207
+ };
24197
24208
  } (utils$f));
24198
24209
 
24199
24210
  const utils$e = utils$f;
@@ -25502,7 +25513,7 @@ var braces_1 = braces$2;
25502
25513
 
25503
25514
  const util = require$$0$6;
25504
25515
  const braces$1 = braces_1;
25505
- const picomatch$2 = picomatchExports;
25516
+ const picomatch$2 = picomatch$3;
25506
25517
  const utils$b = utils$k;
25507
25518
  const isEmptyString = val => val === '' || val === './';
25508
25519
 
@@ -25966,6 +25977,8 @@ micromatch$1.braceExpand = (pattern, options) => {
25966
25977
 
25967
25978
  var micromatch_1 = micromatch$1;
25968
25979
 
25980
+ var micromatch$2 = /*@__PURE__*/getDefaultExportFromCjs(micromatch_1);
25981
+
25969
25982
  Object.defineProperty(pattern$1, "__esModule", { value: true });
25970
25983
  pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
25971
25984
  const path$f = require$$0$4;
@@ -26530,7 +26543,7 @@ var fs$f = {};
26530
26543
  }
26531
26544
  return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
26532
26545
  }
26533
- exports.createFileSystemAdapter = createFileSystemAdapter;
26546
+ exports.createFileSystemAdapter = createFileSystemAdapter;
26534
26547
  } (fs$f));
26535
26548
 
26536
26549
  Object.defineProperty(settings$3, "__esModule", { value: true });
@@ -26883,7 +26896,7 @@ var fs$b = {};
26883
26896
  }
26884
26897
  return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
26885
26898
  }
26886
- exports.createFileSystemAdapter = createFileSystemAdapter;
26899
+ exports.createFileSystemAdapter = createFileSystemAdapter;
26887
26900
  } (fs$b));
26888
26901
 
26889
26902
  Object.defineProperty(settings$2, "__esModule", { value: true });
@@ -26936,11 +26949,7 @@ function getSettings$1(settingsOrOptions = {}) {
26936
26949
  return new settings_1$2.default(settingsOrOptions);
26937
26950
  }
26938
26951
 
26939
- var queueExports = {};
26940
- var queue = {
26941
- get exports(){ return queueExports; },
26942
- set exports(v){ queueExports = v; },
26943
- };
26952
+ var queue = {exports: {}};
26944
26953
 
26945
26954
  function reusify$1 (Constructor) {
26946
26955
  var head = new Constructor();
@@ -27254,7 +27263,9 @@ function queueAsPromised (context, worker, concurrency) {
27254
27263
  }
27255
27264
 
27256
27265
  queue.exports = fastqueue;
27257
- queueExports.promise = queueAsPromised;
27266
+ queue.exports.promise = queueAsPromised;
27267
+
27268
+ var queueExports = queue.exports;
27258
27269
 
27259
27270
  var common$7 = {};
27260
27271
 
@@ -28232,7 +28243,7 @@ var settings = {};
28232
28243
  return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
28233
28244
  }
28234
28245
  }
28235
- exports.default = Settings;
28246
+ exports.default = Settings;
28236
28247
  } (settings));
28237
28248
 
28238
28249
  const taskManager = tasks;
@@ -28303,6 +28314,8 @@ function assertPatternsInput(input) {
28303
28314
  }
28304
28315
  var out = FastGlob;
28305
28316
 
28317
+ var glob = /*@__PURE__*/getDefaultExportFromCjs(out);
28318
+
28306
28319
  const debug$c = createDebugger('vite:ssr-external');
28307
28320
  /**
28308
28321
  * Converts "parent > child" syntax to just "child"
@@ -28664,7 +28677,7 @@ function optimizedDepsPlugin(config) {
28664
28677
  }
28665
28678
  }
28666
28679
  }
28667
- debug$b?.(`load ${picocolorsExports.cyan(file)}`);
28680
+ debug$b?.(`load ${colors$1.cyan(file)}`);
28668
28681
  // Load the file from the cache instead of waiting for other plugin
28669
28682
  // load hooks to avoid race conditions, once processing is resolved,
28670
28683
  // we are sure that the file has been properly save to disk
@@ -28727,7 +28740,7 @@ function optimizedDepsBuildPlugin(config) {
28727
28740
  const info = optimizedDepInfoFromFile(depsOptimizer.metadata, file);
28728
28741
  if (info) {
28729
28742
  await info.processing;
28730
- debug$b?.(`load ${picocolorsExports.cyan(file)}`);
28743
+ debug$b?.(`load ${colors$1.cyan(file)}`);
28731
28744
  }
28732
28745
  else {
28733
28746
  throw new Error(`Something unexpected happened while optimizing "${id}".`);
@@ -29004,7 +29017,7 @@ var dist = {};
29004
29017
  },
29005
29018
  };
29006
29019
  }
29007
- exports.lilconfigSync = lilconfigSync;
29020
+ exports.lilconfigSync = lilconfigSync;
29008
29021
  } (dist));
29009
29022
 
29010
29023
  const ALIAS = Symbol.for('yaml.alias');
@@ -36556,6 +36569,8 @@ const rc = withTypeScriptLoader((ctx, path, options) => {
36556
36569
  */
36557
36570
  var src$1 = rc;
36558
36571
 
36572
+ var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1);
36573
+
36559
36574
  function stripLiteralAcorn(code) {
36560
36575
  const FILL = " ";
36561
36576
  let result = "";
@@ -36621,11 +36636,7 @@ function stripLiteral(code) {
36621
36636
  }
36622
36637
  }
36623
36638
 
36624
- var mainExports = {};
36625
- var main$1 = {
36626
- get exports(){ return mainExports; },
36627
- set exports(v){ mainExports = v; },
36628
- };
36639
+ var main$1 = {exports: {}};
36629
36640
 
36630
36641
  var name = "dotenv";
36631
36642
  var version$1 = "16.0.3";
@@ -36810,8 +36821,8 @@ const DotenvModule = {
36810
36821
  parse: parse$9
36811
36822
  };
36812
36823
 
36813
- mainExports.config = DotenvModule.config;
36814
- var parse_1$1 = mainExports.parse = DotenvModule.parse;
36824
+ main$1.exports.config = DotenvModule.config;
36825
+ var parse_1$1 = main$1.exports.parse = DotenvModule.parse;
36815
36826
  main$1.exports = DotenvModule;
36816
36827
 
36817
36828
  function _interpolate (envValue, environment, config) {
@@ -37085,7 +37096,7 @@ function traverseNodes(node, visitor) {
37085
37096
  }
37086
37097
  async function traverseHtml(html, filePath, visitor) {
37087
37098
  // lazy load compiler
37088
- const { parse } = await import('./dep-98d07f71.js');
37099
+ const { parse } = await import('./dep-f0c7dae0.js');
37089
37100
  const ast = parse(html, {
37090
37101
  scriptingEnabled: false,
37091
37102
  sourceCodeLocationInfo: true,
@@ -37585,7 +37596,7 @@ function preImportMapHook(config) {
37585
37596
  return;
37586
37597
  if (importMapAppendIndex < importMapIndex) {
37587
37598
  const relativeHtml = normalizePath$3(path$o.relative(config.root, ctx.filename));
37588
- config.logger.warnOnce(picocolorsExports.yellow(picocolorsExports.bold(`(!) <script type="importmap"> should come before <script type="module"> and <link rel="modulepreload"> in /${relativeHtml}`)));
37599
+ config.logger.warnOnce(colors$1.yellow(colors$1.bold(`(!) <script type="importmap"> should come before <script type="module"> and <link rel="modulepreload"> in /${relativeHtml}`)));
37589
37600
  }
37590
37601
  };
37591
37602
  }
@@ -37629,7 +37640,7 @@ function htmlEnvHook(config) {
37629
37640
  else {
37630
37641
  if (envPrefix.some((prefix) => key.startsWith(prefix))) {
37631
37642
  const relativeHtml = normalizePath$3(path$o.relative(config.root, ctx.filename));
37632
- config.logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) ${text} is not defined in env variables found in /${relativeHtml}. ` +
37643
+ config.logger.warn(colors$1.yellow(colors$1.bold(`(!) ${text} is not defined in env variables found in /${relativeHtml}. ` +
37633
37644
  `Is the variable mistyped?`)));
37634
37645
  }
37635
37646
  return text;
@@ -38422,7 +38433,7 @@ async function compileCSS(id, code, config, urlReplacer) {
38422
38433
  // but we've shimmed to remove the `resolve` dep to cut on bundle size.
38423
38434
  // warn here to provide a better error message.
38424
38435
  if (!path$o.isAbsolute(id)) {
38425
- config.logger.error(picocolorsExports.red(`Unable to resolve \`@import "${id}"\` from ${basedir}`));
38436
+ config.logger.error(colors$1.red(`Unable to resolve \`@import "${id}"\` from ${basedir}`));
38426
38437
  }
38427
38438
  return id;
38428
38439
  },
@@ -38498,10 +38509,10 @@ async function compileCSS(id, code, config, urlReplacer) {
38498
38509
  else if (message.type === 'dir-dependency') {
38499
38510
  // https://github.com/postcss/postcss/blob/main/docs/guidelines/plugin.md#3-dependencies
38500
38511
  const { dir, glob: globPattern = '**' } = message;
38501
- const pattern = out.escapePath(normalizePath$3(path$o.resolve(path$o.dirname(id), dir))) +
38512
+ const pattern = glob.escapePath(normalizePath$3(path$o.resolve(path$o.dirname(id), dir))) +
38502
38513
  `/` +
38503
38514
  globPattern;
38504
- const files = out.sync(pattern, {
38515
+ const files = glob.sync(pattern, {
38505
38516
  ignore: ['**/node_modules/**'],
38506
38517
  });
38507
38518
  for (let i = 0; i < files.length; i++) {
@@ -38516,7 +38527,7 @@ async function compileCSS(id, code, config, urlReplacer) {
38516
38527
  column: message.column,
38517
38528
  })}`;
38518
38529
  }
38519
- config.logger.warn(picocolorsExports.yellow(msg));
38530
+ config.logger.warn(colors$1.yellow(msg));
38520
38531
  }
38521
38532
  }
38522
38533
  }
@@ -38563,8 +38574,8 @@ function createCachedImport(imp) {
38563
38574
  return cached;
38564
38575
  };
38565
38576
  }
38566
- const importPostcssImport = createCachedImport(() => import('./dep-e3f470e2.js').then(function (n) { return n.i; }));
38567
- const importPostcssModules = createCachedImport(() => import('./dep-17ff486c.js').then(function (n) { return n.i; }));
38577
+ const importPostcssImport = createCachedImport(() => import('./dep-3ea2db5b.js').then(function (n) { return n.i; }));
38578
+ const importPostcssModules = createCachedImport(() => import('./dep-5728e8e9.js').then(function (n) { return n.i; }));
38568
38579
  const importPostcss = createCachedImport(() => import('postcss'));
38569
38580
  /**
38570
38581
  * @experimental
@@ -38628,7 +38639,7 @@ async function resolvePostcssConfig(config) {
38628
38639
  }
38629
38640
  else {
38630
38641
  const searchPath = typeof inlineOptions === 'string' ? inlineOptions : config.root;
38631
- result = src$1({}, searchPath).catch((e) => {
38642
+ result = postcssrc({}, searchPath).catch((e) => {
38632
38643
  if (!/No PostCSS Config found/.test(e.message)) {
38633
38644
  if (e instanceof Error) {
38634
38645
  const { name, message, stack } = e;
@@ -38775,7 +38786,7 @@ async function minifyCSS(css, config) {
38775
38786
  });
38776
38787
  if (warnings.length) {
38777
38788
  const msgs = await formatMessages(warnings, { kind: 'warning' });
38778
- config.logger.warn(picocolorsExports.yellow(`warnings when minifying css:\n${msgs.join('\n')}`));
38789
+ config.logger.warn(colors$1.yellow(`warnings when minifying css:\n${msgs.join('\n')}`));
38779
38790
  }
38780
38791
  return code;
38781
38792
  }
@@ -39490,7 +39501,7 @@ base.MethodDefinition = base.PropertyDefinition = base.Property = function (node
39490
39501
  if (node.value) { c(node.value, st, "Expression"); }
39491
39502
  };
39492
39503
 
39493
- const { isMatch: isMatch$1, scan } = micromatch_1;
39504
+ const { isMatch: isMatch$1, scan } = micromatch$2;
39494
39505
  function getAffectedGlobModules(file, server) {
39495
39506
  const modules = [];
39496
39507
  for (const [id, allGlobs] of server._importGlobMap) {
@@ -39723,7 +39734,7 @@ async function transformGlobImport(code, id, root, resolveId, isProduction, rest
39723
39734
  const s = new MagicString(code);
39724
39735
  const staticImports = (await Promise.all(matches.map(async ({ globs, globsResolved, isRelative, options, index, start, end, }) => {
39725
39736
  const cwd = getCommonBase(globsResolved) ?? root;
39726
- const files = (await out(globsResolved, {
39737
+ const files = (await glob(globsResolved, {
39727
39738
  cwd,
39728
39739
  absolute: true,
39729
39740
  dot: !!options.exhaustive,
@@ -39837,7 +39848,7 @@ async function transformGlobImport(code, id, root, resolveId, isProduction, rest
39837
39848
  function globSafePath(path) {
39838
39849
  // slash path to ensure \ is converted to / as \ could lead to a double escape scenario
39839
39850
  // see https://github.com/mrmlnc/fast-glob#advanced-syntax
39840
- return out.escapePath(normalizePath$3(path));
39851
+ return glob.escapePath(normalizePath$3(path));
39841
39852
  }
39842
39853
  function lastNthChar(str, n) {
39843
39854
  return str.charAt(str.length - 1 - n);
@@ -39925,20 +39936,20 @@ async function handleHMRUpdate(file, server, configOnly) {
39925
39936
  (fileName === '.env' || fileName.startsWith('.env.'));
39926
39937
  if (isConfig || isConfigDependency || isEnv) {
39927
39938
  // auto restart server
39928
- debugHmr?.(`[config change] ${picocolorsExports.dim(shortFile)}`);
39929
- config.logger.info(picocolorsExports.green(`${path$o.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true });
39939
+ debugHmr?.(`[config change] ${colors$1.dim(shortFile)}`);
39940
+ config.logger.info(colors$1.green(`${path$o.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true });
39930
39941
  try {
39931
39942
  await server.restart();
39932
39943
  }
39933
39944
  catch (e) {
39934
- config.logger.error(picocolorsExports.red(e));
39945
+ config.logger.error(colors$1.red(e));
39935
39946
  }
39936
39947
  return;
39937
39948
  }
39938
39949
  if (configOnly) {
39939
39950
  return;
39940
39951
  }
39941
- debugHmr?.(`[file change] ${picocolorsExports.dim(shortFile)}`);
39952
+ debugHmr?.(`[file change] ${colors$1.dim(shortFile)}`);
39942
39953
  // (dev only) the client itself cannot be hot updated.
39943
39954
  if (file.startsWith(normalizedClientDir)) {
39944
39955
  ws.send({
@@ -39966,7 +39977,7 @@ async function handleHMRUpdate(file, server, configOnly) {
39966
39977
  if (!hmrContext.modules.length) {
39967
39978
  // html file cannot be hot updated
39968
39979
  if (file.endsWith('.html')) {
39969
- config.logger.info(picocolorsExports.green(`page reload `) + picocolorsExports.dim(shortFile), {
39980
+ config.logger.info(colors$1.green(`page reload `) + colors$1.dim(shortFile), {
39970
39981
  clear: true,
39971
39982
  timestamp: true,
39972
39983
  });
@@ -39979,7 +39990,7 @@ async function handleHMRUpdate(file, server, configOnly) {
39979
39990
  }
39980
39991
  else {
39981
39992
  // loaded but not in the module graph, probably not js
39982
- debugHmr?.(`[no modules matched] ${picocolorsExports.dim(shortFile)}`);
39993
+ debugHmr?.(`[no modules matched] ${colors$1.dim(shortFile)}`);
39983
39994
  }
39984
39995
  return;
39985
39996
  }
@@ -40012,7 +40023,7 @@ function updateModules(file, modules, timestamp, { config, ws, moduleGraph }, af
40012
40023
  })));
40013
40024
  }
40014
40025
  if (needFullReload) {
40015
- config.logger.info(picocolorsExports.green(`page reload `) + picocolorsExports.dim(file), {
40026
+ config.logger.info(colors$1.green(`page reload `) + colors$1.dim(file), {
40016
40027
  clear: !afterInvalidation,
40017
40028
  timestamp: true,
40018
40029
  });
@@ -40022,11 +40033,11 @@ function updateModules(file, modules, timestamp, { config, ws, moduleGraph }, af
40022
40033
  return;
40023
40034
  }
40024
40035
  if (updates.length === 0) {
40025
- debugHmr?.(picocolorsExports.yellow(`no update happened `) + picocolorsExports.dim(file));
40036
+ debugHmr?.(colors$1.yellow(`no update happened `) + colors$1.dim(file));
40026
40037
  return;
40027
40038
  }
40028
- config.logger.info(picocolorsExports.green(`hmr update `) +
40029
- picocolorsExports.dim([...new Set(updates.map((u) => u.path))].join(', ')), { clear: !afterInvalidation, timestamp: true });
40039
+ config.logger.info(colors$1.green(`hmr update `) +
40040
+ colors$1.dim([...new Set(updates.map((u) => u.path))].join(', ')), { clear: !afterInvalidation, timestamp: true });
40030
40041
  ws.send({
40031
40042
  type: 'update',
40032
40043
  updates,
@@ -40056,7 +40067,7 @@ function propagateUpdate(node, traversedModules, boundaries, currentChain = [nod
40056
40067
  // if the imports of `node` have not been analyzed, then `node` has not
40057
40068
  // been loaded in the browser and we should stop propagation.
40058
40069
  if (node.id && node.isSelfAccepting === undefined) {
40059
- debugHmr?.(`[propagate update] stop propagation because not analyzed: ${picocolorsExports.dim(node.id)}`);
40070
+ debugHmr?.(`[propagate update] stop propagation because not analyzed: ${colors$1.dim(node.id)}`);
40060
40071
  return false;
40061
40072
  }
40062
40073
  if (node.isSelfAccepting) {
@@ -40120,7 +40131,7 @@ function handlePrunedModules(mods, { ws }) {
40120
40131
  const t = Date.now();
40121
40132
  mods.forEach((mod) => {
40122
40133
  mod.lastHMRTimestamp = t;
40123
- debugHmr?.(`[dispose] ${picocolorsExports.dim(mod.file)}`);
40134
+ debugHmr?.(`[dispose] ${colors$1.dim(mod.file)}`);
40124
40135
  });
40125
40136
  ws.send({
40126
40137
  type: 'prune',
@@ -40412,7 +40423,7 @@ function importAnalysisPlugin(config) {
40412
40423
  const ssr = options?.ssr === true;
40413
40424
  const prettyImporter = prettifyUrl(importer, root);
40414
40425
  if (canSkipImportAnalysis(importer)) {
40415
- debug$a?.(picocolorsExports.dim(`[skipped] ${prettyImporter}`));
40426
+ debug$a?.(colors$1.dim(`[skipped] ${prettyImporter}`));
40416
40427
  return null;
40417
40428
  }
40418
40429
  const start = performance$1.now();
@@ -40452,7 +40463,7 @@ function importAnalysisPlugin(config) {
40452
40463
  }
40453
40464
  if (!imports.length && !this._addedImports) {
40454
40465
  importerModule.isSelfAccepting = false;
40455
- debug$a?.(`${timeFrom(start)} ${picocolorsExports.dim(`[no imports] ${prettyImporter}`)}`);
40466
+ debug$a?.(`${timeFrom(start)} ${colors$1.dim(`[no imports] ${prettyImporter}`)}`);
40456
40467
  return source;
40457
40468
  }
40458
40469
  let hasHMR = false;
@@ -40650,11 +40661,11 @@ function importAnalysisPlugin(config) {
40650
40661
  ) {
40651
40662
  const newImport = sourceExp + specifier + `?inline` + source.slice(end, expEnd);
40652
40663
  this.warn(`\n` +
40653
- picocolorsExports.cyan(importerModule.file) +
40664
+ colors$1.cyan(importerModule.file) +
40654
40665
  `\n` +
40655
- picocolorsExports.reset(generateCodeFrame(source, start)) +
40666
+ colors$1.reset(generateCodeFrame(source, start)) +
40656
40667
  `\n` +
40657
- picocolorsExports.yellow(`Default and named imports from CSS files are deprecated. ` +
40668
+ colors$1.yellow(`Default and named imports from CSS files are deprecated. ` +
40658
40669
  `Use the ?inline query instead. ` +
40659
40670
  `For example: ${newImport}`));
40660
40671
  }
@@ -40676,7 +40687,7 @@ function importAnalysisPlugin(config) {
40676
40687
  // optimize info for them, but they don't need es interop. If the request isn't
40677
40688
  // a dynamic import, then it is an internal Vite error
40678
40689
  if (!file.match(optimizedDepDynamicRE$1)) {
40679
- config.logger.error(picocolorsExports.red(`Vite Error, ${url} optimized info should be defined`));
40690
+ config.logger.error(colors$1.red(`Vite Error, ${url} optimized info should be defined`));
40680
40691
  }
40681
40692
  }
40682
40693
  else if (needsInterop) {
@@ -40737,11 +40748,11 @@ function importAnalysisPlugin(config) {
40737
40748
  source.slice(dynamicIndex + 1, end));
40738
40749
  if (!hasViteIgnore) {
40739
40750
  this.warn(`\n` +
40740
- picocolorsExports.cyan(importerModule.file) +
40751
+ colors$1.cyan(importerModule.file) +
40741
40752
  `\n` +
40742
- picocolorsExports.reset(generateCodeFrame(source, start)) +
40743
- picocolorsExports.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\n` +
40744
- `See ${picocolorsExports.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} ` +
40753
+ colors$1.reset(generateCodeFrame(source, start)) +
40754
+ colors$1.yellow(`\nThe above dynamic import cannot be analyzed by Vite.\n` +
40755
+ `See ${colors$1.blue(`https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations`)} ` +
40745
40756
  `for supported dynamic import formats. ` +
40746
40757
  `If this is intended to be left as-is, you can use the ` +
40747
40758
  `/* @vite-ignore */ comment inside the import() call to suppress this warning.\n`));
@@ -40815,7 +40826,7 @@ function importAnalysisPlugin(config) {
40815
40826
  handlePrunedModules(prunedImports, server);
40816
40827
  }
40817
40828
  }
40818
- debug$a?.(`${timeFrom(start)} ${picocolorsExports.dim(`[${importedUrls.size} imports rewritten] ${prettyImporter}`)}`);
40829
+ debug$a?.(`${timeFrom(start)} ${colors$1.dim(`[${importedUrls.size} imports rewritten] ${prettyImporter}`)}`);
40819
40830
  if (s) {
40820
40831
  return transformStableResult(s, importer, config);
40821
40832
  }
@@ -40877,7 +40888,7 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, confi
40877
40888
  if (config.command === 'serve' &&
40878
40889
  node.type === 'ExportAllDeclaration' &&
40879
40890
  !node.exported) {
40880
- config.logger.warn(picocolorsExports.yellow(`\nUnable to interop \`${importExp}\` in ${importer}, this may lose module exports. Please export "${rawUrl}" as ESM or use named exports instead, e.g. \`export { A, B } from "${rawUrl}"\``));
40891
+ config.logger.warn(colors$1.yellow(`\nUnable to interop \`${importExp}\` in ${importer}, this may lose module exports. Please export "${rawUrl}" as ESM or use named exports instead, e.g. \`export { A, B } from "${rawUrl}"\``));
40881
40892
  }
40882
40893
  else if (node.type === 'ImportDeclaration' ||
40883
40894
  node.type === 'ExportNamedDeclaration') {
@@ -41271,8 +41282,6 @@ function webWorkerPlugin(config) {
41271
41282
  return '';
41272
41283
  }
41273
41284
  },
41274
- // @ts-expect-error return void to fallback to other plugins, even though
41275
- // the types doesn't allow it. https://github.com/rollup/rollup/pull/4932
41276
41285
  shouldTransformCachedModule({ id }) {
41277
41286
  if (isBuild && isWorkerQueryId(id) && config.build.watch) {
41278
41287
  return true;
@@ -41442,6 +41451,9 @@ function preAliasPlugin(config) {
41442
41451
  if (optimizedId) {
41443
41452
  return optimizedId; // aliased dep already optimized
41444
41453
  }
41454
+ if (depsOptimizer.options.noDiscovery) {
41455
+ return;
41456
+ }
41445
41457
  const resolved = await this.resolve(id, importer, {
41446
41458
  ...options,
41447
41459
  custom: { ...options.custom, 'vite:pre-alias': true },
@@ -42345,12 +42357,12 @@ function prepareError(err) {
42345
42357
  }
42346
42358
  function buildErrorMessage(err, args = [], includeStack = true) {
42347
42359
  if (err.plugin)
42348
- args.push(` Plugin: ${picocolorsExports.magenta(err.plugin)}`);
42360
+ args.push(` Plugin: ${colors$1.magenta(err.plugin)}`);
42349
42361
  const loc = err.loc ? `:${err.loc.line}:${err.loc.column}` : '';
42350
42362
  if (err.id)
42351
- args.push(` File: ${picocolorsExports.cyan(err.id)}${loc}`);
42363
+ args.push(` File: ${colors$1.cyan(err.id)}${loc}`);
42352
42364
  if (err.frame)
42353
- args.push(picocolorsExports.yellow(pad$1(err.frame)));
42365
+ args.push(colors$1.yellow(pad$1(err.frame)));
42354
42366
  if (includeStack && err.stack)
42355
42367
  args.push(pad$1(cleanStack(err.stack)));
42356
42368
  return args.join('\n');
@@ -42363,7 +42375,7 @@ function cleanStack(stack) {
42363
42375
  }
42364
42376
  function logError(server, err) {
42365
42377
  const msg = buildErrorMessage(err, [
42366
- picocolorsExports.red(`Internal server error: ${err.message}`),
42378
+ colors$1.red(`Internal server error: ${err.message}`),
42367
42379
  ]);
42368
42380
  server.config.logger.error(msg, {
42369
42381
  clear: true,
@@ -42433,8 +42445,8 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42433
42445
  },
42434
42446
  };
42435
42447
  function warnIncompatibleMethod(method, plugin) {
42436
- logger.warn(picocolorsExports.cyan(`[plugin:${plugin}] `) +
42437
- picocolorsExports.yellow(`context method ${picocolorsExports.bold(`${method}()`)} is not supported in serve mode. This plugin is likely not vite-compatible.`));
42448
+ logger.warn(colors$1.cyan(`[plugin:${plugin}] `) +
42449
+ colors$1.yellow(`context method ${colors$1.bold(`${method}()`)} is not supported in serve mode. This plugin is likely not vite-compatible.`));
42438
42450
  }
42439
42451
  // parallel, ignores returns
42440
42452
  async function hookParallel(hookName, context, args) {
@@ -42575,7 +42587,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42575
42587
  }
42576
42588
  warn(e, position) {
42577
42589
  const err = formatError(e, position, this);
42578
- const msg = buildErrorMessage(err, [picocolorsExports.yellow(`warning: ${err.message}`)], false);
42590
+ const msg = buildErrorMessage(err, [colors$1.yellow(`warning: ${err.message}`)], false);
42579
42591
  logger.warn(msg, {
42580
42592
  clear: true,
42581
42593
  timestamp: true,
@@ -42609,7 +42621,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42609
42621
  errLocation = numberToPos(ctx._activeCode, pos);
42610
42622
  }
42611
42623
  catch (err2) {
42612
- logger.error(picocolorsExports.red(`Error in error handler:\n${err2.stack || err2.message}\n`),
42624
+ logger.error(colors$1.red(`Error in error handler:\n${err2.stack || err2.message}\n`),
42613
42625
  // print extra newline to separate the two errors
42614
42626
  { error: err2 });
42615
42627
  throw err;
@@ -42815,7 +42827,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
42815
42827
  // avoid spamming
42816
42828
  if (!seenResolves[key]) {
42817
42829
  seenResolves[key] = true;
42818
- debugResolve(`${timeFrom(resolveStart)} ${picocolorsExports.cyan(rawId)} -> ${picocolorsExports.dim(id)}`);
42830
+ debugResolve(`${timeFrom(resolveStart)} ${colors$1.cyan(rawId)} -> ${colors$1.dim(id)}`);
42819
42831
  }
42820
42832
  }
42821
42833
  if (id) {
@@ -42926,7 +42938,7 @@ function scanImports(config) {
42926
42938
  entries = computedEntries;
42927
42939
  if (!entries.length) {
42928
42940
  if (!config.optimizeDeps.entries && !config.optimizeDeps.include) {
42929
- config.logger.warn(picocolorsExports.yellow('(!) Could not auto-determine entry point from rollupOptions or html files ' +
42941
+ config.logger.warn(colors$1.yellow('(!) Could not auto-determine entry point from rollupOptions or html files ' +
42930
42942
  'and there are no explicit optimizeDeps.include patterns. ' +
42931
42943
  'Skipping dependency pre-bundling.'));
42932
42944
  }
@@ -42935,7 +42947,7 @@ function scanImports(config) {
42935
42947
  if (scanContext.cancelled)
42936
42948
  return;
42937
42949
  debug$9?.(`Crawling dependencies using entries: ${entries
42938
- .map((entry) => `\n ${picocolorsExports.dim(entry)}`)
42950
+ .map((entry) => `\n ${colors$1.dim(entry)}`)
42939
42951
  .join('')}`);
42940
42952
  return prepareEsbuildScanner(config, entries, deps, missing, scanContext);
42941
42953
  });
@@ -42969,7 +42981,7 @@ function scanImports(config) {
42969
42981
  // return an empty result instead
42970
42982
  return { deps: {}, missing: {} };
42971
42983
  }
42972
- const prependMessage = picocolorsExports.red(`\
42984
+ const prependMessage = colors$1.red(`\
42973
42985
  Failed to scan for dependencies from entries:
42974
42986
  ${entries.join('\n')}
42975
42987
 
@@ -42991,8 +43003,8 @@ function scanImports(config) {
42991
43003
  const duration = (performance$1.now() - start).toFixed(2);
42992
43004
  const depsStr = Object.keys(orderedDependencies(deps))
42993
43005
  .sort()
42994
- .map((id) => `\n ${picocolorsExports.cyan(id)} -> ${picocolorsExports.dim(deps[id])}`)
42995
- .join('') || picocolorsExports.dim('no dependencies found');
43006
+ .map((id) => `\n ${colors$1.cyan(id)} -> ${colors$1.dim(deps[id])}`)
43007
+ .join('') || colors$1.dim('no dependencies found');
42996
43008
  debug$9(`Scan completed in ${duration}ms: ${depsStr}`);
42997
43009
  }
42998
43010
  });
@@ -43061,7 +43073,7 @@ function orderedDependencies(deps) {
43061
43073
  return Object.fromEntries(depsList);
43062
43074
  }
43063
43075
  function globEntries(pattern, config) {
43064
- return out(pattern, {
43076
+ return glob(pattern, {
43065
43077
  cwd: config.root,
43066
43078
  ignore: [
43067
43079
  '**/node_modules/**',
@@ -43472,7 +43484,7 @@ async function createDepsOptimizer(config, server) {
43472
43484
  let newDepsToLogHandle;
43473
43485
  const logNewlyDiscoveredDeps = () => {
43474
43486
  if (newDepsToLog.length) {
43475
- config.logger.info(picocolorsExports.green(`✨ new dependencies optimized: ${depsLogString(newDepsToLog)}`), {
43487
+ config.logger.info(colors$1.green(`✨ new dependencies optimized: ${depsLogString(newDepsToLog)}`), {
43476
43488
  timestamp: true,
43477
43489
  });
43478
43490
  newDepsToLog = [];
@@ -43526,12 +43538,17 @@ async function createDepsOptimizer(config, server) {
43526
43538
  });
43527
43539
  newDepsDiscovered = true;
43528
43540
  }
43529
- if (!isBuild) {
43541
+ if (config.optimizeDeps.noDiscovery) {
43542
+ // We don't need to scan for dependencies or wait for the static crawl to end
43543
+ // Run the first optimization run immediately
43544
+ runOptimizer();
43545
+ }
43546
+ else if (!isBuild) {
43530
43547
  // Important, the scanner is dev only
43531
43548
  depsOptimizer.scanProcessing = new Promise((resolve) => {
43532
43549
  (async () => {
43533
43550
  try {
43534
- debug$8?.(picocolorsExports.green(`scanning for dependencies...`));
43551
+ debug$8?.(colors$1.green(`scanning for dependencies...`));
43535
43552
  discover = discoverProjectDependencies(config);
43536
43553
  const deps = await discover.result;
43537
43554
  discover = undefined;
@@ -43683,7 +43700,7 @@ async function createDepsOptimizer(config, server) {
43683
43700
  }, 2 * debounceMs);
43684
43701
  }
43685
43702
  else {
43686
- debug$8(picocolorsExports.green(`✨ ${!isRerun
43703
+ debug$8(colors$1.green(`✨ ${!isRerun
43687
43704
  ? `dependencies optimized`
43688
43705
  : `optimized dependencies unchanged`}`));
43689
43706
  }
@@ -43695,7 +43712,7 @@ async function createDepsOptimizer(config, server) {
43695
43712
  // We don't resolve the processing promise, as they will be resolved
43696
43713
  // once a rerun is committed
43697
43714
  processingResult.cancel();
43698
- debug$8?.(picocolorsExports.green(`✨ delaying reload as new dependencies have been found...`));
43715
+ debug$8?.(colors$1.green(`✨ delaying reload as new dependencies have been found...`));
43699
43716
  }
43700
43717
  else {
43701
43718
  await commitProcessing();
@@ -43705,11 +43722,11 @@ async function createDepsOptimizer(config, server) {
43705
43722
  newDepsToLogHandle = undefined;
43706
43723
  logNewlyDiscoveredDeps();
43707
43724
  }
43708
- logger.info(picocolorsExports.green(`✨ optimized dependencies changed. reloading`), {
43725
+ logger.info(colors$1.green(`✨ optimized dependencies changed. reloading`), {
43709
43726
  timestamp: true,
43710
43727
  });
43711
43728
  if (needsInteropMismatch.length > 0) {
43712
- config.logger.warn(`Mixed ESM and CJS detected in ${picocolorsExports.yellow(needsInteropMismatch.join(', '))}, add ${needsInteropMismatch.length === 1 ? 'it' : 'them'} to optimizeDeps.needsInterop to speed up cold start`, {
43729
+ config.logger.warn(`Mixed ESM and CJS detected in ${colors$1.yellow(needsInteropMismatch.join(', '))}, add ${needsInteropMismatch.length === 1 ? 'it' : 'them'} to optimizeDeps.needsInterop to speed up cold start`, {
43713
43730
  timestamp: true,
43714
43731
  });
43715
43732
  }
@@ -43718,7 +43735,7 @@ async function createDepsOptimizer(config, server) {
43718
43735
  }
43719
43736
  }
43720
43737
  catch (e) {
43721
- logger.error(picocolorsExports.red(`error while updating dependencies:\n${e.stack}`), { timestamp: true, error: e });
43738
+ logger.error(colors$1.red(`error while updating dependencies:\n${e.stack}`), { timestamp: true, error: e });
43722
43739
  resolveEnqueuedProcessingPromises();
43723
43740
  // Reset missing deps, let the server rediscover the dependencies
43724
43741
  metadata.discovered = {};
@@ -43745,7 +43762,7 @@ async function createDepsOptimizer(config, server) {
43745
43762
  // optimizeDeps processing is finished
43746
43763
  const deps = Object.keys(metadata.discovered);
43747
43764
  const depsString = depsLogString(deps);
43748
- debug$8?.(picocolorsExports.green(`new dependencies found: ${depsString}`));
43765
+ debug$8?.(colors$1.green(`new dependencies found: ${depsString}`));
43749
43766
  runOptimizer();
43750
43767
  }
43751
43768
  function getDiscoveredBrowserHash(hash, deps, missing) {
@@ -43830,7 +43847,7 @@ async function createDepsOptimizer(config, server) {
43830
43847
  // On build time, a missing dep appearing after onCrawlEnd is an internal error
43831
43848
  // On dev, switch after this point to a simple debounce strategy
43832
43849
  crawlEndFinder = undefined;
43833
- debug$8?.(picocolorsExports.green(`✨ static imports crawl ended`));
43850
+ debug$8?.(colors$1.green(`✨ static imports crawl ended`));
43834
43851
  if (closed) {
43835
43852
  return;
43836
43853
  }
@@ -43844,7 +43861,7 @@ async function createDepsOptimizer(config, server) {
43844
43861
  currentlyProcessing = false;
43845
43862
  const scanDeps = Object.keys(result.metadata.optimized);
43846
43863
  if (scanDeps.length === 0 && crawlDeps.length === 0) {
43847
- debug$8?.(picocolorsExports.green(`✨ no dependencies found by the scanner or crawling static imports`));
43864
+ debug$8?.(colors$1.green(`✨ no dependencies found by the scanner or crawling static imports`));
43848
43865
  result.cancel();
43849
43866
  firstRunCalled = true;
43850
43867
  return;
@@ -43862,13 +43879,13 @@ async function createDepsOptimizer(config, server) {
43862
43879
  }
43863
43880
  }
43864
43881
  if (scannerMissedDeps) {
43865
- debug$8?.(picocolorsExports.yellow(`✨ new dependencies were found while crawling that weren't detected by the scanner`));
43882
+ debug$8?.(colors$1.yellow(`✨ new dependencies were found while crawling that weren't detected by the scanner`));
43866
43883
  }
43867
- debug$8?.(picocolorsExports.green(`✨ re-running optimizer`));
43884
+ debug$8?.(colors$1.green(`✨ re-running optimizer`));
43868
43885
  debouncedProcessing(0);
43869
43886
  }
43870
43887
  else {
43871
- debug$8?.(picocolorsExports.green(`✨ using post-scan optimizer result, the scanner found every used dependency`));
43888
+ debug$8?.(colors$1.green(`✨ using post-scan optimizer result, the scanner found every used dependency`));
43872
43889
  startNextDiscoveredBatch();
43873
43890
  runOptimizer(result);
43874
43891
  }
@@ -43876,7 +43893,7 @@ async function createDepsOptimizer(config, server) {
43876
43893
  else {
43877
43894
  currentlyProcessing = false;
43878
43895
  if (crawlDeps.length === 0) {
43879
- debug$8?.(picocolorsExports.green(`✨ no dependencies found while crawling the static imports`));
43896
+ debug$8?.(colors$1.green(`✨ no dependencies found while crawling the static imports`));
43880
43897
  firstRunCalled = true;
43881
43898
  }
43882
43899
  else {
@@ -44007,7 +44024,7 @@ function findInteropMismatches(discovered, optimized) {
44007
44024
  // This only happens when a discovered dependency has mixed ESM and CJS syntax
44008
44025
  // and it hasn't been manually added to optimizeDeps.needsInterop
44009
44026
  needsInteropMismatch.push(dep);
44010
- debug$8?.(picocolorsExports.cyan(`✨ needsInterop mismatch detected for ${dep}`));
44027
+ debug$8?.(colors$1.cyan(`✨ needsInterop mismatch detected for ${dep}`));
44011
44028
  }
44012
44029
  }
44013
44030
  }
@@ -44030,7 +44047,7 @@ async function optimizeDeps(config, force = config.optimizeDeps.force, asCommand
44030
44047
  }
44031
44048
  const deps = await discoverProjectDependencies(config).result;
44032
44049
  const depsString = depsLogString(Object.keys(deps));
44033
- log?.(picocolorsExports.green(`Optimizing dependencies:\n ${depsString}`));
44050
+ log?.(colors$1.green(`Optimizing dependencies:\n ${depsString}`));
44034
44051
  await addManuallyIncludedOptimizeDeps(deps, config, ssr);
44035
44052
  const depsInfo = toDiscoveredDependencies(config, deps, ssr);
44036
44053
  const result = await runOptimizeDeps(config, depsInfo).result;
@@ -44125,7 +44142,7 @@ function discoverProjectDependencies(config) {
44125
44142
  const missingIds = Object.keys(missing);
44126
44143
  if (missingIds.length) {
44127
44144
  throw new Error(`The following dependencies are imported but could not be resolved:\n\n ${missingIds
44128
- .map((id) => `${picocolorsExports.cyan(id)} ${picocolorsExports.white(picocolorsExports.dim(`(imported by ${missing[id]})`))}`)
44145
+ .map((id) => `${colors$1.cyan(id)} ${colors$1.white(colors$1.dim(`(imported by ${missing[id]})`))}`)
44129
44146
  .join(`\n `)}\n\nAre they installed?`);
44130
44147
  }
44131
44148
  return deps;
@@ -44148,7 +44165,7 @@ function toDiscoveredDependencies(config, deps, ssr, timestamp) {
44148
44165
  return discovered;
44149
44166
  }
44150
44167
  function depsLogString(qualifiedIds) {
44151
- return picocolorsExports.yellow(qualifiedIds.join(`, `));
44168
+ return colors$1.yellow(qualifiedIds.join(`, `));
44152
44169
  }
44153
44170
  /**
44154
44171
  * Internally, Vite uses this function to prepare a optimizeDeps run. When Vite starts, we can get
@@ -44433,7 +44450,7 @@ async function addManuallyIncludedOptimizeDeps(deps, config, ssr, extra = [], fi
44433
44450
  if (optimizeDepsInclude.length || extra.length) {
44434
44451
  const unableToOptimize = (id, msg) => {
44435
44452
  if (optimizeDepsInclude.includes(id)) {
44436
- logger.warn(`${msg}: ${picocolorsExports.cyan(id)}, present in '${ssr ? 'ssr.' : ''}optimizeDeps.include'`);
44453
+ logger.warn(`${msg}: ${colors$1.cyan(id)}, present in '${ssr ? 'ssr.' : ''}optimizeDeps.include'`);
44437
44454
  }
44438
44455
  };
44439
44456
  const resolve = createOptimizeDepsIncludeResolver(config, ssr);
@@ -45092,7 +45109,7 @@ function buildImportAnalysisPlugin(config) {
45092
45109
  // optimize info for them, but they don't need es interop. If the request isn't
45093
45110
  // a dynamic import, then it is an internal Vite error
45094
45111
  if (!file.match(optimizedDepDynamicRE)) {
45095
- config.logger.error(picocolorsExports.red(`Vite Error, ${url} optimized info should be defined`));
45112
+ config.logger.error(colors$1.red(`Vite Error, ${url} optimized info should be defined`));
45096
45113
  }
45097
45114
  }
45098
45115
  else if (needsInterop) {
@@ -45400,7 +45417,7 @@ function ssrManifestPlugin(config) {
45400
45417
  ? config.build.ssrManifest
45401
45418
  : 'ssr-manifest.json',
45402
45419
  type: 'asset',
45403
- source: jsonStableStringify(ssrManifest, { space: 2 }),
45420
+ source: jsonStableStringify$1(ssrManifest, { space: 2 }),
45404
45421
  });
45405
45422
  },
45406
45423
  };
@@ -45431,7 +45448,7 @@ function resolveChokidarOptions(config, options) {
45431
45448
  '**/.git/**',
45432
45449
  '**/node_modules/**',
45433
45450
  '**/test-results/**',
45434
- out.escapePath(config.cacheDir) + '/**',
45451
+ glob.escapePath(config.cacheDir) + '/**',
45435
45452
  ...(Array.isArray(ignored) ? ignored : [ignored]),
45436
45453
  ],
45437
45454
  ignoreInitial: true,
@@ -45589,6 +45606,8 @@ function stattag (stat) {
45589
45606
  return '"' + size + '-' + mtime + '"'
45590
45607
  }
45591
45608
 
45609
+ var getEtag = /*@__PURE__*/getDefaultExportFromCjs(etag_1);
45610
+
45592
45611
  const alias = {
45593
45612
  js: 'application/javascript',
45594
45613
  css: 'text/css',
@@ -45596,7 +45615,7 @@ const alias = {
45596
45615
  json: 'application/json',
45597
45616
  };
45598
45617
  function send$2(req, res, content, type, options) {
45599
- const { etag = etag_1(content, { weak: true }), cacheControl = 'no-cache', headers, map, } = options;
45618
+ const { etag = getEtag(content, { weak: true }), cacheControl = 'no-cache', headers, map, } = options;
45600
45619
  if (res.writableEnded) {
45601
45620
  return;
45602
45621
  }
@@ -45939,6 +45958,8 @@ function escapeHtml$1(string) {
45939
45958
  : html;
45940
45959
  }
45941
45960
 
45961
+ var escapeHtml$2 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
45962
+
45942
45963
  const knownJavascriptExtensionRE = /\.[tj]sx?$/;
45943
45964
  const sirvOptions = ({ headers, shouldServe, }) => {
45944
45965
  return {
@@ -46099,7 +46120,7 @@ function renderRestrictedErrorHTML(msg) {
46099
46120
  return html `
46100
46121
  <body>
46101
46122
  <h1>403 Restricted</h1>
46102
- <p>${escapeHtml_1(msg).replace(/\n/g, '<br/>')}</p>
46123
+ <p>${escapeHtml$2(msg).replace(/\n/g, '<br/>')}</p>
46103
46124
  <style>
46104
46125
  body {
46105
46126
  padding: 1em 2em;
@@ -46247,7 +46268,7 @@ async function build(inlineConfig = {}) {
46247
46268
  const options = config.build;
46248
46269
  const ssr = !!options.ssr;
46249
46270
  const libOptions = options.lib;
46250
- config.logger.info(picocolorsExports.cyan(`vite v${VERSION$1} ${picocolorsExports.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`));
46271
+ config.logger.info(colors$1.cyan(`vite v${VERSION$1} ${colors$1.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`));
46251
46272
  const resolve = (p) => path$o.resolve(config.root, p);
46252
46273
  const input = libOptions
46253
46274
  ? options.rollupOptions?.input ||
@@ -46297,12 +46318,12 @@ async function build(inlineConfig = {}) {
46297
46318
  },
46298
46319
  };
46299
46320
  const outputBuildError = (e) => {
46300
- let msg = picocolorsExports.red((e.plugin ? `[${e.plugin}] ` : '') + e.message);
46321
+ let msg = colors$1.red((e.plugin ? `[${e.plugin}] ` : '') + e.message);
46301
46322
  if (e.id) {
46302
- msg += `\nfile: ${picocolorsExports.cyan(e.id + (e.loc ? `:${e.loc.line}:${e.loc.column}` : ''))}`;
46323
+ msg += `\nfile: ${colors$1.cyan(e.id + (e.loc ? `:${e.loc.line}:${e.loc.column}` : ''))}`;
46303
46324
  }
46304
46325
  if (e.frame) {
46305
- msg += `\n` + picocolorsExports.yellow(e.frame);
46326
+ msg += `\n` + colors$1.yellow(e.frame);
46306
46327
  }
46307
46328
  config.logger.error(msg, { error: e });
46308
46329
  };
@@ -46366,7 +46387,7 @@ async function build(inlineConfig = {}) {
46366
46387
  const outDirs = normalizedOutputs.map(({ dir }) => resolve(dir));
46367
46388
  // watch file changes with rollup
46368
46389
  if (config.build.watch) {
46369
- config.logger.info(picocolorsExports.cyan(`\nwatching for file changes...`));
46390
+ config.logger.info(colors$1.cyan(`\nwatching for file changes...`));
46370
46391
  const resolvedChokidarOptions = resolveChokidarOptions(config, config.build.watch.chokidar);
46371
46392
  const { watch } = await import('rollup');
46372
46393
  const watcher = watch({
@@ -46379,14 +46400,14 @@ async function build(inlineConfig = {}) {
46379
46400
  });
46380
46401
  watcher.on('event', (event) => {
46381
46402
  if (event.code === 'BUNDLE_START') {
46382
- config.logger.info(picocolorsExports.cyan(`\nbuild started...`));
46403
+ config.logger.info(colors$1.cyan(`\nbuild started...`));
46383
46404
  if (options.write) {
46384
46405
  prepareOutDir(outDirs, options.emptyOutDir, config);
46385
46406
  }
46386
46407
  }
46387
46408
  else if (event.code === 'BUNDLE_END') {
46388
46409
  event.result.close();
46389
- config.logger.info(picocolorsExports.cyan(`built in ${event.duration}ms.`));
46410
+ config.logger.info(colors$1.cyan(`built in ${event.duration}ms.`));
46390
46411
  }
46391
46412
  else if (event.code === 'ERROR') {
46392
46413
  outputBuildError(event.error);
@@ -46423,7 +46444,7 @@ function prepareOutDir(outDirs, emptyOutDir, config) {
46423
46444
  if (fs$l.existsSync(outDir) &&
46424
46445
  !normalizePath$3(outDir).startsWith(config.root + '/')) {
46425
46446
  // warn if outDir is outside of root
46426
- config.logger.warn(picocolorsExports.yellow(`\n${picocolorsExports.bold(`(!)`)} outDir ${picocolorsExports.white(picocolorsExports.dim(outDir))} is not inside project root and will not be emptied.\n` +
46447
+ config.logger.warn(colors$1.yellow(`\n${colors$1.bold(`(!)`)} outDir ${colors$1.white(colors$1.dim(outDir))} is not inside project root and will not be emptied.\n` +
46427
46448
  `Use --emptyOutDir to override.\n`));
46428
46449
  outside = true;
46429
46450
  break;
@@ -46500,7 +46521,7 @@ function resolveBuildOutputs(outputs, libOptions, logger) {
46500
46521
  }
46501
46522
  // By this point, we know "outputs" is an Array.
46502
46523
  if (libOptions.formats) {
46503
- logger.warn(picocolorsExports.yellow('"build.lib.formats" will be ignored because "build.rollupOptions.output" is already an array format.'));
46524
+ logger.warn(colors$1.yellow('"build.lib.formats" will be ignored because "build.rollupOptions.output" is already an array format.'));
46504
46525
  }
46505
46526
  outputs.forEach((output) => {
46506
46527
  if (['umd', 'iife'].includes(output.format) && !output.name) {
@@ -46536,7 +46557,7 @@ function onRollupWarning(warning, warn, config) {
46536
46557
  return;
46537
46558
  }
46538
46559
  if (warning.code === 'PLUGIN_WARNING') {
46539
- config.logger.warn(`${picocolorsExports.bold(picocolorsExports.yellow(`[plugin:${warning.plugin}]`))} ${picocolorsExports.yellow(warning.message)}`);
46560
+ config.logger.warn(`${colors$1.bold(colors$1.yellow(`[plugin:${warning.plugin}]`))} ${colors$1.yellow(warning.message)}`);
46540
46561
  return;
46541
46562
  }
46542
46563
  warn(warning);
@@ -46780,23 +46801,11 @@ var build$1 = {
46780
46801
  toOutputFilePathWithoutRuntime: toOutputFilePathWithoutRuntime
46781
46802
  };
46782
46803
 
46783
- var srcExports = {};
46784
- var src = {
46785
- get exports(){ return srcExports; },
46786
- set exports(v){ srcExports = v; },
46787
- };
46804
+ var src = {exports: {}};
46788
46805
 
46789
- var browserExports = {};
46790
- var browser = {
46791
- get exports(){ return browserExports; },
46792
- set exports(v){ browserExports = v; },
46793
- };
46806
+ var browser = {exports: {}};
46794
46807
 
46795
- var debugExports = {};
46796
- var debug$6 = {
46797
- get exports(){ return debugExports; },
46798
- set exports(v){ debugExports = v; },
46799
- };
46808
+ var debug$6 = {exports: {}};
46800
46809
 
46801
46810
  /**
46802
46811
  * Helpers.
@@ -46962,7 +46971,7 @@ function requireMs () {
46962
46971
  var hasRequiredDebug;
46963
46972
 
46964
46973
  function requireDebug () {
46965
- if (hasRequiredDebug) return debugExports;
46974
+ if (hasRequiredDebug) return debug$6.exports;
46966
46975
  hasRequiredDebug = 1;
46967
46976
  (function (module, exports) {
46968
46977
  /**
@@ -47165,9 +47174,9 @@ function requireDebug () {
47165
47174
  function coerce(val) {
47166
47175
  if (val instanceof Error) return val.stack || val.message;
47167
47176
  return val;
47168
- }
47169
- } (debug$6, debugExports));
47170
- return debugExports;
47177
+ }
47178
+ } (debug$6, debug$6.exports));
47179
+ return debug$6.exports;
47171
47180
  }
47172
47181
 
47173
47182
  /**
@@ -47179,7 +47188,7 @@ function requireDebug () {
47179
47188
  var hasRequiredBrowser;
47180
47189
 
47181
47190
  function requireBrowser () {
47182
- if (hasRequiredBrowser) return browserExports;
47191
+ if (hasRequiredBrowser) return browser.exports;
47183
47192
  hasRequiredBrowser = 1;
47184
47193
  (function (module, exports) {
47185
47194
  exports = module.exports = requireDebug();
@@ -47360,16 +47369,12 @@ function requireBrowser () {
47360
47369
  try {
47361
47370
  return window.localStorage;
47362
47371
  } catch (e) {}
47363
- }
47364
- } (browser, browserExports));
47365
- return browserExports;
47372
+ }
47373
+ } (browser, browser.exports));
47374
+ return browser.exports;
47366
47375
  }
47367
47376
 
47368
- var nodeExports = {};
47369
- var node = {
47370
- get exports(){ return nodeExports; },
47371
- set exports(v){ nodeExports = v; },
47372
- };
47377
+ var node = {exports: {}};
47373
47378
 
47374
47379
  /**
47375
47380
  * Module dependencies.
@@ -47378,7 +47383,7 @@ var node = {
47378
47383
  var hasRequiredNode;
47379
47384
 
47380
47385
  function requireNode () {
47381
- if (hasRequiredNode) return nodeExports;
47386
+ if (hasRequiredNode) return node.exports;
47382
47387
  hasRequiredNode = 1;
47383
47388
  (function (module, exports) {
47384
47389
  var tty = require$$0$3;
@@ -47624,9 +47629,9 @@ function requireNode () {
47624
47629
  * Enable namespaces listed in `process.env.DEBUG` initially.
47625
47630
  */
47626
47631
 
47627
- exports.enable(load());
47628
- } (node, nodeExports));
47629
- return nodeExports;
47632
+ exports.enable(load());
47633
+ } (node, node.exports));
47634
+ return node.exports;
47630
47635
  }
47631
47636
 
47632
47637
  /**
@@ -47634,13 +47639,13 @@ function requireNode () {
47634
47639
  * treat as a browser.
47635
47640
  */
47636
47641
 
47637
- (function (module) {
47638
- if (typeof process !== 'undefined' && process.type === 'renderer') {
47639
- module.exports = requireBrowser();
47640
- } else {
47641
- module.exports = requireNode();
47642
- }
47643
- } (src));
47642
+ if (typeof process !== 'undefined' && process.type === 'renderer') {
47643
+ src.exports = requireBrowser();
47644
+ } else {
47645
+ src.exports = requireNode();
47646
+ }
47647
+
47648
+ var srcExports = src.exports;
47644
47649
 
47645
47650
  /*!
47646
47651
  * encodeurl
@@ -47701,11 +47706,7 @@ function encodeUrl$1 (url) {
47701
47706
  .replace(ENCODE_CHARS_REGEXP, encodeURI)
47702
47707
  }
47703
47708
 
47704
- var onFinishedExports = {};
47705
- var onFinished$2 = {
47706
- get exports(){ return onFinishedExports; },
47707
- set exports(v){ onFinishedExports = v; },
47708
- };
47709
+ var onFinished$2 = {exports: {}};
47709
47710
 
47710
47711
  /*!
47711
47712
  * ee-first
@@ -47814,7 +47815,7 @@ function listener(event, done) {
47814
47815
  */
47815
47816
 
47816
47817
  onFinished$2.exports = onFinished$1;
47817
- onFinishedExports.isFinished = isFinished$1;
47818
+ onFinished$2.exports.isFinished = isFinished$1;
47818
47819
 
47819
47820
  /**
47820
47821
  * Module dependencies.
@@ -47996,11 +47997,9 @@ function patchAssignSocket(res, callback) {
47996
47997
  };
47997
47998
  }
47998
47999
 
47999
- var parseurlExports = {};
48000
- var parseurl$1 = {
48001
- get exports(){ return parseurlExports; },
48002
- set exports(v){ parseurlExports = v; },
48003
- };
48000
+ var onFinishedExports = onFinished$2.exports;
48001
+
48002
+ var parseurl$1 = {exports: {}};
48004
48003
 
48005
48004
  /*!
48006
48005
  * parseurl
@@ -48024,7 +48023,7 @@ var Url = url$3.Url;
48024
48023
  */
48025
48024
 
48026
48025
  parseurl$1.exports = parseurl;
48027
- parseurlExports.original = originalurl;
48026
+ parseurl$1.exports.original = originalurl;
48028
48027
 
48029
48028
  /**
48030
48029
  * Parse the `req` url with memoization.
@@ -48157,6 +48156,8 @@ function fresh (url, parsedUrl) {
48157
48156
  parsedUrl._raw === url
48158
48157
  }
48159
48158
 
48159
+ var parseurlExports = parseurl$1.exports;
48160
+
48160
48161
  var require$$0$1 = {
48161
48162
  "100": "Continue",
48162
48163
  "101": "Switching Protocols",
@@ -48734,11 +48735,7 @@ function setHeaders (res, headers) {
48734
48735
  }
48735
48736
  }
48736
48737
 
48737
- var utilsMergeExports = {};
48738
- var utilsMerge = {
48739
- get exports(){ return utilsMergeExports; },
48740
- set exports(v){ utilsMergeExports = v; },
48741
- };
48738
+ var utilsMerge = {exports: {}};
48742
48739
 
48743
48740
  /**
48744
48741
  * Merge object b with object a.
@@ -48763,9 +48760,11 @@ var utilsMerge = {
48763
48760
  }
48764
48761
  }
48765
48762
  return a;
48766
- };
48763
+ };
48767
48764
  } (utilsMerge));
48768
48765
 
48766
+ var utilsMergeExports = utilsMerge.exports;
48767
+
48769
48768
  /*!
48770
48769
  * connect
48771
48770
  * Copyright(c) 2010 Sencha Inc.
@@ -49044,11 +49043,9 @@ function getProtohost(url) {
49044
49043
  : undefined;
49045
49044
  }
49046
49045
 
49047
- var libExports$1 = {};
49048
- var lib$1 = {
49049
- get exports(){ return libExports$1; },
49050
- set exports(v){ libExports$1 = v; },
49051
- };
49046
+ var connect$1 = /*@__PURE__*/getDefaultExportFromCjs(connect);
49047
+
49048
+ var lib$1 = {exports: {}};
49052
49049
 
49053
49050
  /*
49054
49051
  object-assign
@@ -49139,11 +49136,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
49139
49136
  return to;
49140
49137
  };
49141
49138
 
49142
- var varyExports = {};
49143
- var vary$1 = {
49144
- get exports(){ return varyExports; },
49145
- set exports(v){ varyExports = v; },
49146
- };
49139
+ var vary$1 = {exports: {}};
49147
49140
 
49148
49141
  /*!
49149
49142
  * vary
@@ -49156,7 +49149,7 @@ var vary$1 = {
49156
49149
  */
49157
49150
 
49158
49151
  vary$1.exports = vary;
49159
- varyExports.append = append;
49152
+ vary$1.exports.append = append;
49160
49153
 
49161
49154
  /**
49162
49155
  * RegExp to match field-name in RFC 7230 sec 3.2
@@ -49293,6 +49286,8 @@ function vary (res, field) {
49293
49286
  }
49294
49287
  }
49295
49288
 
49289
+ var varyExports = vary$1.exports;
49290
+
49296
49291
  (function () {
49297
49292
 
49298
49293
  var assign = objectAssign;
@@ -49530,13 +49525,16 @@ function vary (res, field) {
49530
49525
 
49531
49526
  }());
49532
49527
 
49528
+ var libExports$1 = lib$1.exports;
49529
+ var corsMiddleware = /*@__PURE__*/getDefaultExportFromCjs(libExports$1);
49530
+
49533
49531
  var chokidar = {};
49534
49532
 
49535
49533
  const fs$8 = require$$0__default;
49536
49534
  const { Readable } = require$$0$7;
49537
49535
  const sysPath$3 = require$$0$4;
49538
49536
  const { promisify: promisify$3 } = require$$0$6;
49539
- const picomatch$1 = picomatchExports;
49537
+ const picomatch$1 = picomatch$3;
49540
49538
 
49541
49539
  const readdir$1 = promisify$3(fs$8.readdir);
49542
49540
  const stat$3 = promisify$3(fs$8.stat);
@@ -49818,11 +49816,7 @@ readdirp$1.default = readdirp$1;
49818
49816
 
49819
49817
  var readdirp_1 = readdirp$1;
49820
49818
 
49821
- var anymatchExports = {};
49822
- var anymatch$2 = {
49823
- get exports(){ return anymatchExports; },
49824
- set exports(v){ anymatchExports = v; },
49825
- };
49819
+ var anymatch$2 = {exports: {}};
49826
49820
 
49827
49821
  /*!
49828
49822
  * normalize-path <https://github.com/jonschlinkert/normalize-path>
@@ -49860,9 +49854,11 @@ var normalizePath$2 = function(path, stripTrailing) {
49860
49854
  return prefix + segs.join('/');
49861
49855
  };
49862
49856
 
49863
- Object.defineProperty(anymatchExports, "__esModule", { value: true });
49857
+ var anymatch_1 = anymatch$2.exports;
49858
+
49859
+ Object.defineProperty(anymatch_1, "__esModule", { value: true });
49864
49860
 
49865
- const picomatch = picomatchExports;
49861
+ const picomatch = picomatch$3;
49866
49862
  const normalizePath$1 = normalizePath$2;
49867
49863
 
49868
49864
  /**
@@ -49963,11 +49959,7 @@ const anymatch$1 = (matchers, testString, options = DEFAULT_OPTIONS) => {
49963
49959
  anymatch$1.default = anymatch$1;
49964
49960
  anymatch$2.exports = anymatch$1;
49965
49961
 
49966
- var binaryExtensionsExports = {};
49967
- var binaryExtensions$1 = {
49968
- get exports(){ return binaryExtensionsExports; },
49969
- set exports(v){ binaryExtensionsExports = v; },
49970
- };
49962
+ var anymatchExports = anymatch$2.exports;
49971
49963
 
49972
49964
  var require$$0 = [
49973
49965
  "3dm",
@@ -50230,12 +50222,10 @@ var require$$0 = [
50230
50222
  "zipx"
50231
50223
  ];
50232
50224
 
50233
- (function (module) {
50234
- module.exports = require$$0;
50235
- } (binaryExtensions$1));
50225
+ var binaryExtensions$1 = require$$0;
50236
50226
 
50237
50227
  const path$8 = require$$0$4;
50238
- const binaryExtensions = binaryExtensionsExports;
50228
+ const binaryExtensions = binaryExtensions$1;
50239
50229
 
50240
50230
  const extensions = new Set(binaryExtensions);
50241
50231
 
@@ -50307,7 +50297,7 @@ var constants$1 = {};
50307
50297
  exports.isWindows = platform === 'win32';
50308
50298
  exports.isMacos = platform === 'darwin';
50309
50299
  exports.isLinux = platform === 'linux';
50310
- exports.isIBMi = os.type() === 'OS400';
50300
+ exports.isIBMi = os.type() === 'OS400';
50311
50301
  } (constants$1));
50312
50302
 
50313
50303
  const fs$7 = require$$0__default;
@@ -50335,7 +50325,7 @@ const {
50335
50325
 
50336
50326
  const THROTTLE_MODE_WATCH = 'watch';
50337
50327
 
50338
- const open$1 = promisify$2(fs$7.open);
50328
+ const open$2 = promisify$2(fs$7.open);
50339
50329
  const stat$2 = promisify$2(fs$7.stat);
50340
50330
  const lstat$1 = promisify$2(fs$7.lstat);
50341
50331
  const close = promisify$2(fs$7.close);
@@ -50487,7 +50477,7 @@ const setFsWatchListener = (path, fullPath, options, handlers) => {
50487
50477
  // Workaround for https://github.com/joyent/node/issues/4337
50488
50478
  if (isWindows$2 && error.code === 'EPERM') {
50489
50479
  try {
50490
- const fd = await open$1(path, 'r');
50480
+ const fd = await open$2(path, 'r');
50491
50481
  await close(fd);
50492
50482
  broadcastErr(error);
50493
50483
  } catch (err) {}
@@ -50953,11 +50943,7 @@ async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
50953
50943
 
50954
50944
  var nodefsHandler = NodeFsHandler$1;
50955
50945
 
50956
- var fseventsHandlerExports = {};
50957
- var fseventsHandler = {
50958
- get exports(){ return fseventsHandlerExports; },
50959
- set exports(v){ fseventsHandlerExports = v; },
50960
- };
50946
+ var fseventsHandler = {exports: {}};
50961
50947
 
50962
50948
  const fs$6 = require$$0__default;
50963
50949
  const sysPath$1 = require$$0$4;
@@ -51481,7 +51467,9 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
51481
51467
  };
51482
51468
 
51483
51469
  fseventsHandler.exports = FsEventsHandler$1;
51484
- fseventsHandlerExports.canUse = canUse;
51470
+ fseventsHandler.exports.canUse = canUse;
51471
+
51472
+ var fseventsHandlerExports = fseventsHandler.exports;
51485
51473
 
51486
51474
  const { EventEmitter: EventEmitter$2 } = require$$0$5;
51487
51475
  const fs$5 = require$$0__default;
@@ -53090,6 +53078,8 @@ var launchEditorMiddleware = (specifiedEditor, srcRoot, onErrorCallback) => {
53090
53078
  }
53091
53079
  };
53092
53080
 
53081
+ var launchEditorMiddleware$1 = /*@__PURE__*/getDefaultExportFromCjs(launchEditorMiddleware);
53082
+
53093
53083
  async function resolveHttpServer({ proxy }, app, httpsOptions) {
53094
53084
  if (!httpsOptions) {
53095
53085
  const { createServer } = await import('node:http');
@@ -53163,7 +53153,7 @@ function setClientErrorHandler(server, logger) {
53163
53153
  let msg = '400 Bad Request';
53164
53154
  if (err.code === 'HPE_HEADER_OVERFLOW') {
53165
53155
  msg = '431 Request Header Fields Too Large';
53166
- logger.warn(picocolorsExports.yellow('Server responded with status code 431. ' +
53156
+ logger.warn(colors$1.yellow('Server responded with status code 431. ' +
53167
53157
  'See https://vitejs.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.'));
53168
53158
  }
53169
53159
  if (err.code === 'ECONNRESET' || !socket.writable) {
@@ -53349,7 +53339,7 @@ async function loadAndTransform(id, url, server, options, timestamp) {
53349
53339
  if (transformResult == null ||
53350
53340
  (isObject$2(transformResult) && transformResult.code == null)) {
53351
53341
  // no transform applied, keep code as-is
53352
- debugTransform?.(timeFrom(transformStart) + picocolorsExports.dim(` [skipped] ${prettyUrl}`));
53342
+ debugTransform?.(timeFrom(transformStart) + colors$1.dim(` [skipped] ${prettyUrl}`));
53353
53343
  }
53354
53344
  else {
53355
53345
  debugTransform?.(`${timeFrom(transformStart)} ${prettyUrl}`);
@@ -53382,7 +53372,7 @@ async function loadAndTransform(id, url, server, options, timestamp) {
53382
53372
  : {
53383
53373
  code,
53384
53374
  map,
53385
- etag: etag_1(code, { weak: true }),
53375
+ etag: getEtag(code, { weak: true }),
53386
53376
  };
53387
53377
  // Only cache the result if the module wasn't invalidated while it was
53388
53378
  // being processed, so it is re-processed next time if it is stale
@@ -53702,6 +53692,7 @@ const ssrImportKey = `__vite_ssr_import__`;
53702
53692
  const ssrDynamicImportKey = `__vite_ssr_dynamic_import__`;
53703
53693
  const ssrExportAllKey = `__vite_ssr_exportAll__`;
53704
53694
  const ssrImportMetaKey = `__vite_ssr_import_meta__`;
53695
+ const hashbangRE = /^#!.*\n/;
53705
53696
  async function ssrTransform(code, inMap, url, originalCode, options) {
53706
53697
  if (options?.json?.stringify && isJSONRequest(url)) {
53707
53698
  return ssrTransformJSON(code, inMap);
@@ -53738,12 +53729,14 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
53738
53729
  const dynamicDeps = new Set();
53739
53730
  const idToImportMap = new Map();
53740
53731
  const declaredConst = new Set();
53732
+ // hoist at the start of the file, after the hashbang
53733
+ const hoistIndex = code.match(hashbangRE)?.[0].length ?? 0;
53741
53734
  function defineImport(source) {
53742
53735
  deps.add(source);
53743
53736
  const importId = `__vite_ssr_import_${uid++}__`;
53744
53737
  // There will be an error if the module is called before it is imported,
53745
53738
  // so the module import statement is hoisted to the top
53746
- s.appendLeft(0, `const ${importId} = await ${ssrImportKey}(${JSON.stringify(source)});\n`);
53739
+ s.appendLeft(hoistIndex, `const ${importId} = await ${ssrImportKey}(${JSON.stringify(source)});\n`);
53747
53740
  return importId;
53748
53741
  }
53749
53742
  function defineExport(position, name, local = name) {
@@ -53800,7 +53793,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
53800
53793
  const importId = defineImport(node.source.value);
53801
53794
  // hoist re-exports near the defined import so they are immediately exported
53802
53795
  for (const spec of node.specifiers) {
53803
- defineExport(0, spec.exported.name, `${importId}.${spec.local.name}`);
53796
+ defineExport(hoistIndex, spec.exported.name, `${importId}.${spec.local.name}`);
53804
53797
  }
53805
53798
  }
53806
53799
  else {
@@ -53838,10 +53831,10 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
53838
53831
  const importId = defineImport(node.source.value);
53839
53832
  // hoist re-exports near the defined import so they are immediately exported
53840
53833
  if (node.exported) {
53841
- defineExport(0, node.exported.name, `${importId}`);
53834
+ defineExport(hoistIndex, node.exported.name, `${importId}`);
53842
53835
  }
53843
53836
  else {
53844
- s.appendLeft(0, `${ssrExportAllKey}(${importId});\n`);
53837
+ s.appendLeft(hoistIndex, `${ssrExportAllKey}(${importId});\n`);
53845
53838
  }
53846
53839
  }
53847
53840
  }
@@ -54356,7 +54349,7 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
54356
54349
  if (e.stack && fixStacktrace) {
54357
54350
  ssrFixStacktrace(e, moduleGraph);
54358
54351
  }
54359
- server.config.logger.error(picocolorsExports.red(`Error when evaluating SSR module ${url}:` +
54352
+ server.config.logger.error(colors$1.red(`Error when evaluating SSR module ${url}:` +
54360
54353
  (errorData?.importee
54361
54354
  ? ` failed to import "${errorData.importee}"`
54362
54355
  : '') +
@@ -54426,10 +54419,10 @@ function bindShortcuts(server, opts) {
54426
54419
  }
54427
54420
  server._shortcutsOptions = opts;
54428
54421
  if (opts.print) {
54429
- server.config.logger.info(picocolorsExports.dim(picocolorsExports.green(' ➜')) +
54430
- picocolorsExports.dim(' press ') +
54431
- picocolorsExports.bold('h') +
54432
- picocolorsExports.dim(' to show help'));
54422
+ server.config.logger.info(colors$1.dim(colors$1.green(' ➜')) +
54423
+ colors$1.dim(' press ') +
54424
+ colors$1.bold('h') +
54425
+ colors$1.dim(' to show help'));
54433
54426
  }
54434
54427
  const shortcuts = (opts.customShortcuts ?? [])
54435
54428
  .filter(isDefined)
@@ -54446,10 +54439,10 @@ function bindShortcuts(server, opts) {
54446
54439
  if (input === 'h') {
54447
54440
  server.config.logger.info([
54448
54441
  '',
54449
- picocolorsExports.bold(' Shortcuts'),
54450
- ...shortcuts.map((shortcut) => picocolorsExports.dim(' press ') +
54451
- picocolorsExports.bold(shortcut.key) +
54452
- picocolorsExports.dim(` to ${shortcut.description}`)),
54442
+ colors$1.bold(' Shortcuts'),
54443
+ ...shortcuts.map((shortcut) => colors$1.dim(' press ') +
54444
+ colors$1.bold(shortcut.key) +
54445
+ colors$1.dim(` to ${shortcut.description}`)),
54453
54446
  ].join('\n'));
54454
54447
  }
54455
54448
  const shortcut = shortcuts.find((shortcut) => shortcut.key === input);
@@ -54504,11 +54497,7 @@ const BASE_SHORTCUTS = [
54504
54497
  },
54505
54498
  ];
54506
54499
 
54507
- var bufferUtilExports = {};
54508
- var bufferUtil$1 = {
54509
- get exports(){ return bufferUtilExports; },
54510
- set exports(v){ bufferUtilExports = v; },
54511
- };
54500
+ var bufferUtil$1 = {exports: {}};
54512
54501
 
54513
54502
  var constants = {
54514
54503
  BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],
@@ -54637,12 +54626,12 @@ if (!process.env.WS_NO_BUFFER_UTIL) {
54637
54626
  try {
54638
54627
  const bufferUtil = require('bufferutil');
54639
54628
 
54640
- bufferUtilExports.mask = function (source, mask, output, offset, length) {
54629
+ bufferUtil$1.exports.mask = function (source, mask, output, offset, length) {
54641
54630
  if (length < 48) _mask(source, mask, output, offset, length);
54642
54631
  else bufferUtil.mask(source, mask, output, offset, length);
54643
54632
  };
54644
54633
 
54645
- bufferUtilExports.unmask = function (buffer, mask) {
54634
+ bufferUtil$1.exports.unmask = function (buffer, mask) {
54646
54635
  if (buffer.length < 32) _unmask(buffer, mask);
54647
54636
  else bufferUtil.unmask(buffer, mask);
54648
54637
  };
@@ -54651,6 +54640,8 @@ if (!process.env.WS_NO_BUFFER_UTIL) {
54651
54640
  }
54652
54641
  }
54653
54642
 
54643
+ var bufferUtilExports = bufferUtil$1.exports;
54644
+
54654
54645
  const kDone = Symbol('kDone');
54655
54646
  const kRun = Symbol('kRun');
54656
54647
 
@@ -55218,11 +55209,7 @@ function inflateOnError(err) {
55218
55209
  this[kCallback](err);
55219
55210
  }
55220
55211
 
55221
- var validationExports = {};
55222
- var validation = {
55223
- get exports(){ return validationExports; },
55224
- set exports(v){ validationExports = v; },
55225
- };
55212
+ var validation = {exports: {}};
55226
55213
 
55227
55214
  const { isUtf8 } = require$$0$b;
55228
55215
 
@@ -55338,14 +55325,14 @@ validation.exports = {
55338
55325
  };
55339
55326
 
55340
55327
  if (isUtf8) {
55341
- validationExports.isValidUTF8 = function (buf) {
55328
+ validation.exports.isValidUTF8 = function (buf) {
55342
55329
  return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
55343
55330
  };
55344
55331
  } /* istanbul ignore else */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {
55345
55332
  try {
55346
55333
  const isValidUTF8 = require('utf-8-validate');
55347
55334
 
55348
- validationExports.isValidUTF8 = function (buf) {
55335
+ validation.exports.isValidUTF8 = function (buf) {
55349
55336
  return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
55350
55337
  };
55351
55338
  } catch (e) {
@@ -55353,6 +55340,8 @@ if (isUtf8) {
55353
55340
  }
55354
55341
  }
55355
55342
 
55343
+ var validationExports = validation.exports;
55344
+
55356
55345
  const { Writable: Writable$1 } = require$$0$7;
55357
55346
 
55358
55347
  const PerMessageDeflate$3 = permessageDeflate;
@@ -58847,6 +58836,8 @@ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
58847
58836
  }
58848
58837
  }
58849
58838
 
58839
+ var WebSocketServerRaw = /*@__PURE__*/getDefaultExportFromCjs(websocketServer);
58840
+
58850
58841
  const HMR_HEADER = 'vite-hmr';
58851
58842
  const wsServerEvents = [
58852
58843
  'connection',
@@ -58869,7 +58860,7 @@ function createWebSocketServer(server, config, httpsOptions) {
58869
58860
  const port = hmrPort || 24678;
58870
58861
  const host = (hmr && hmr.host) || undefined;
58871
58862
  if (wsServer) {
58872
- wss = new websocketServer({ noServer: true });
58863
+ wss = new WebSocketServerRaw({ noServer: true });
58873
58864
  wsServer.on('upgrade', (req, socket, head) => {
58874
58865
  if (req.headers['sec-websocket-protocol'] === HMR_HEADER) {
58875
58866
  wss.handleUpgrade(req, socket, head, (ws) => {
@@ -58900,7 +58891,7 @@ function createWebSocketServer(server, config, httpsOptions) {
58900
58891
  }
58901
58892
  // vite dev server in middleware mode
58902
58893
  // need to call ws listen manually
58903
- wss = new websocketServer({ server: wsHttpServer });
58894
+ wss = new WebSocketServerRaw({ server: wsHttpServer });
58904
58895
  }
58905
58896
  wss.on('connection', (socket) => {
58906
58897
  socket.on('message', (raw) => {
@@ -58920,7 +58911,7 @@ function createWebSocketServer(server, config, httpsOptions) {
58920
58911
  listeners.forEach((listener) => listener(parsed.data, client));
58921
58912
  });
58922
58913
  socket.on('error', (err) => {
58923
- config.logger.error(`${picocolorsExports.red(`ws error:`)}\n${err.stack}`, {
58914
+ config.logger.error(`${colors$1.red(`ws error:`)}\n${err.stack}`, {
58924
58915
  timestamp: true,
58925
58916
  error: err,
58926
58917
  });
@@ -58933,10 +58924,10 @@ function createWebSocketServer(server, config, httpsOptions) {
58933
58924
  });
58934
58925
  wss.on('error', (e) => {
58935
58926
  if (e.code === 'EADDRINUSE') {
58936
- config.logger.error(picocolorsExports.red(`WebSocket server error: Port is already in use`), { error: e });
58927
+ config.logger.error(colors$1.red(`WebSocket server error: Port is already in use`), { error: e });
58937
58928
  }
58938
58929
  else {
58939
- config.logger.error(picocolorsExports.red(`WebSocket server error:\n${e.stack || e.message}`), { error: e });
58930
+ config.logger.error(colors$1.red(`WebSocket server error:\n${e.stack || e.message}`), { error: e });
58940
58931
  }
58941
58932
  });
58942
58933
  // Provide a wrapper to the ws client so we can send messages in JSON format
@@ -59087,23 +59078,9 @@ function baseMiddleware({ config, }) {
59087
59078
  };
59088
59079
  }
59089
59080
 
59090
- var httpProxyExports$1 = {};
59091
- var httpProxy$3 = {
59092
- get exports(){ return httpProxyExports$1; },
59093
- set exports(v){ httpProxyExports$1 = v; },
59094
- };
59095
-
59096
- var httpProxyExports = {};
59097
- var httpProxy$2 = {
59098
- get exports(){ return httpProxyExports; },
59099
- set exports(v){ httpProxyExports = v; },
59100
- };
59081
+ var httpProxy$3 = {exports: {}};
59101
59082
 
59102
- var eventemitter3Exports = {};
59103
- var eventemitter3 = {
59104
- get exports(){ return eventemitter3Exports; },
59105
- set exports(v){ eventemitter3Exports = v; },
59106
- };
59083
+ var eventemitter3 = {exports: {}};
59107
59084
 
59108
59085
  (function (module) {
59109
59086
 
@@ -59440,9 +59417,11 @@ var eventemitter3 = {
59440
59417
  //
59441
59418
  {
59442
59419
  module.exports = EventEmitter;
59443
- }
59420
+ }
59444
59421
  } (eventemitter3));
59445
59422
 
59423
+ var eventemitter3Exports = eventemitter3.exports;
59424
+
59446
59425
  var common$3 = {};
59447
59426
 
59448
59427
  /**
@@ -59880,11 +59859,7 @@ var webOutgoing = { // <--
59880
59859
 
59881
59860
  };
59882
59861
 
59883
- var followRedirectsExports = {};
59884
- var followRedirects$1 = {
59885
- get exports(){ return followRedirectsExports; },
59886
- set exports(v){ followRedirectsExports = v; },
59887
- };
59862
+ var followRedirects$1 = {exports: {}};
59888
59863
 
59889
59864
  var debug$3;
59890
59865
 
@@ -60494,7 +60469,9 @@ function isSubdomain(subdomain, domain) {
60494
60469
 
60495
60470
  // Exports
60496
60471
  followRedirects$1.exports = wrap({ http: http$1, https: https$1 });
60497
- followRedirectsExports.wrap = wrap;
60472
+ followRedirects$1.exports.wrap = wrap;
60473
+
60474
+ var followRedirectsExports = followRedirects$1.exports;
60498
60475
 
60499
60476
  var httpNative = require$$1$1,
60500
60477
  httpsNative = require$$1$2,
@@ -61038,8 +61015,10 @@ var wsIncoming = {
61038
61015
  if(i === false) throw new Error('No such pass');
61039
61016
 
61040
61017
  passes.splice(i++, 0, callback);
61041
- };
61042
- } (httpProxy$2));
61018
+ };
61019
+ } (httpProxy$3));
61020
+
61021
+ var httpProxyExports = httpProxy$3.exports;
61043
61022
 
61044
61023
  // Use explicit /index.js to help browserify negociation in require '/lib/http-proxy' (!)
61045
61024
  var ProxyServer = httpProxyExports.Server;
@@ -61105,7 +61084,7 @@ ProxyServer.createProxy = createProxyServer;
61105
61084
  /**
61106
61085
  * Export the proxy "Server" as the main export.
61107
61086
  */
61108
- var httpProxy$1 = ProxyServer;
61087
+ var httpProxy$2 = ProxyServer;
61109
61088
 
61110
61089
  /*!
61111
61090
  * Caron dimonio, con occhi di bragia
@@ -61119,11 +61098,9 @@ var httpProxy$1 = ProxyServer;
61119
61098
  * Dante - The Divine Comedy (Canto III)
61120
61099
  */
61121
61100
 
61122
- (function (module) {
61123
- module.exports = httpProxy$1;
61124
- } (httpProxy$3));
61101
+ var httpProxy = httpProxy$2;
61125
61102
 
61126
- var httpProxy = /*@__PURE__*/getDefaultExportFromCjs(httpProxyExports$1);
61103
+ var httpProxy$1 = /*@__PURE__*/getDefaultExportFromCjs(httpProxy);
61127
61104
 
61128
61105
  const debug$1 = createDebugger('vite:proxy');
61129
61106
  function proxyMiddleware(httpServer, options, config) {
@@ -61137,7 +61114,7 @@ function proxyMiddleware(httpServer, options, config) {
61137
61114
  if (typeof opts === 'string') {
61138
61115
  opts = { target: opts, changeOrigin: true };
61139
61116
  }
61140
- const proxy = httpProxy.createProxyServer(opts);
61117
+ const proxy = httpProxy$1.createProxyServer(opts);
61141
61118
  if (opts.configure) {
61142
61119
  opts.configure(proxy, opts);
61143
61120
  }
@@ -61145,7 +61122,7 @@ function proxyMiddleware(httpServer, options, config) {
61145
61122
  // When it is ws proxy, res is net.Socket
61146
61123
  const res = originalRes;
61147
61124
  if ('req' in res) {
61148
- config.logger.error(`${picocolorsExports.red(`http proxy error at ${originalRes.req.url}:`)}\n${err.stack}`, {
61125
+ config.logger.error(`${colors$1.red(`http proxy error at ${originalRes.req.url}:`)}\n${err.stack}`, {
61149
61126
  timestamp: true,
61150
61127
  error: err,
61151
61128
  });
@@ -61158,7 +61135,7 @@ function proxyMiddleware(httpServer, options, config) {
61158
61135
  }
61159
61136
  }
61160
61137
  else {
61161
- config.logger.error(`${picocolorsExports.red(`ws proxy error:`)}\n${err.stack}`, {
61138
+ config.logger.error(`${colors$1.red(`ws proxy error:`)}\n${err.stack}`, {
61162
61139
  timestamp: true,
61163
61140
  error: err,
61164
61141
  });
@@ -61224,11 +61201,7 @@ function doesProxyContextMatchUrl(context, url) {
61224
61201
  url.startsWith(context));
61225
61202
  }
61226
61203
 
61227
- var libExports = {};
61228
- var lib = {
61229
- get exports(){ return libExports; },
61230
- set exports(v){ libExports = v; },
61231
- };
61204
+ var lib = {exports: {}};
61232
61205
 
61233
61206
  (function (module, exports) {
61234
61207
 
@@ -61350,10 +61323,11 @@ var lib = {
61350
61323
  return console.log.bind(console);
61351
61324
  }
61352
61325
  return function(){};
61353
- }
61326
+ }
61354
61327
  } (lib));
61355
61328
 
61356
- var history = libExports;
61329
+ var libExports = lib.exports;
61330
+ var history = /*@__PURE__*/getDefaultExportFromCjs(libExports);
61357
61331
 
61358
61332
  function htmlFallbackMiddleware(root, spaFallback) {
61359
61333
  const historyHtmlFallbackMiddleware = history({
@@ -61457,14 +61431,14 @@ function transformMiddleware(server) {
61457
61431
  const rawUrl = removeImportQuery(url);
61458
61432
  warning =
61459
61433
  'Assets in public cannot be imported from JavaScript.\n' +
61460
- `Instead of ${picocolorsExports.cyan(rawUrl)}, put the file in the src directory, and use ${picocolorsExports.cyan(rawUrl.replace(publicPath, '/src/'))} instead.`;
61434
+ `Instead of ${colors$1.cyan(rawUrl)}, put the file in the src directory, and use ${colors$1.cyan(rawUrl.replace(publicPath, '/src/'))} instead.`;
61461
61435
  }
61462
61436
  else {
61463
61437
  warning =
61464
61438
  `files in the public directory are served at the root path.\n` +
61465
- `Instead of ${picocolorsExports.cyan(url)}, use ${picocolorsExports.cyan(url.replace(publicPath, '/'))}.`;
61439
+ `Instead of ${colors$1.cyan(url)}, use ${colors$1.cyan(url.replace(publicPath, '/'))}.`;
61466
61440
  }
61467
- logger.warn(picocolorsExports.yellow(warning));
61441
+ logger.warn(colors$1.yellow(warning));
61468
61442
  }
61469
61443
  }
61470
61444
  if (isJSRequest(url) ||
@@ -62048,11 +62022,7 @@ class ModuleGraph {
62048
62022
  }
62049
62023
  }
62050
62024
 
62051
- var isWslExports = {};
62052
- var isWsl$2 = {
62053
- get exports(){ return isWslExports; },
62054
- set exports(v){ isWslExports = v; },
62055
- };
62025
+ var isWsl$2 = {exports: {}};
62056
62026
 
62057
62027
  const fs$3 = require$$0__default;
62058
62028
 
@@ -62114,6 +62084,8 @@ if (process.env.__IS_WSL_TEST__) {
62114
62084
  isWsl$2.exports = isWsl$1();
62115
62085
  }
62116
62086
 
62087
+ var isWslExports = isWsl$2.exports;
62088
+
62117
62089
  var defineLazyProp = (object, propertyName, fn) => {
62118
62090
  const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
62119
62091
 
@@ -62468,11 +62440,9 @@ open.openApp = openApp;
62468
62440
 
62469
62441
  var open_1 = open;
62470
62442
 
62471
- var crossSpawnExports = {};
62472
- var crossSpawn = {
62473
- get exports(){ return crossSpawnExports; },
62474
- set exports(v){ crossSpawnExports = v; },
62475
- };
62443
+ var open$1 = /*@__PURE__*/getDefaultExportFromCjs(open_1);
62444
+
62445
+ var crossSpawn = {exports: {}};
62476
62446
 
62477
62447
  var windows;
62478
62448
  var hasRequiredWindows;
@@ -62758,11 +62728,7 @@ const whichSync = (cmd, opt) => {
62758
62728
  var which_1 = which$1;
62759
62729
  which$1.sync = whichSync;
62760
62730
 
62761
- var pathKeyExports = {};
62762
- var pathKey$1 = {
62763
- get exports(){ return pathKeyExports; },
62764
- set exports(v){ pathKeyExports = v; },
62765
- };
62731
+ var pathKey$1 = {exports: {}};
62766
62732
 
62767
62733
  const pathKey = (options = {}) => {
62768
62734
  const environment = options.env || process.env;
@@ -62777,7 +62743,9 @@ const pathKey = (options = {}) => {
62777
62743
 
62778
62744
  pathKey$1.exports = pathKey;
62779
62745
  // TODO: Remove this for the next major release
62780
- pathKeyExports.default = pathKey;
62746
+ pathKey$1.exports.default = pathKey;
62747
+
62748
+ var pathKeyExports = pathKey$1.exports;
62781
62749
 
62782
62750
  const path$1 = require$$0$4;
62783
62751
  const which = which_1;
@@ -63099,11 +63067,14 @@ function spawnSync(command, args, options) {
63099
63067
  }
63100
63068
 
63101
63069
  crossSpawn.exports = spawn;
63102
- crossSpawnExports.spawn = spawn;
63103
- crossSpawnExports.sync = spawnSync;
63070
+ crossSpawn.exports.spawn = spawn;
63071
+ crossSpawn.exports.sync = spawnSync;
63072
+
63073
+ crossSpawn.exports._parse = parse;
63074
+ crossSpawn.exports._enoent = enoent;
63104
63075
 
63105
- crossSpawnExports._parse = parse;
63106
- crossSpawnExports._enoent = enoent;
63076
+ var crossSpawnExports = crossSpawn.exports;
63077
+ var spawn$1 = /*@__PURE__*/getDefaultExportFromCjs(crossSpawnExports);
63107
63078
 
63108
63079
  /**
63109
63080
  * The following is modified based on source found in
@@ -63133,12 +63104,12 @@ function openBrowser(url, opt, logger) {
63133
63104
  }
63134
63105
  function executeNodeScript(scriptPath, url, logger) {
63135
63106
  const extraArgs = process.argv.slice(2);
63136
- const child = crossSpawnExports(process.execPath, [scriptPath, ...extraArgs, url], {
63107
+ const child = spawn$1(process.execPath, [scriptPath, ...extraArgs, url], {
63137
63108
  stdio: 'inherit',
63138
63109
  });
63139
63110
  child.on('close', (code) => {
63140
63111
  if (code !== 0) {
63141
- logger.error(picocolorsExports.red(`\nThe script specified as BROWSER environment variable failed.\n\n${picocolorsExports.cyan(scriptPath)} exited with code ${code}.`), { error: null });
63112
+ logger.error(colors$1.red(`\nThe script specified as BROWSER environment variable failed.\n\n${colors$1.cyan(scriptPath)} exited with code ${code}.`), { error: null });
63142
63113
  }
63143
63114
  });
63144
63115
  }
@@ -63192,7 +63163,7 @@ async function startBrowserProcess(browser, browserArgs, url) {
63192
63163
  const options = browser
63193
63164
  ? { app: { name: browser, arguments: browserArgs } }
63194
63165
  : {};
63195
- open_1(url, options).catch(() => { }); // Prevent `unhandledRejection` error.
63166
+ open$1(url, options).catch(() => { }); // Prevent `unhandledRejection` error.
63196
63167
  return true;
63197
63168
  }
63198
63169
  catch (err) {
@@ -63224,7 +63195,7 @@ async function _createServer(inlineConfig = {}, options) {
63224
63195
  disableGlobbing: true,
63225
63196
  ...serverConfig.watch,
63226
63197
  });
63227
- const middlewares = connect();
63198
+ const middlewares = connect$1();
63228
63199
  const httpServer = middlewareMode
63229
63200
  ? null
63230
63201
  : await resolveHttpServer(serverConfig, middlewares, httpsOptions);
@@ -63338,7 +63309,7 @@ async function _createServer(inlineConfig = {}, options) {
63338
63309
  _importGlobMap: new Map(),
63339
63310
  _forceOptimizeOnRestart: false,
63340
63311
  _pendingRequests: new Map(),
63341
- _fsDenyGlob: picomatch$3(config.server.fs.deny, { matchBase: true }),
63312
+ _fsDenyGlob: picomatch$4(config.server.fs.deny, { matchBase: true }),
63342
63313
  _shortcutsOptions: undefined,
63343
63314
  };
63344
63315
  server.transformIndexHtml = createDevHtmlTransformFn(server);
@@ -63385,8 +63356,8 @@ async function _createServer(inlineConfig = {}, options) {
63385
63356
  ws.on('vite:invalidate', async ({ path, message }) => {
63386
63357
  const mod = moduleGraph.urlToModuleMap.get(path);
63387
63358
  if (mod && mod.isSelfAccepting && mod.lastHMRTimestamp > 0) {
63388
- config.logger.info(picocolorsExports.yellow(`hmr invalidate `) +
63389
- picocolorsExports.dim(path) +
63359
+ config.logger.info(colors$1.yellow(`hmr invalidate `) +
63360
+ colors$1.dim(path) +
63390
63361
  (message ? ` ${message}` : ''), { timestamp: true });
63391
63362
  const file = getShortName(mod.file, config.root);
63392
63363
  updateModules(file, [...mod.importers], mod.lastHMRTimestamp, server, true);
@@ -63411,7 +63382,7 @@ async function _createServer(inlineConfig = {}, options) {
63411
63382
  // cors (enabled by default)
63412
63383
  const { cors } = serverConfig;
63413
63384
  if (cors !== false) {
63414
- middlewares.use(libExports$1(typeof cors === 'boolean' ? {} : cors));
63385
+ middlewares.use(corsMiddleware(typeof cors === 'boolean' ? {} : cors));
63415
63386
  }
63416
63387
  // proxy
63417
63388
  const { proxy } = serverConfig;
@@ -63423,7 +63394,7 @@ async function _createServer(inlineConfig = {}, options) {
63423
63394
  middlewares.use(baseMiddleware(server));
63424
63395
  }
63425
63396
  // open in editor support
63426
- middlewares.use('/__open-in-editor', launchEditorMiddleware());
63397
+ middlewares.use('/__open-in-editor', launchEditorMiddleware$1());
63427
63398
  // serve static files under /public
63428
63399
  // this applies before the transform middleware so that these files are served
63429
63400
  // as-is without transforms.
@@ -63575,7 +63546,7 @@ function resolveServerOptions(root, raw, logger) {
63575
63546
  };
63576
63547
  if (server.origin?.endsWith('/')) {
63577
63548
  server.origin = server.origin.slice(0, -1);
63578
- logger.warn(picocolorsExports.yellow(`${picocolorsExports.bold('(!)')} server.origin should not end with "/". Using "${server.origin}" instead.`));
63549
+ logger.warn(colors$1.yellow(`${colors$1.bold('(!)')} server.origin should not end with "/". Using "${server.origin}" instead.`));
63579
63550
  }
63580
63551
  return server;
63581
63552
  }
@@ -63791,7 +63762,7 @@ async function preview(inlineConfig = {}) {
63791
63762
  process.argv[2] === 'preview') {
63792
63763
  throw new Error(`The directory "${config.build.outDir}" does not exist. Did you build your project?`);
63793
63764
  }
63794
- const app = connect();
63765
+ const app = connect$1();
63795
63766
  const httpServer = await resolveHttpServer(config.preview, app, await resolveHttpsConfig(config.preview?.https));
63796
63767
  setClientErrorHandler(httpServer, config.logger);
63797
63768
  const options = config.preview;
@@ -63818,7 +63789,7 @@ async function preview(inlineConfig = {}) {
63818
63789
  // cors
63819
63790
  const { cors } = config.preview;
63820
63791
  if (cors !== false) {
63821
- app.use(libExports$1(typeof cors === 'boolean' ? {} : cors));
63792
+ app.use(corsMiddleware(typeof cors === 'boolean' ? {} : cors));
63822
63793
  }
63823
63794
  // proxy
63824
63795
  const { proxy } = config.preview;
@@ -63902,6 +63873,7 @@ function resolveSSROptions(ssr, preserveSymlinks, buildSsrCjsExternalHeuristics)
63902
63873
  }
63903
63874
 
63904
63875
  const debug = createDebugger('vite:config');
63876
+ const promisifiedRealpath = promisify$4(fs$l.realpath);
63905
63877
  /**
63906
63878
  * Type helper to make it easier to use vite.config.ts
63907
63879
  * accepts a direct {@link UserConfig} object, or a function that returns it.
@@ -64196,16 +64168,16 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
64196
64168
  ]);
64197
64169
  // validate config
64198
64170
  if (middlewareMode === 'ssr') {
64199
- logger.warn(picocolorsExports.yellow(`Setting server.middlewareMode to 'ssr' is deprecated, set server.middlewareMode to \`true\`${config.appType === 'custom' ? '' : ` and appType to 'custom'`} instead`));
64171
+ logger.warn(colors$1.yellow(`Setting server.middlewareMode to 'ssr' is deprecated, set server.middlewareMode to \`true\`${config.appType === 'custom' ? '' : ` and appType to 'custom'`} instead`));
64200
64172
  }
64201
64173
  if (middlewareMode === 'html') {
64202
- logger.warn(picocolorsExports.yellow(`Setting server.middlewareMode to 'html' is deprecated, set server.middlewareMode to \`true\` instead`));
64174
+ logger.warn(colors$1.yellow(`Setting server.middlewareMode to 'html' is deprecated, set server.middlewareMode to \`true\` instead`));
64203
64175
  }
64204
64176
  if (config.server?.force &&
64205
64177
  !isBuild &&
64206
64178
  config.optimizeDeps?.force === undefined) {
64207
64179
  resolved.optimizeDeps.force = true;
64208
- logger.warn(picocolorsExports.yellow(`server.force is deprecated, use optimizeDeps.force instead`));
64180
+ logger.warn(colors$1.yellow(`server.force is deprecated, use optimizeDeps.force instead`));
64209
64181
  }
64210
64182
  debug?.(`using resolved config: %O`, {
64211
64183
  ...resolved,
@@ -64216,7 +64188,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
64216
64188
  },
64217
64189
  });
64218
64190
  if (config.build?.terserOptions && config.build.minify !== 'terser') {
64219
- logger.warn(picocolorsExports.yellow(`build.terserOptions is specified but build.minify is not set to use Terser. ` +
64191
+ logger.warn(colors$1.yellow(`build.terserOptions is specified but build.minify is not set to use Terser. ` +
64220
64192
  `Note Vite now defaults to use esbuild for minification. If you still ` +
64221
64193
  `prefer Terser, set build.minify to "terser".`));
64222
64194
  }
@@ -64230,7 +64202,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
64230
64202
  const firstAssetFileNames = assetFileNamesList[0];
64231
64203
  const hasDifferentReference = assetFileNamesList.some((assetFileNames) => assetFileNames !== firstAssetFileNames);
64232
64204
  if (hasDifferentReference) {
64233
- resolved.logger.warn(picocolorsExports.yellow(`
64205
+ resolved.logger.warn(colors$1.yellow(`
64234
64206
  assetFileNames isn't equal for every build.rollupOptions.output. A single pattern across all outputs is supported by Vite.
64235
64207
  `));
64236
64208
  }
@@ -64244,7 +64216,7 @@ assetFileNames isn't equal for every build.rollupOptions.output. A single patter
64244
64216
  */
64245
64217
  function resolveBaseUrl(base = '/', isBuild, logger) {
64246
64218
  if (base[0] === '.') {
64247
- logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) invalid "base" option: ${base}. The value can only be an absolute ` +
64219
+ logger.warn(colors$1.yellow(colors$1.bold(`(!) invalid "base" option: ${base}. The value can only be an absolute ` +
64248
64220
  `URL, ./, or an empty string.`)));
64249
64221
  return '/';
64250
64222
  }
@@ -64252,7 +64224,7 @@ function resolveBaseUrl(base = '/', isBuild, logger) {
64252
64224
  const isExternal = isExternalUrl(base);
64253
64225
  // no leading slash warn
64254
64226
  if (!isExternal && base[0] !== '/') {
64255
- logger.warn(picocolorsExports.yellow(picocolorsExports.bold(`(!) "base" option should start with a slash.`)));
64227
+ logger.warn(colors$1.yellow(colors$1.bold(`(!) "base" option should start with a slash.`)));
64256
64228
  }
64257
64229
  // parse base when command is serve or base is not External URL
64258
64230
  if (!isBuild || !isExternal) {
@@ -64336,7 +64308,7 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
64336
64308
  };
64337
64309
  }
64338
64310
  catch (e) {
64339
- createLogger(logLevel).error(picocolorsExports.red(`failed to load config from ${resolvedPath}`), { error: e });
64311
+ createLogger(logLevel).error(colors$1.red(`failed to load config from ${resolvedPath}`), { error: e });
64340
64312
  throw e;
64341
64313
  }
64342
64314
  }
@@ -64448,7 +64420,11 @@ async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
64448
64420
  // for cjs, we can register a custom loader via `_require.extensions`
64449
64421
  else {
64450
64422
  const extension = path$o.extname(fileName);
64451
- const realFileName = await fsp.realpath(fileName);
64423
+ // We don't use fsp.realpath() here because it has the same behaviour as
64424
+ // fs.realpath.native. On some Windows systems, it returns uppercase volume
64425
+ // letters (e.g. "C:\") while the Node.js loader uses lowercase volume letters.
64426
+ // See https://github.com/vitejs/vite/issues/12923
64427
+ const realFileName = await promisifiedRealpath(fileName);
64452
64428
  const loaderExt = extension in _require.extensions ? extension : '.js';
64453
64429
  const defaultLoader = _require.extensions[loaderExt];
64454
64430
  _require.extensions[loaderExt] = (module, filename) => {
@@ -64491,4 +64467,4 @@ function isDepsOptimizerEnabled(config, ssr) {
64491
64467
  (command === 'serve' && disabled === 'dev'));
64492
64468
  }
64493
64469
 
64494
- export { loadEnv as A, resolveEnvPrefix as B, picocolorsExports as C, bindShortcuts as D, commonjsGlobal as E, index$1 as F, build$1 as G, index as H, preview$1 as I, preprocessCSS as a, build as b, createServer as c, resolvePackageData as d, buildErrorMessage as e, formatPostcssSourceMap as f, defineConfig as g, resolveConfig as h, isInNodeModules as i, resolveBaseUrl as j, getDepOptimizationConfig as k, loadConfigFromFile as l, isDepsOptimizerEnabled as m, normalizePath$3 as n, optimizeDeps as o, preview as p, mergeConfig as q, resolvePackageEntry as r, sortUserPlugins as s, transformWithEsbuild as t, mergeAlias as u, createFilter as v, send$2 as w, createLogger as x, searchForWorkspaceRoot as y, isFileServingAllowed as z };
64470
+ export { loadEnv as A, resolveEnvPrefix as B, colors$1 as C, bindShortcuts as D, getDefaultExportFromCjs as E, commonjsGlobal as F, index$1 as G, build$1 as H, index as I, preview$1 as J, preprocessCSS as a, build as b, createServer as c, resolvePackageData as d, buildErrorMessage as e, formatPostcssSourceMap as f, defineConfig as g, resolveConfig as h, isInNodeModules as i, resolveBaseUrl as j, getDepOptimizationConfig as k, loadConfigFromFile as l, isDepsOptimizerEnabled as m, normalizePath$3 as n, optimizeDeps as o, preview as p, mergeConfig as q, resolvePackageEntry as r, sortUserPlugins as s, transformWithEsbuild as t, mergeAlias as u, createFilter as v, send$2 as w, createLogger as x, searchForWorkspaceRoot as y, isFileServingAllowed as z };