vite 5.0.0-beta.13 → 5.0.0-beta.14

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.
@@ -10218,7 +10218,7 @@ class TraceMap {
10218
10218
  const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
10219
10219
  this.version = version;
10220
10220
  this.file = file;
10221
- this.names = names;
10221
+ this.names = names || [];
10222
10222
  this.sourceRoot = sourceRoot;
10223
10223
  this.sources = sources;
10224
10224
  this.sourcesContent = sourcesContent;
@@ -11680,7 +11680,7 @@ if (typeof process === 'undefined' || process.type === 'renderer' || process.bro
11680
11680
  }
11681
11681
 
11682
11682
  var srcExports$1 = src$2.exports;
11683
- var debug$h = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1);
11683
+ var debug$i = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1);
11684
11684
 
11685
11685
  let pnp;
11686
11686
  if (process.versions.pnp) {
@@ -12016,7 +12016,7 @@ const _require$2 = createRequire$1(import.meta.url);
12016
12016
  const filter = process.env.VITE_DEBUG_FILTER;
12017
12017
  const DEBUG = process.env.DEBUG;
12018
12018
  function createDebugger(namespace, options = {}) {
12019
- const log = debug$h(namespace);
12019
+ const log = debug$i(namespace);
12020
12020
  const { onlyWhenFocused } = options;
12021
12021
  let enabled = log.enabled;
12022
12022
  if (enabled && onlyWhenFocused) {
@@ -12944,6 +12944,9 @@ function getPackageManagerCommand(type = 'install') {
12944
12944
  throw new TypeError(`Unknown command type: ${type}`);
12945
12945
  }
12946
12946
  }
12947
+ function isDevServer(server) {
12948
+ return 'pluginContainer' in server;
12949
+ }
12947
12950
 
12948
12951
  /* eslint no-console: 0 */
12949
12952
  const LogLevels = {
@@ -14362,7 +14365,7 @@ class TSConfckCache {
14362
14365
  #parsed = new Map();
14363
14366
  }
14364
14367
 
14365
- const debug$g = createDebugger('vite:esbuild');
14368
+ const debug$h = createDebugger('vite:esbuild');
14366
14369
  // IIFE content looks like `var MyLib = function() {`.
14367
14370
  // Spaces are removed and parameters are mangled when minified
14368
14371
  const IIFE_BEGIN_RE = /(const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/;
@@ -14388,7 +14391,6 @@ async function transformWithEsbuild(code, filename, options, inMap) {
14388
14391
  }
14389
14392
  }
14390
14393
  let tsconfigRaw = options?.tsconfigRaw;
14391
- const fallbackSupported = {};
14392
14394
  // if options provide tsconfigRaw in string, it takes highest precedence
14393
14395
  if (typeof tsconfigRaw !== 'string') {
14394
14396
  // these fields would affect the compilation result
@@ -14428,21 +14430,6 @@ async function transformWithEsbuild(code, filename, options, inMap) {
14428
14430
  compilerOptions.target === undefined) {
14429
14431
  compilerOptions.useDefineForClassFields = false;
14430
14432
  }
14431
- // esbuild v0.18 only transforms decorators when `experimentalDecorators` is set to `true`.
14432
- // To preserve compat with the esbuild breaking change, we set `experimentalDecorators` to
14433
- // `true` by default if it's unset.
14434
- // TODO: Remove this in Vite 5
14435
- if (compilerOptions.experimentalDecorators === undefined) {
14436
- compilerOptions.experimentalDecorators = true;
14437
- }
14438
- // Compat with esbuild 0.17 where static properties are transpiled to
14439
- // static blocks when `useDefineForClassFields` is false. Its support
14440
- // is not great yet, so temporarily disable it for now.
14441
- // TODO: Remove this in Vite 5, don't pass hardcoded `esnext` target
14442
- // to `transformWithEsbuild` in the esbuild plugin.
14443
- if (compilerOptions.useDefineForClassFields !== true) {
14444
- fallbackSupported['class-static-blocks'] = false;
14445
- }
14446
14433
  // esbuild uses tsconfig fields when both the normal options and tsconfig was set
14447
14434
  // but we want to prioritize the normal options
14448
14435
  if (options) {
@@ -14463,10 +14450,6 @@ async function transformWithEsbuild(code, filename, options, inMap) {
14463
14450
  ...options,
14464
14451
  loader,
14465
14452
  tsconfigRaw,
14466
- supported: {
14467
- ...fallbackSupported,
14468
- ...options?.supported,
14469
- },
14470
14453
  };
14471
14454
  // Some projects in the ecosystem are calling this function with an ESBuildOptions
14472
14455
  // object and esbuild throws an error for extra fields
@@ -14499,14 +14482,16 @@ async function transformWithEsbuild(code, filename, options, inMap) {
14499
14482
  };
14500
14483
  }
14501
14484
  catch (e) {
14502
- debug$g?.(`esbuild error with options used: `, resolvedOptions);
14485
+ debug$h?.(`esbuild error with options used: `, resolvedOptions);
14503
14486
  // patch error information
14504
14487
  if (e.errors) {
14505
14488
  e.frame = '';
14506
14489
  e.errors.forEach((m) => {
14507
- if (m.text === 'Experimental decorators are not currently enabled') {
14490
+ if (m.text === 'Experimental decorators are not currently enabled' ||
14491
+ m.text ===
14492
+ 'Parameter decorators only work when experimental decorators are enabled') {
14508
14493
  m.text +=
14509
- '. Vite 4.4+ now uses esbuild 0.18 and you need to enable them by adding "experimentalDecorators": true in your "tsconfig.json" file.';
14494
+ '. Vite 5 now uses esbuild 0.18 and you need to enable them by adding "experimentalDecorators": true in your "tsconfig.json" file.';
14510
14495
  }
14511
14496
  e.frame += `\n` + prettifyMessage(m, code);
14512
14497
  });
@@ -16160,7 +16145,7 @@ var convertSourceMap$1 = {};
16160
16145
 
16161
16146
  var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1);
16162
16147
 
16163
- const debug$f = createDebugger('vite:sourcemap', {
16148
+ const debug$g = createDebugger('vite:sourcemap', {
16164
16149
  onlyWhenFocused: true,
16165
16150
  });
16166
16151
  // Virtual modules should be prefixed with a null byte to avoid a
@@ -16199,7 +16184,7 @@ async function injectSourcesContent(map, file, logger) {
16199
16184
  // …to log the missing sources.
16200
16185
  if (missingSources.length) {
16201
16186
  logger.warnOnce(`Sourcemap for "${file}" points to missing source files`);
16202
- debug$f?.(`Missing sources:\n ` + missingSources.join(`\n `));
16187
+ debug$g?.(`Missing sources:\n ` + missingSources.join(`\n `));
16203
16188
  }
16204
16189
  }
16205
16190
  function genSourceMapUrl(map) {
@@ -16209,7 +16194,7 @@ function genSourceMapUrl(map) {
16209
16194
  return `data:application/json;base64,${Buffer.from(map).toString('base64')}`;
16210
16195
  }
16211
16196
  function getCodeWithSourcemap(type, code, map) {
16212
- if (debug$f) {
16197
+ if (debug$g) {
16213
16198
  code += `\n/*${JSON.stringify(map, null, 2).replace(/\*\//g, '*\\/')}*/\n`;
16214
16199
  }
16215
16200
  if (type === 'js') {
@@ -20873,10 +20858,10 @@ function e(e,n,r){throw new Error(r?`No known conditions for "${n}" specifier in
20873
20858
  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];
20874
20859
 
20875
20860
  // This file was generated. Do not modify manually!
20876
- var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];
20861
+ var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
20877
20862
 
20878
20863
  // This file was generated. Do not modify manually!
20879
- var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
20864
+ var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
20880
20865
 
20881
20866
  // This file was generated. Do not modify manually!
20882
20867
  var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
@@ -21144,8 +21129,10 @@ var isArray = Array.isArray || (function (obj) { return (
21144
21129
  toString$1.call(obj) === "[object Array]"
21145
21130
  ); });
21146
21131
 
21132
+ var regexpCache = Object.create(null);
21133
+
21147
21134
  function wordsRegexp(words) {
21148
- return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
21135
+ return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
21149
21136
  }
21150
21137
 
21151
21138
  function codePointToString(code) {
@@ -21205,11 +21192,11 @@ var defaultOptions = {
21205
21192
  // Can be either `"script"` or `"module"`. This influences global
21206
21193
  // strict mode and parsing of `import` and `export` declarations.
21207
21194
  sourceType: "script",
21208
- // `onInsertedSemicolon` can be a callback that will be called
21209
- // when a semicolon is automatically inserted. It will be passed
21210
- // the position of the comma as an offset, and if `locations` is
21211
- // enabled, it is given the location as a `{line, column}` object
21212
- // as second argument.
21195
+ // `onInsertedSemicolon` can be a callback that will be called when
21196
+ // a semicolon is automatically inserted. It will be passed the
21197
+ // position of the inserted semicolon as an offset, and if
21198
+ // `locations` is enabled, it is given the location as a `{line,
21199
+ // column}` object as second argument.
21213
21200
  onInsertedSemicolon: null,
21214
21201
  // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
21215
21202
  // trailing commas.
@@ -21262,6 +21249,8 @@ var defaultOptions = {
21262
21249
  // passed, the full `{line, column}` locations of the start and
21263
21250
  // end of the comments. Note that you are not allowed to call the
21264
21251
  // parser from the callback—that will corrupt its internal state.
21252
+ // When this option has an array as value, objects representing the
21253
+ // comments are pushed to it.
21265
21254
  onComment: null,
21266
21255
  // Nodes have their start and end characters offsets recorded in
21267
21256
  // `start` and `end` properties (directly on the node, rather than
@@ -22637,8 +22626,6 @@ pp$8.checkPatternExport = function(exports, pat) {
22637
22626
  { this.checkPatternExport(exports, pat.left); }
22638
22627
  else if (type === "RestElement")
22639
22628
  { this.checkPatternExport(exports, pat.argument); }
22640
- else if (type === "ParenthesizedExpression")
22641
- { this.checkPatternExport(exports, pat.expression); }
22642
22629
  };
22643
22630
 
22644
22631
  pp$8.checkVariableExport = function(exports, decls) {
@@ -23202,7 +23189,7 @@ pp$6.updateContext = function(prevType) {
23202
23189
  { this.exprAllowed = type.beforeExpr; }
23203
23190
  };
23204
23191
 
23205
- // Used to handle egde cases when token context could not be inferred correctly during tokenization phase
23192
+ // Used to handle edge cases when token context could not be inferred correctly during tokenization phase
23206
23193
 
23207
23194
  pp$6.overrideContext = function(tokenCtx) {
23208
23195
  if (this.curContext() !== tokenCtx) {
@@ -23255,6 +23242,11 @@ types$1._function.updateContext = types$1._class.updateContext = function(prevTy
23255
23242
  this.exprAllowed = false;
23256
23243
  };
23257
23244
 
23245
+ types$1.colon.updateContext = function() {
23246
+ if (this.curContext().token === "function") { this.context.pop(); }
23247
+ this.exprAllowed = true;
23248
+ };
23249
+
23258
23250
  types$1.backQuote.updateContext = function() {
23259
23251
  if (this.curContext() === types$2.q_tmpl)
23260
23252
  { this.context.pop(); }
@@ -23953,9 +23945,12 @@ var empty = [];
23953
23945
  pp$5.parseNew = function() {
23954
23946
  if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
23955
23947
  var node = this.startNode();
23956
- var meta = this.parseIdent(true);
23957
- if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) {
23958
- node.meta = meta;
23948
+ this.next();
23949
+ if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
23950
+ var meta = this.startNodeAt(node.start, node.startLoc);
23951
+ meta.name = "new";
23952
+ node.meta = this.finishNode(meta, "Identifier");
23953
+ this.next();
23959
23954
  var containsEsc = this.containsEsc;
23960
23955
  node.property = this.parseIdent(true);
23961
23956
  if (node.property.name !== "target")
@@ -24357,6 +24352,7 @@ pp$5.parseIdentNode = function() {
24357
24352
  (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
24358
24353
  this.context.pop();
24359
24354
  }
24355
+ this.type = types$1.name;
24360
24356
  } else {
24361
24357
  this.unexpected();
24362
24358
  }
@@ -26779,7 +26775,7 @@ pp.readWord = function() {
26779
26775
  // [walk]: util/walk.js
26780
26776
 
26781
26777
 
26782
- var version$2 = "8.10.0";
26778
+ var version$2 = "8.11.2";
26783
26779
 
26784
26780
  Parser$1.acorn = {
26785
26781
  Parser: Parser$1,
@@ -27437,7 +27433,7 @@ const browserExternalId = '__vite-browser-external';
27437
27433
  const optionalPeerDepId = '__vite-optional-peer-dep';
27438
27434
  const subpathImportsPrefix = '#';
27439
27435
  const startsWithWordCharRE = /^\w/;
27440
- const debug$e = createDebugger('vite:resolve-details', {
27436
+ const debug$f = createDebugger('vite:resolve-details', {
27441
27437
  onlyWhenFocused: true,
27442
27438
  });
27443
27439
  function resolvePlugin(resolveOptions) {
@@ -27511,7 +27507,7 @@ function resolvePlugin(resolveOptions) {
27511
27507
  // We don't need to resolve these paths since they are already resolved
27512
27508
  // always return here even if res doesn't exist since /@fs/ is explicit
27513
27509
  // if the file doesn't exist it should be a 404.
27514
- debug$e?.(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27510
+ debug$f?.(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27515
27511
  return ensureVersionQuery(res, id, options, depsOptimizer);
27516
27512
  }
27517
27513
  // URL
@@ -27521,7 +27517,7 @@ function resolvePlugin(resolveOptions) {
27521
27517
  (rootInRoot || !id.startsWith(withTrailingSlash(root)))) {
27522
27518
  const fsPath = path$o.resolve(root, id.slice(1));
27523
27519
  if ((res = tryFsResolve(fsPath, options))) {
27524
- debug$e?.(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27520
+ debug$f?.(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27525
27521
  return ensureVersionQuery(res, id, options, depsOptimizer);
27526
27522
  }
27527
27523
  }
@@ -27552,7 +27548,7 @@ function resolvePlugin(resolveOptions) {
27552
27548
  }
27553
27549
  if ((res = tryFsResolve(fsPath, options))) {
27554
27550
  res = ensureVersionQuery(res, id, options, depsOptimizer);
27555
- debug$e?.(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27551
+ debug$f?.(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27556
27552
  // If this isn't a script imported from a .html file, include side effects
27557
27553
  // hints so the non-used code is properly tree-shaken during build time.
27558
27554
  if (!options.idOnly &&
@@ -27575,14 +27571,14 @@ function resolvePlugin(resolveOptions) {
27575
27571
  const basedir = importer ? path$o.dirname(importer) : process.cwd();
27576
27572
  const fsPath = path$o.resolve(basedir, id);
27577
27573
  if ((res = tryFsResolve(fsPath, options))) {
27578
- debug$e?.(`[drive-relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27574
+ debug$f?.(`[drive-relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27579
27575
  return ensureVersionQuery(res, id, options, depsOptimizer);
27580
27576
  }
27581
27577
  }
27582
27578
  // absolute fs paths
27583
27579
  if (isNonDriveRelativeAbsolutePath(id) &&
27584
27580
  (res = tryFsResolve(id, options))) {
27585
- debug$e?.(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27581
+ debug$f?.(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
27586
27582
  return ensureVersionQuery(res, id, options, depsOptimizer);
27587
27583
  }
27588
27584
  // external
@@ -27628,7 +27624,7 @@ function resolvePlugin(resolveOptions) {
27628
27624
  }
27629
27625
  else {
27630
27626
  if (!asSrc) {
27631
- debug$e?.(`externalized node built-in "${id}" to empty module. ` +
27627
+ debug$f?.(`externalized node built-in "${id}" to empty module. ` +
27632
27628
  `(imported by: ${colors$1.white(colors$1.dim(importer))})`);
27633
27629
  }
27634
27630
  else if (isProduction) {
@@ -27641,7 +27637,7 @@ function resolvePlugin(resolveOptions) {
27641
27637
  }
27642
27638
  }
27643
27639
  }
27644
- debug$e?.(`[fallthrough] ${colors$1.dim(id)}`);
27640
+ debug$f?.(`[fallthrough] ${colors$1.dim(id)}`);
27645
27641
  },
27646
27642
  load(id) {
27647
27643
  if (id.startsWith(browserExternalId)) {
@@ -27894,7 +27890,7 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr = f
27894
27890
  const index = resolved.id.indexOf(id);
27895
27891
  if (index > -1) {
27896
27892
  resolvedId = resolved.id.slice(index);
27897
- debug$e?.(`[processResult] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedId)}`);
27893
+ debug$f?.(`[processResult] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedId)}`);
27898
27894
  }
27899
27895
  }
27900
27896
  return { ...resolved, id: resolvedId, external: true };
@@ -28105,7 +28101,7 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
28105
28101
  const entryPointPath = path$o.join(dir, entry);
28106
28102
  const resolvedEntryPoint = tryFsResolve(entryPointPath, options, true, true, skipPackageJson);
28107
28103
  if (resolvedEntryPoint) {
28108
- debug$e?.(`[package entry] ${colors$1.cyan(idWithoutPostfix)} -> ${colors$1.dim(resolvedEntryPoint)}${postfix !== '' ? ` (postfix: ${postfix})` : ''}`);
28104
+ debug$f?.(`[package entry] ${colors$1.cyan(idWithoutPostfix)} -> ${colors$1.dim(resolvedEntryPoint)}${postfix !== '' ? ` (postfix: ${postfix})` : ''}`);
28109
28105
  setResolvedCache('.', resolvedEntryPoint, targetWeb);
28110
28106
  return resolvedEntryPoint + postfix;
28111
28107
  }
@@ -28193,7 +28189,7 @@ function resolveDeepImport(id, { webResolvedImports, setResolvedCache, getResolv
28193
28189
  const resolved = tryFsResolve(path$o.join(dir, relativeId), options, !exportsField, // try index only if no exports field
28194
28190
  targetWeb);
28195
28191
  if (resolved) {
28196
- debug$e?.(`[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}`);
28192
+ debug$f?.(`[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}`);
28197
28193
  setResolvedCache(id, resolved, targetWeb);
28198
28194
  return resolved;
28199
28195
  }
@@ -28210,7 +28206,7 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath, externalize
28210
28206
  if ((res = bareImportRE.test(browserMappedPath)
28211
28207
  ? tryNodeResolve(browserMappedPath, importer, options, true)?.id
28212
28208
  : tryFsResolve(path$o.join(pkg.dir, browserMappedPath), options))) {
28213
- debug$e?.(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
28209
+ debug$f?.(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
28214
28210
  let result = { id: res };
28215
28211
  if (options.idOnly) {
28216
28212
  return result;
@@ -36950,7 +36946,7 @@ function handleParseError(parserError, html, filePath) {
36950
36946
  * Compiles index.html into an entry js module
36951
36947
  */
36952
36948
  function buildHtmlPlugin(config) {
36953
- const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(config.plugins);
36949
+ const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(config.plugins, config.logger);
36954
36950
  preHooks.unshift(preImportMapHook(config));
36955
36951
  preHooks.push(htmlEnvHook(config));
36956
36952
  postHooks.push(postImportMapHook());
@@ -37475,7 +37471,7 @@ function htmlEnvHook(config) {
37475
37471
  });
37476
37472
  };
37477
37473
  }
37478
- function resolveHtmlTransforms(plugins) {
37474
+ function resolveHtmlTransforms(plugins, logger) {
37479
37475
  const preHooks = [];
37480
37476
  const normalHooks = [];
37481
37477
  const postHooks = [];
@@ -37487,6 +37483,12 @@ function resolveHtmlTransforms(plugins) {
37487
37483
  normalHooks.push(hook);
37488
37484
  }
37489
37485
  else {
37486
+ if (!('order' in hook) && 'enforce' in hook) {
37487
+ logger.warnOnce(colors$1.yellow(`plugin '${plugin.name}' uses deprecated 'enforce' option. Use 'order' option instead.`));
37488
+ }
37489
+ if (!('handler' in hook) && 'transform' in hook) {
37490
+ logger.warnOnce(colors$1.yellow(`plugin '${plugin.name}' uses deprecated 'transform' option. Use 'handler' option instead.`));
37491
+ }
37490
37492
  // `enforce` had only two possible values for the `transformIndexHtml` hook
37491
37493
  // `'pre'` and `'post'` (the default). `order` now works with three values
37492
37494
  // to align with other hooks (`'pre'`, normal, and `'post'`). We map
@@ -38477,8 +38479,8 @@ function createCachedImport(imp) {
38477
38479
  return cached;
38478
38480
  };
38479
38481
  }
38480
- const importPostcssImport = createCachedImport(() => import('./dep-gEG0N6Wc.js').then(function (n) { return n.i; }));
38481
- const importPostcssModules = createCachedImport(() => import('./dep-65DCjPft.js').then(function (n) { return n.i; }));
38482
+ const importPostcssImport = createCachedImport(() => import('./dep-L-2yzs6m.js').then(function (n) { return n.i; }));
38483
+ const importPostcssModules = createCachedImport(() => import('./dep-OMqKnqdS.js').then(function (n) { return n.i; }));
38482
38484
  const importPostcss = createCachedImport(() => import('postcss'));
38483
38485
  /**
38484
38486
  * @experimental
@@ -39567,7 +39569,7 @@ function esbuildCjsExternalPlugin(externals, platform) {
39567
39569
  };
39568
39570
  }
39569
39571
 
39570
- const debug$d = createDebugger('vite:ssr-external');
39572
+ const debug$e = createDebugger('vite:ssr-external');
39571
39573
  const isSsrExternalCache = new WeakMap();
39572
39574
  function shouldExternalizeForSSR(id, importer, config) {
39573
39575
  let isSsrExternal = isSsrExternalCache.get(config);
@@ -39608,7 +39610,7 @@ function createIsConfiguredAsSsrExternal(config) {
39608
39610
  !!configuredAsExternal)?.external;
39609
39611
  }
39610
39612
  catch (e) {
39611
- debug$d?.(`Failed to node resolve "${id}". Skipping externalizing it by default.`);
39613
+ debug$e?.(`Failed to node resolve "${id}". Skipping externalizing it by default.`);
39612
39614
  // may be an invalid import that's resolved by a plugin
39613
39615
  return false;
39614
39616
  }
@@ -39718,7 +39720,7 @@ function jsonPlugin(options = {}, isBuild) {
39718
39720
 
39719
39721
  const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = 'ERR_OPTIMIZE_DEPS_PROCESSING_ERROR';
39720
39722
  const ERR_OUTDATED_OPTIMIZED_DEP = 'ERR_OUTDATED_OPTIMIZED_DEP';
39721
- const debug$c = createDebugger('vite:optimize-deps');
39723
+ const debug$d = createDebugger('vite:optimize-deps');
39722
39724
  function optimizedDepsPlugin(config) {
39723
39725
  return {
39724
39726
  name: 'vite:optimized-deps',
@@ -39765,7 +39767,7 @@ function optimizedDepsPlugin(config) {
39765
39767
  }
39766
39768
  }
39767
39769
  }
39768
- debug$c?.(`load ${colors$1.cyan(file)}`);
39770
+ debug$d?.(`load ${colors$1.cyan(file)}`);
39769
39771
  // Load the file from the cache instead of waiting for other plugin
39770
39772
  // load hooks to avoid race conditions, once processing is resolved,
39771
39773
  // we are sure that the file has been properly save to disk
@@ -39825,7 +39827,7 @@ function optimizedDepsBuildPlugin(config) {
39825
39827
  const info = optimizedDepInfoFromFile(depsOptimizer.metadata, file);
39826
39828
  if (info) {
39827
39829
  await info.processing;
39828
- debug$c?.(`load ${colors$1.cyan(file)}`);
39830
+ debug$d?.(`load ${colors$1.cyan(file)}`);
39829
39831
  }
39830
39832
  else {
39831
39833
  throw new Error(`Something unexpected happened while optimizing "${id}".`);
@@ -40550,7 +40552,7 @@ var src = {exports: {}};
40550
40552
 
40551
40553
  var node = {exports: {}};
40552
40554
 
40553
- var debug$b = {exports: {}};
40555
+ var debug$c = {exports: {}};
40554
40556
 
40555
40557
  /**
40556
40558
  * Helpers.
@@ -40716,7 +40718,7 @@ function requireMs () {
40716
40718
  var hasRequiredDebug;
40717
40719
 
40718
40720
  function requireDebug () {
40719
- if (hasRequiredDebug) return debug$b.exports;
40721
+ if (hasRequiredDebug) return debug$c.exports;
40720
40722
  hasRequiredDebug = 1;
40721
40723
  (function (module, exports) {
40722
40724
  /**
@@ -40920,8 +40922,8 @@ function requireDebug () {
40920
40922
  if (val instanceof Error) return val.stack || val.message;
40921
40923
  return val;
40922
40924
  }
40923
- } (debug$b, debug$b.exports));
40924
- return debug$b.exports;
40925
+ } (debug$c, debug$c.exports));
40926
+ return debug$c.exports;
40925
40927
  }
40926
40928
 
40927
40929
  /**
@@ -42240,7 +42242,7 @@ function unpipe$1(stream) {
42240
42242
  * @private
42241
42243
  */
42242
42244
 
42243
- var debug$a = srcExports('finalhandler');
42245
+ var debug$b = srcExports('finalhandler');
42244
42246
  var encodeUrl = encodeurl;
42245
42247
  var escapeHtml = escapeHtml_1;
42246
42248
  var onFinished = onFinishedExports;
@@ -42319,7 +42321,7 @@ function finalhandler$1 (req, res, options) {
42319
42321
 
42320
42322
  // ignore 404 on in-flight response
42321
42323
  if (!err && headersSent(res)) {
42322
- debug$a('cannot 404 after headers sent');
42324
+ debug$b('cannot 404 after headers sent');
42323
42325
  return
42324
42326
  }
42325
42327
 
@@ -42344,7 +42346,7 @@ function finalhandler$1 (req, res, options) {
42344
42346
  msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req));
42345
42347
  }
42346
42348
 
42347
- debug$a('default %s', status);
42349
+ debug$b('default %s', status);
42348
42350
 
42349
42351
  // schedule onerror callback
42350
42352
  if (err && onerror) {
@@ -42353,7 +42355,7 @@ function finalhandler$1 (req, res, options) {
42353
42355
 
42354
42356
  // cannot actually respond
42355
42357
  if (headersSent(res)) {
42356
- debug$a('cannot %d after headers sent', status);
42358
+ debug$b('cannot %d after headers sent', status);
42357
42359
  req.socket.destroy();
42358
42360
  return
42359
42361
  }
@@ -42602,7 +42604,7 @@ var utilsMergeExports = utilsMerge.exports;
42602
42604
  * @private
42603
42605
  */
42604
42606
 
42605
- var debug$9 = srcExports('connect:dispatcher');
42607
+ var debug$a = srcExports('connect:dispatcher');
42606
42608
  var EventEmitter$3 = require$$0$5.EventEmitter;
42607
42609
  var finalhandler = finalhandler_1;
42608
42610
  var http$4 = require$$1$1;
@@ -42692,7 +42694,7 @@ proto.use = function use(route, fn) {
42692
42694
  }
42693
42695
 
42694
42696
  // add the middleware
42695
- debug$9('use %s %s', path || '/', handle.name || 'anonymous');
42697
+ debug$a('use %s %s', path || '/', handle.name || 'anonymous');
42696
42698
  this.stack.push({ route: path, handle: handle });
42697
42699
 
42698
42700
  return this;
@@ -42816,7 +42818,7 @@ function call(handle, route, err, req, res, next) {
42816
42818
  var error = err;
42817
42819
  var hasError = Boolean(err);
42818
42820
 
42819
- debug$9('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);
42821
+ debug$a('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);
42820
42822
 
42821
42823
  try {
42822
42824
  if (hasError && arity === 4) {
@@ -42869,7 +42871,7 @@ function getProtohost(url) {
42869
42871
 
42870
42872
  var connect$1 = /*@__PURE__*/getDefaultExportFromCjs(connect);
42871
42873
 
42872
- var lib$1 = {exports: {}};
42874
+ var lib = {exports: {}};
42873
42875
 
42874
42876
  /*
42875
42877
  object-assign
@@ -43345,12 +43347,12 @@ var varyExports = vary$1.exports;
43345
43347
  }
43346
43348
 
43347
43349
  // can pass either an options hash, an options delegate, or nothing
43348
- lib$1.exports = middlewareWrapper;
43350
+ lib.exports = middlewareWrapper;
43349
43351
 
43350
43352
  }());
43351
43353
 
43352
- var libExports$1 = lib$1.exports;
43353
- var corsMiddleware = /*@__PURE__*/getDefaultExportFromCjs(libExports$1);
43354
+ var libExports = lib.exports;
43355
+ var corsMiddleware = /*@__PURE__*/getDefaultExportFromCjs(libExports);
43354
43356
 
43355
43357
  var chokidar = {};
43356
43358
 
@@ -50152,9 +50154,9 @@ function bindCLIShortcuts(server, opts) {
50152
50154
  colors$1.bold('h + enter') +
50153
50155
  colors$1.dim(' to show help'));
50154
50156
  }
50155
- const shortcuts = (opts?.customShortcuts ?? [])
50156
- // @ts-expect-error passing the right types, but typescript can't detect it
50157
- .concat(isDev ? BASE_DEV_SHORTCUTS : BASE_PREVIEW_SHORTCUTS);
50157
+ const shortcuts = (opts?.customShortcuts ?? []).concat((isDev
50158
+ ? BASE_DEV_SHORTCUTS
50159
+ : BASE_PREVIEW_SHORTCUTS));
50158
50160
  let actionRunning = false;
50159
50161
  const onInput = async (input) => {
50160
50162
  if (actionRunning)
@@ -50183,9 +50185,6 @@ function bindCLIShortcuts(server, opts) {
50183
50185
  rl.on('line', onInput);
50184
50186
  server.httpServer.on('close', () => rl.close());
50185
50187
  }
50186
- function isDevServer(server) {
50187
- return 'pluginContainer' in server;
50188
- }
50189
50188
  const BASE_DEV_SHORTCUTS = [
50190
50189
  {
50191
50190
  key: 'r',
@@ -55741,20 +55740,20 @@ var webOutgoing = { // <--
55741
55740
 
55742
55741
  var followRedirects$1 = {exports: {}};
55743
55742
 
55744
- var debug$8;
55743
+ var debug$9;
55745
55744
 
55746
55745
  var debug_1 = function () {
55747
- if (!debug$8) {
55746
+ if (!debug$9) {
55748
55747
  try {
55749
55748
  /* eslint global-require: off */
55750
- debug$8 = srcExports$1("follow-redirects");
55749
+ debug$9 = srcExports$1("follow-redirects");
55751
55750
  }
55752
55751
  catch (error) { /* */ }
55753
- if (typeof debug$8 !== "function") {
55754
- debug$8 = function () { /* */ };
55752
+ if (typeof debug$9 !== "function") {
55753
+ debug$9 = function () { /* */ };
55755
55754
  }
55756
55755
  }
55757
- debug$8.apply(null, arguments);
55756
+ debug$9.apply(null, arguments);
55758
55757
  };
55759
55758
 
55760
55759
  var url = require$$0$9;
@@ -55763,7 +55762,7 @@ var http$1 = require$$1$1;
55763
55762
  var https$1 = require$$1$2;
55764
55763
  var Writable = require$$0$7.Writable;
55765
55764
  var assert = require$$5;
55766
- var debug$7 = debug_1;
55765
+ var debug$8 = debug_1;
55767
55766
 
55768
55767
  // Create handlers that pass events from native requests
55769
55768
  var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
@@ -56168,7 +56167,7 @@ RedirectableRequest.prototype._processResponse = function (response) {
56168
56167
  }
56169
56168
 
56170
56169
  // Create the redirected request
56171
- debug$7("redirecting to", redirectUrl);
56170
+ debug$8("redirecting to", redirectUrl);
56172
56171
  this._isRedirect = true;
56173
56172
  var redirectUrlParts = url.parse(redirectUrl);
56174
56173
  Object.assign(this._options, redirectUrlParts);
@@ -56261,7 +56260,7 @@ function wrap(protocols) {
56261
56260
  options.nativeProtocols = nativeProtocols;
56262
56261
 
56263
56262
  assert.equal(options.protocol, protocol, "protocol mismatch");
56264
- debug$7("options", options);
56263
+ debug$8("options", options);
56265
56264
  return new RedirectableRequest(options, callback);
56266
56265
  }
56267
56266
 
@@ -56982,7 +56981,7 @@ var httpProxy = httpProxy$2;
56982
56981
 
56983
56982
  var httpProxy$1 = /*@__PURE__*/getDefaultExportFromCjs(httpProxy);
56984
56983
 
56985
- const debug$6 = createDebugger('vite:proxy');
56984
+ const debug$7 = createDebugger('vite:proxy');
56986
56985
  function proxyMiddleware(httpServer, options, config) {
56987
56986
  // lazy require only when proxy is used
56988
56987
  const proxies = {};
@@ -57042,7 +57041,7 @@ function proxyMiddleware(httpServer, options, config) {
57042
57041
  proxy.on('proxyRes', (proxyRes, req, res) => {
57043
57042
  res.on('close', () => {
57044
57043
  if (!res.writableEnded) {
57045
- debug$6?.('destroying proxyRes in proxyRes close event');
57044
+ debug$7?.('destroying proxyRes in proxyRes close event');
57046
57045
  proxyRes.destroy();
57047
57046
  }
57048
57047
  });
@@ -57062,7 +57061,7 @@ function proxyMiddleware(httpServer, options, config) {
57062
57061
  if (opts.rewrite) {
57063
57062
  req.url = opts.rewrite(url);
57064
57063
  }
57065
- debug$6?.(`${req.url} -> ws ${opts.target}`);
57064
+ debug$7?.(`${req.url} -> ws ${opts.target}`);
57066
57065
  proxy.ws(req, socket, head);
57067
57066
  return;
57068
57067
  }
@@ -57081,16 +57080,16 @@ function proxyMiddleware(httpServer, options, config) {
57081
57080
  const bypassResult = opts.bypass(req, res, opts);
57082
57081
  if (typeof bypassResult === 'string') {
57083
57082
  req.url = bypassResult;
57084
- debug$6?.(`bypass: ${req.url} -> ${bypassResult}`);
57083
+ debug$7?.(`bypass: ${req.url} -> ${bypassResult}`);
57085
57084
  return next();
57086
57085
  }
57087
57086
  else if (bypassResult === false) {
57088
- debug$6?.(`bypass: ${req.url} -> 404`);
57087
+ debug$7?.(`bypass: ${req.url} -> 404`);
57089
57088
  res.statusCode = 404;
57090
57089
  return res.end();
57091
57090
  }
57092
57091
  }
57093
- debug$6?.(`${req.url} -> ${opts.target || opts.forward}`);
57092
+ debug$7?.(`${req.url} -> ${opts.target || opts.forward}`);
57094
57093
  if (opts.rewrite) {
57095
57094
  req.url = opts.rewrite(req.url);
57096
57095
  }
@@ -57106,167 +57105,72 @@ function doesProxyContextMatchUrl(context, url) {
57106
57105
  url.startsWith(context));
57107
57106
  }
57108
57107
 
57109
- var lib = {exports: {}};
57110
-
57111
- (function (module, exports) {
57112
-
57113
- var url = require$$0$9;
57114
-
57115
- module.exports = function historyApiFallback(options) {
57116
- options = options || {};
57117
- var logger = getLogger(options);
57118
-
57119
- return function(req, res, next) {
57120
- var headers = req.headers;
57121
- if (req.method !== 'GET' && req.method !== 'HEAD') {
57122
- logger(
57123
- 'Not rewriting',
57124
- req.method,
57125
- req.url,
57126
- 'because the method is not GET or HEAD.'
57127
- );
57128
- return next();
57129
- } else if (!headers || typeof headers.accept !== 'string') {
57130
- logger(
57131
- 'Not rewriting',
57132
- req.method,
57133
- req.url,
57134
- 'because the client did not send an HTTP accept header.'
57135
- );
57136
- return next();
57137
- } else if (headers.accept.indexOf('application/json') === 0) {
57138
- logger(
57139
- 'Not rewriting',
57140
- req.method,
57141
- req.url,
57142
- 'because the client prefers JSON.'
57143
- );
57144
- return next();
57145
- } else if (!acceptsHtml(headers.accept, options)) {
57146
- logger(
57147
- 'Not rewriting',
57148
- req.method,
57149
- req.url,
57150
- 'because the client does not accept HTML.'
57151
- );
57152
- return next();
57153
- }
57154
-
57155
- var parsedUrl = url.parse(req.url);
57156
- var rewriteTarget;
57157
- options.rewrites = options.rewrites || [];
57158
- for (var i = 0; i < options.rewrites.length; i++) {
57159
- var rewrite = options.rewrites[i];
57160
- var match = parsedUrl.pathname.match(rewrite.from);
57161
- if (match !== null) {
57162
- rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to, req);
57163
-
57164
- if(rewriteTarget.charAt(0) !== '/') {
57165
- logger(
57166
- 'We recommend using an absolute path for the rewrite target.',
57167
- 'Received a non-absolute rewrite target',
57168
- rewriteTarget,
57169
- 'for URL',
57170
- req.url
57171
- );
57172
- }
57173
-
57174
- logger('Rewriting', req.method, req.url, 'to', rewriteTarget);
57175
- req.url = rewriteTarget;
57176
- return next();
57177
- }
57178
- }
57179
-
57180
- var pathname = parsedUrl.pathname;
57181
- if (pathname.lastIndexOf('.') > pathname.lastIndexOf('/') &&
57182
- options.disableDotRule !== true) {
57183
- logger(
57184
- 'Not rewriting',
57185
- req.method,
57186
- req.url,
57187
- 'because the path includes a dot (.) character.'
57188
- );
57189
- return next();
57190
- }
57191
-
57192
- rewriteTarget = options.index || '/index.html';
57193
- logger('Rewriting', req.method, req.url, 'to', rewriteTarget);
57194
- req.url = rewriteTarget;
57195
- next();
57196
- };
57197
- };
57198
-
57199
- function evaluateRewriteRule(parsedUrl, match, rule, req) {
57200
- if (typeof rule === 'string') {
57201
- return rule;
57202
- } else if (typeof rule !== 'function') {
57203
- throw new Error('Rewrite rule can only be of type string or function.');
57204
- }
57205
-
57206
- return rule({
57207
- parsedUrl: parsedUrl,
57208
- match: match,
57209
- request: req
57210
- });
57211
- }
57212
-
57213
- function acceptsHtml(header, options) {
57214
- options.htmlAcceptHeaders = options.htmlAcceptHeaders || ['text/html', '*/*'];
57215
- for (var i = 0; i < options.htmlAcceptHeaders.length; i++) {
57216
- if (header.indexOf(options.htmlAcceptHeaders[i]) !== -1) {
57217
- return true;
57218
- }
57219
- }
57220
- return false;
57221
- }
57222
-
57223
- function getLogger(options) {
57224
- if (options && options.logger) {
57225
- return options.logger;
57226
- } else if (options && options.verbose) {
57227
- // eslint-disable-next-line no-console
57228
- return console.log.bind(console);
57229
- }
57230
- return function(){};
57231
- }
57232
- } (lib));
57233
-
57234
- var libExports = lib.exports;
57235
- var history = /*@__PURE__*/getDefaultExportFromCjs(libExports);
57236
-
57237
- function htmlFallbackMiddleware(root, spaFallback) {
57238
- const historyHtmlFallbackMiddleware = history({
57239
- disableDotRule: true,
57240
- logger: createDebugger('vite:html-fallback'),
57241
- rewrites: [
57242
- // support /dir/ without explicit index.html
57243
- {
57244
- from: /\/$/,
57245
- to({ parsedUrl, request }) {
57246
- const rewritten = decodeURIComponent(parsedUrl.pathname) + 'index.html';
57247
- if (fs$l.existsSync(path$o.join(root, rewritten))) {
57248
- return rewritten;
57249
- }
57250
- return spaFallback ? `/index.html` : request.url;
57251
- },
57252
- },
57253
- {
57254
- from: /\.html$/,
57255
- to({ parsedUrl, request }) {
57256
- // .html files are not handled by serveStaticMiddleware
57257
- // so we need to check if the file exists
57258
- const pathname = decodeURIComponent(parsedUrl.pathname);
57259
- if (fs$l.existsSync(path$o.join(root, pathname))) {
57260
- return request.url;
57261
- }
57262
- return spaFallback ? `/index.html` : request.url;
57263
- },
57264
- },
57265
- ],
57266
- });
57108
+ const debug$6 = createDebugger('vite:html-fallback');
57109
+ function htmlFallbackMiddleware(root, spaFallback, mounted = false) {
57110
+ // When this middleware is mounted on a route, we need to re-assign `req.url` with a
57111
+ // leading `.` to signal a relative rewrite. Returning with a leading `/` returns a
57112
+ // buggy `req.url`. e.g.:
57113
+ //
57114
+ // mount /foo/bar:
57115
+ // req.url = /index.html
57116
+ // final = /foo/barindex.html
57117
+ //
57118
+ // mount /foo/bar:
57119
+ // req.url = ./index.html
57120
+ // final = /foo/bar/index.html
57121
+ const prepend = mounted ? '.' : '';
57267
57122
  // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
57268
57123
  return function viteHtmlFallbackMiddleware(req, res, next) {
57269
- return historyHtmlFallbackMiddleware(req, res, next);
57124
+ if (
57125
+ // Only accept GET or HEAD
57126
+ (req.method !== 'GET' && req.method !== 'HEAD') ||
57127
+ // Require Accept header
57128
+ !req.headers ||
57129
+ typeof req.headers.accept !== 'string' ||
57130
+ // Ignore JSON requests
57131
+ req.headers.accept.includes('application/json') ||
57132
+ // Require Accept: text/html or */*
57133
+ !(req.headers.accept.includes('text/html') ||
57134
+ req.headers.accept.includes('*/*'))) {
57135
+ return next();
57136
+ }
57137
+ const url = cleanUrl(req.url);
57138
+ const pathname = decodeURIComponent(url);
57139
+ // .html files are not handled by serveStaticMiddleware
57140
+ // so we need to check if the file exists
57141
+ if (pathname.endsWith('.html')) {
57142
+ const filePath = path$o.join(root, pathname);
57143
+ if (fs$l.existsSync(filePath)) {
57144
+ debug$6?.(`Rewriting ${req.method} ${req.url} to ${url}`);
57145
+ req.url = prepend + url;
57146
+ return next();
57147
+ }
57148
+ }
57149
+ // trailing slash should check for fallback index.html
57150
+ else if (pathname[pathname.length - 1] === '/') {
57151
+ const filePath = path$o.join(root, pathname, 'index.html');
57152
+ if (fs$l.existsSync(filePath)) {
57153
+ const newUrl = url + 'index.html';
57154
+ debug$6?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`);
57155
+ req.url = prepend + newUrl;
57156
+ return next();
57157
+ }
57158
+ }
57159
+ // non-trailing slash should check for fallback .html
57160
+ else {
57161
+ const filePath = path$o.join(root, pathname + '.html');
57162
+ if (fs$l.existsSync(filePath)) {
57163
+ const newUrl = url + '.html';
57164
+ debug$6?.(`Rewriting ${req.method} ${req.url} to ${newUrl}`);
57165
+ req.url = prepend + newUrl;
57166
+ return next();
57167
+ }
57168
+ }
57169
+ if (spaFallback) {
57170
+ debug$6?.(`Rewriting ${req.method} ${req.url} to /index.html`);
57171
+ req.url = prepend + '/index.html';
57172
+ }
57173
+ next();
57270
57174
  };
57271
57175
  }
57272
57176
 
@@ -57519,7 +57423,7 @@ function transformMiddleware(server) {
57519
57423
  }
57520
57424
 
57521
57425
  function createDevHtmlTransformFn(server) {
57522
- const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(server.config.plugins);
57426
+ const [preHooks, normalHooks, postHooks] = resolveHtmlTransforms(server.config.plugins, server.config.logger);
57523
57427
  return (url, html, originalUrl) => {
57524
57428
  return applyHtmlTransforms(html, [
57525
57429
  preImportMapHook(server.config),
@@ -57739,7 +57643,11 @@ const devHtmlHook = async (html, { path: htmlPath, filename, server, originalUrl
57739
57643
  ],
57740
57644
  };
57741
57645
  };
57742
- function indexHtmlMiddleware(server) {
57646
+ function indexHtmlMiddleware(root, server) {
57647
+ const isDev = isDevServer(server);
57648
+ const headers = isDev
57649
+ ? server.config.server.headers
57650
+ : server.config.preview.headers;
57743
57651
  // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
57744
57652
  return async function viteIndexHtmlMiddleware(req, res, next) {
57745
57653
  if (res.writableEnded) {
@@ -57748,14 +57656,20 @@ function indexHtmlMiddleware(server) {
57748
57656
  const url = req.url && cleanUrl(req.url);
57749
57657
  // htmlFallbackMiddleware appends '.html' to URLs
57750
57658
  if (url?.endsWith('.html') && req.headers['sec-fetch-dest'] !== 'script') {
57751
- const filename = getHtmlFilename(url, server);
57752
- if (fs$l.existsSync(filename)) {
57659
+ let filePath;
57660
+ if (isDev && url.startsWith(FS_PREFIX)) {
57661
+ filePath = decodeURIComponent(fsPathFromId(url));
57662
+ }
57663
+ else {
57664
+ filePath = path$o.join(root, decodeURIComponent(url));
57665
+ }
57666
+ if (fs$l.existsSync(filePath)) {
57753
57667
  try {
57754
- let html = await fsp.readFile(filename, 'utf-8');
57755
- html = await server.transformIndexHtml(url, html, req.originalUrl);
57756
- return send(req, res, html, 'html', {
57757
- headers: server.config.server.headers,
57758
- });
57668
+ let html = await fsp.readFile(filePath, 'utf-8');
57669
+ if (isDev) {
57670
+ html = await server.transformIndexHtml(url, html, req.originalUrl);
57671
+ }
57672
+ return send(req, res, html, 'html', { headers });
57759
57673
  }
57760
57674
  catch (e) {
57761
57675
  return next(e);
@@ -58159,6 +58073,14 @@ class ModuleGraph {
58159
58073
  }
58160
58074
  }
58161
58075
 
58076
+ function notFoundMiddleware() {
58077
+ // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
58078
+ return function vite404Middleware(_, res) {
58079
+ res.statusCode = 404;
58080
+ res.end();
58081
+ };
58082
+ }
58083
+
58162
58084
  function ansiRegex({onlyFirst = false} = {}) {
58163
58085
  const pattern = [
58164
58086
  '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
@@ -58662,13 +58584,9 @@ async function _createServer(inlineConfig = {}, options) {
58662
58584
  postHooks.forEach((fn) => fn && fn());
58663
58585
  if (config.appType === 'spa' || config.appType === 'mpa') {
58664
58586
  // transform index.html
58665
- middlewares.use(indexHtmlMiddleware(server));
58587
+ middlewares.use(indexHtmlMiddleware(root, server));
58666
58588
  // handle 404s
58667
- // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
58668
- middlewares.use(function vite404Middleware(_, res) {
58669
- res.statusCode = 404;
58670
- res.end();
58671
- });
58589
+ middlewares.use(notFoundMiddleware());
58672
58590
  }
58673
58591
  // error handler
58674
58592
  middlewares.use(errorMiddleware(server, middlewareMode));
@@ -59300,15 +59218,6 @@ function definePlugin(config) {
59300
59218
  const userDefine = {};
59301
59219
  const userDefineEnv = {};
59302
59220
  for (const key in config.define) {
59303
- // user can define keys with the same values to declare that some keys
59304
- // should not be replaced. in this case, we delete references of the key
59305
- // so they aren't replaced in the first place.
59306
- const val = config.define[key];
59307
- if (key === val) {
59308
- delete processNodeEnv[key];
59309
- delete importMetaKeys[key];
59310
- continue;
59311
- }
59312
59221
  userDefine[key] = handleDefineValue(config.define[key]);
59313
59222
  // make sure `import.meta.env` object has user define properties
59314
59223
  if (isBuild && key.startsWith('import.meta.env.')) {
@@ -60439,7 +60348,7 @@ function webWorkerPlugin(config) {
60439
60348
  }
60440
60349
  },
60441
60350
  shouldTransformCachedModule({ id }) {
60442
- if (isBuild && isWorkerQueryId(id) && config.build.watch) {
60351
+ if (isBuild && config.build.watch && isWorkerQueryId(id)) {
60443
60352
  return true;
60444
60353
  }
60445
60354
  },
@@ -60757,6 +60666,14 @@ function getWorkerType(raw, clean, i) {
60757
60666
  }
60758
60667
  return 'classic';
60759
60668
  }
60669
+ function isIncludeWorkerImportMetaUrl(code) {
60670
+ if ((code.includes('new Worker') || code.includes('new SharedWorker')) &&
60671
+ code.includes('new URL') &&
60672
+ code.includes(`import.meta.url`)) {
60673
+ return true;
60674
+ }
60675
+ return false;
60676
+ }
60760
60677
  function workerImportMetaUrlPlugin(config) {
60761
60678
  const isBuild = config.command === 'build';
60762
60679
  let workerResolver;
@@ -60771,12 +60688,14 @@ function workerImportMetaUrlPlugin(config) {
60771
60688
  };
60772
60689
  return {
60773
60690
  name: 'vite:worker-import-meta-url',
60691
+ shouldTransformCachedModule({ code }) {
60692
+ if (isBuild && config.build.watch && isIncludeWorkerImportMetaUrl(code)) {
60693
+ return true;
60694
+ }
60695
+ },
60774
60696
  async transform(code, id, options) {
60775
60697
  const ssr = options?.ssr === true;
60776
- if (!options?.ssr &&
60777
- (code.includes('new Worker') || code.includes('new SharedWorker')) &&
60778
- code.includes('new URL') &&
60779
- code.includes(`import.meta.url`)) {
60698
+ if (!options?.ssr && isIncludeWorkerImportMetaUrl(code)) {
60780
60699
  const query = parseRequest(id);
60781
60700
  let s;
60782
60701
  const cleanString = stripLiteral(code);
@@ -62123,7 +62042,7 @@ async function prepareEsbuildScanner(config, entries, deps, missing, scanContext
62123
62042
  if (scanContext?.cancelled)
62124
62043
  return;
62125
62044
  const plugin = esbuildScanPlugin(config, container, deps, missing, entries);
62126
- const { plugins = [], tsconfig, tsconfigRaw, ...esbuildOptions } = config.optimizeDeps?.esbuildOptions ?? {};
62045
+ const { plugins = [], ...esbuildOptions } = config.optimizeDeps?.esbuildOptions ?? {};
62127
62046
  return await esbuild.context({
62128
62047
  absWorkingDir: process.cwd(),
62129
62048
  write: false,
@@ -62135,8 +62054,6 @@ async function prepareEsbuildScanner(config, entries, deps, missing, scanContext
62135
62054
  format: 'esm',
62136
62055
  logLevel: 'silent',
62137
62056
  plugins: [...plugins, plugin],
62138
- tsconfig,
62139
- tsconfigRaw: resolveTsconfigRaw(tsconfig, tsconfigRaw),
62140
62057
  ...esbuildOptions,
62141
62058
  });
62142
62059
  }
@@ -62498,21 +62415,6 @@ function isScannable(id, extensions) {
62498
62415
  extensions?.includes(path$o.extname(id)) ||
62499
62416
  false);
62500
62417
  }
62501
- // esbuild v0.18 only transforms decorators when `experimentalDecorators` is set to `true`.
62502
- // To preserve compat with the esbuild breaking change, we set `experimentalDecorators` to
62503
- // `true` by default if it's unset.
62504
- // TODO: Remove this in Vite 5 and check https://github.com/vitejs/vite/pull/13805#issuecomment-1633612320
62505
- function resolveTsconfigRaw(tsconfig, tsconfigRaw) {
62506
- return tsconfig || typeof tsconfigRaw === 'string'
62507
- ? tsconfigRaw
62508
- : {
62509
- ...tsconfigRaw,
62510
- compilerOptions: {
62511
- experimentalDecorators: true,
62512
- ...tsconfigRaw?.compilerOptions,
62513
- },
62514
- };
62515
- }
62516
62418
 
62517
62419
  function createOptimizeDepsIncludeResolver(config, ssr) {
62518
62420
  const resolve = config.createResolver({
@@ -63603,7 +63505,7 @@ async function prepareEsbuildOptimizerRun(resolvedConfig, depsInfo, ssr, process
63603
63505
  const flatIdDeps = {};
63604
63506
  const idToExports = {};
63605
63507
  const optimizeDeps = getDepOptimizationConfig(config, ssr);
63606
- const { plugins: pluginsFromConfig = [], tsconfig, tsconfigRaw, ...esbuildOptions } = optimizeDeps?.esbuildOptions ?? {};
63508
+ const { plugins: pluginsFromConfig = [], ...esbuildOptions } = optimizeDeps?.esbuildOptions ?? {};
63607
63509
  await Promise.all(Object.keys(depsInfo).map(async (id) => {
63608
63510
  const src = depsInfo[id].src;
63609
63511
  const exportsData = await (depsInfo[id].exportsData ??
@@ -63679,8 +63581,6 @@ async function prepareEsbuildOptimizerRun(resolvedConfig, depsInfo, ssr, process
63679
63581
  metafile: true,
63680
63582
  plugins,
63681
63583
  charset: 'utf8',
63682
- tsconfig,
63683
- tsconfigRaw: resolveTsconfigRaw(tsconfig, tsconfigRaw),
63684
63584
  ...esbuildOptions,
63685
63585
  supported: {
63686
63586
  'dynamic-import': true,
@@ -65592,7 +65492,7 @@ async function preview(inlineConfig = {}) {
65592
65492
  const viteAssetMiddleware = (...args) => sirv(distDir, {
65593
65493
  etag: true,
65594
65494
  dev: true,
65595
- single: config.appType === 'spa',
65495
+ extensions: [],
65596
65496
  ignores: false,
65597
65497
  setHeaders(res) {
65598
65498
  if (headers) {
@@ -65606,8 +65506,18 @@ async function preview(inlineConfig = {}) {
65606
65506
  },
65607
65507
  })(...args);
65608
65508
  app.use(previewBase, viteAssetMiddleware);
65509
+ // html fallback
65510
+ if (config.appType === 'spa' || config.appType === 'mpa') {
65511
+ app.use(previewBase, htmlFallbackMiddleware(distDir, config.appType === 'spa', previewBase !== '/'));
65512
+ }
65609
65513
  // apply post server hooks from plugins
65610
65514
  postHooks.forEach((fn) => fn && fn());
65515
+ if (config.appType === 'spa' || config.appType === 'mpa') {
65516
+ // transform index.html
65517
+ app.use(previewBase, indexHtmlMiddleware(distDir, server));
65518
+ // handle 404s
65519
+ app.use(previewBase, notFoundMiddleware());
65520
+ }
65611
65521
  const hostname = await resolveHostname(options.host);
65612
65522
  const port = options.port ?? DEFAULT_PREVIEW_PORT;
65613
65523
  const protocol = options.https ? 'https' : 'http';
@@ -65851,7 +65761,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
65851
65761
  : '';
65852
65762
  const server = resolveServerOptions(resolvedRoot, config.server, logger);
65853
65763
  const ssr = resolveSSROptions(config.ssr, resolveOptions.preserveSymlinks);
65854
- const middlewareMode = config?.server?.middlewareMode;
65855
65764
  const optimizeDeps = config.optimizeDeps || {};
65856
65765
  const BASE_URL = resolvedBase;
65857
65766
  let resolved;
@@ -65945,7 +65854,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
65945
65854
  },
65946
65855
  },
65947
65856
  worker: resolvedWorkerOptions,
65948
- appType: config.appType ?? (middlewareMode === 'ssr' ? 'custom' : 'spa'),
65857
+ appType: config.appType ?? 'spa',
65949
65858
  experimental: {
65950
65859
  importGlobRestoreExtension: false,
65951
65860
  hmrPartialAccept: false,
@@ -65964,13 +65873,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
65964
65873
  await Promise.all(resolved
65965
65874
  .getSortedPluginHooks('configResolved')
65966
65875
  .map((hook) => hook(resolved)));
65967
- // validate config
65968
- if (middlewareMode === 'ssr') {
65969
- 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`));
65970
- }
65971
- else if (middlewareMode === 'html') {
65972
- logger.warn(colors$1.yellow(`Setting server.middlewareMode to 'html' is deprecated, set server.middlewareMode to \`true\` instead`));
65973
- }
65974
65876
  debug?.(`using resolved config: %O`, {
65975
65877
  ...resolved,
65976
65878
  plugins: resolved.plugins.map((p) => p.name),
@@ -65979,6 +65881,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
65979
65881
  plugins: `() => plugins`,
65980
65882
  },
65981
65883
  });
65884
+ // validate config
65982
65885
  if (config.build?.terserOptions && config.build.minify !== 'terser') {
65983
65886
  logger.warn(colors$1.yellow(`build.terserOptions is specified but build.minify is not set to use Terser. ` +
65984
65887
  `Note Vite now defaults to use esbuild for minification. If you still ` +