vite 6.1.0 → 6.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { P as getDefaultExportFromCjs } from './dep-CfG9u7Cn.js';
1
+ import { P as getDefaultExportFromCjs } from './dep-C6SLLVWG.js';
2
2
  import require$$0 from 'path';
3
3
  import { l as lib } from './dep-3RmXg9uo.js';
4
4
 
@@ -397,7 +397,7 @@ function replaceCodePoint(codePoint) {
397
397
  if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
398
398
  return 0xfffd;
399
399
  }
400
- return (_a = decodeMap.get(codePoint)) !== null && _a !== undefined ? _a : codePoint;
400
+ return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
401
401
  }
402
402
 
403
403
  var CharCodes;
@@ -641,7 +641,7 @@ class EntityDecoder {
641
641
  var _a;
642
642
  // Ensure we consumed at least one digit.
643
643
  if (this.consumed <= expectedLength) {
644
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
644
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
645
645
  return 0;
646
646
  }
647
647
  // Figure out if this is a legit end of the entity
@@ -716,7 +716,7 @@ class EntityDecoder {
716
716
  const { result, decodeTree } = this;
717
717
  const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
718
718
  this.emitNamedEntityData(result, valueLength, this.consumed);
719
- (_a = this.errors) === null || _a === undefined ? undefined : _a.missingSemicolonAfterCharacterReference();
719
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
720
720
  return this.consumed;
721
721
  }
722
722
  /**
@@ -765,7 +765,7 @@ class EntityDecoder {
765
765
  return this.emitNumericEntity(0, 3);
766
766
  }
767
767
  case EntityDecoderState.NumericStart: {
768
- (_a = this.errors) === null || _a === undefined ? undefined : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
768
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
769
769
  return 0;
770
770
  }
771
771
  case EntityDecoderState.EntityStart: {
@@ -1236,7 +1236,7 @@ const TAG_NAME_TO_ID = new Map([
1236
1236
  ]);
1237
1237
  function getTagID(tagName) {
1238
1238
  var _a;
1239
- return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== undefined ? _a : TAG_ID.UNKNOWN;
1239
+ return (_a = TAG_NAME_TO_ID.get(tagName)) !== null && _a !== void 0 ? _a : TAG_ID.UNKNOWN;
1240
1240
  }
1241
1241
  const $ = TAG_ID;
1242
1242
  const SPECIAL_ELEMENTS = {
@@ -1410,13 +1410,10 @@ var State;
1410
1410
  })(State || (State = {}));
1411
1411
  //Tokenizer initial states for different modes
1412
1412
  const TokenizerMode = {
1413
- DATA: State.DATA,
1414
1413
  RCDATA: State.RCDATA,
1415
1414
  RAWTEXT: State.RAWTEXT,
1416
1415
  SCRIPT_DATA: State.SCRIPT_DATA,
1417
- PLAINTEXT: State.PLAINTEXT,
1418
- CDATA_SECTION: State.CDATA_SECTION,
1419
- };
1416
+ PLAINTEXT: State.PLAINTEXT};
1420
1417
  //Utils
1421
1418
  //OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline
1422
1419
  //this functions if they will be situated in another module due to context switch.
@@ -1513,7 +1510,7 @@ class Tokenizer {
1513
1510
  //Errors
1514
1511
  _err(code, cpOffset = 0) {
1515
1512
  var _a, _b;
1516
- (_b = (_a = this.handler).onParseError) === null || _b === undefined ? undefined : _b.call(_a, this.preprocessor.getError(code, cpOffset));
1513
+ (_b = (_a = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a, this.preprocessor.getError(code, cpOffset));
1517
1514
  }
1518
1515
  // NOTE: `offset` may never run across line boundaries.
1519
1516
  getCurrentLocation(offset) {
@@ -1556,7 +1553,7 @@ class Tokenizer {
1556
1553
  return;
1557
1554
  this._runParsingLoop();
1558
1555
  if (!this.paused) {
1559
- writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
1556
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
1560
1557
  }
1561
1558
  }
1562
1559
  write(chunk, isLastChunk, writeCallback) {
@@ -1564,7 +1561,7 @@ class Tokenizer {
1564
1561
  this.preprocessor.write(chunk, isLastChunk);
1565
1562
  this._runParsingLoop();
1566
1563
  if (!this.paused) {
1567
- writeCallback === null || writeCallback === undefined ? undefined : writeCallback();
1564
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
1568
1565
  }
1569
1566
  }
1570
1567
  insertHtmlAtCurrentPos(chunk) {
@@ -1663,7 +1660,7 @@ class Tokenizer {
1663
1660
  if (getTokenAttr(token, this.currentAttr.name) === null) {
1664
1661
  token.attrs.push(this.currentAttr);
1665
1662
  if (token.location && this.currentLocation) {
1666
- const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== undefined ? _a : (_b.attrs = Object.create(null)));
1663
+ const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : (_b.attrs = Object.create(null)));
1667
1664
  attrLocations[this.currentAttr.name] = this.currentLocation;
1668
1665
  // Set end location
1669
1666
  this._leaveAttrValue();
@@ -5076,11 +5073,11 @@ class Parser {
5076
5073
  if (this.onParseError) {
5077
5074
  this.options.sourceCodeLocationInfo = true;
5078
5075
  }
5079
- this.document = document !== null && document !== undefined ? document : this.treeAdapter.createDocument();
5076
+ this.document = document !== null && document !== void 0 ? document : this.treeAdapter.createDocument();
5080
5077
  this.tokenizer = new Tokenizer(this.options, this);
5081
5078
  this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
5082
5079
  this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
5083
- this._setContextModes(fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : this.document, this.fragmentContextID);
5080
+ this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);
5084
5081
  this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
5085
5082
  }
5086
5083
  // API
@@ -5096,7 +5093,7 @@ class Parser {
5096
5093
  };
5097
5094
  //NOTE: use a <template> element as the fragment context if no context element was provided,
5098
5095
  //so we will parse in a "forgiving" manner
5099
- fragmentContext !== null && fragmentContext !== undefined ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5096
+ fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : (fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []));
5100
5097
  //NOTE: create a fake element which will be used as the `document` for fragment parsing.
5101
5098
  //This is important for jsdom, where a new `document` cannot be created. This led to
5102
5099
  //fragment parsing messing with the main `document`.
@@ -5123,7 +5120,7 @@ class Parser {
5123
5120
  var _a;
5124
5121
  if (!this.onParseError)
5125
5122
  return;
5126
- const loc = (_a = token.location) !== null && _a !== undefined ? _a : BASE_LOC;
5123
+ const loc = (_a = token.location) !== null && _a !== void 0 ? _a : BASE_LOC;
5127
5124
  const err = {
5128
5125
  code,
5129
5126
  startLine: loc.startLine,
@@ -5139,7 +5136,7 @@ class Parser {
5139
5136
  /** @internal */
5140
5137
  onItemPush(node, tid, isTop) {
5141
5138
  var _a, _b;
5142
- (_b = (_a = this.treeAdapter).onItemPush) === null || _b === undefined ? undefined : _b.call(_a, node);
5139
+ (_b = (_a = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a, node);
5143
5140
  if (isTop && this.openElements.stackTop > 0)
5144
5141
  this._setContextModes(node, tid);
5145
5142
  }
@@ -5149,7 +5146,7 @@ class Parser {
5149
5146
  if (this.options.sourceCodeLocationInfo) {
5150
5147
  this._setEndLocation(node, this.currentToken);
5151
5148
  }
5152
- (_b = (_a = this.treeAdapter).onItemPop) === null || _b === undefined ? undefined : _b.call(_a, node, this.openElements.current);
5149
+ (_b = (_a = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a, node, this.openElements.current);
5153
5150
  if (isTop) {
5154
5151
  let current;
5155
5152
  let currentTagId;
@@ -7311,7 +7308,7 @@ function eofInBody(p, token) {
7311
7308
  function endTagInText(p, token) {
7312
7309
  var _a;
7313
7310
  if (token.tagID === TAG_ID.SCRIPT) {
7314
- (_a = p.scriptHandler) === null || _a === undefined ? undefined : _a.call(p, p.openElements.current);
7311
+ (_a = p.scriptHandler) === null || _a === void 0 ? void 0 : _a.call(p, p.openElements.current);
7315
7312
  }
7316
7313
  p.openElements.pop();
7317
7314
  p.insertionMode = p.originalInsertionMode;
@@ -8039,7 +8036,7 @@ function endTagAfterBody(p, token) {
8039
8036
  p._setEndLocation(p.openElements.items[0], token);
8040
8037
  // Update the body element, if it doesn't have an end tag
8041
8038
  const bodyElement = p.openElements.items[1];
8042
- if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === undefined ? undefined : _a.endTag)) {
8039
+ if (bodyElement && !((_a = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a === void 0 ? void 0 : _a.endTag)) {
8043
8040
  p._setEndLocation(bodyElement, token);
8044
8041
  }
8045
8042
  }
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import fs__default from 'node:fs';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import { EventEmitter } from 'events';
5
- import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-CfG9u7Cn.js';
5
+ import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-C6SLLVWG.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -24,6 +24,7 @@ import 'stream';
24
24
  import 'os';
25
25
  import 'child_process';
26
26
  import 'node:os';
27
+ import 'node:net';
27
28
  import 'node:dns';
28
29
  import 'vite/module-runner';
29
30
  import 'rollup/parseAst';
@@ -40,7 +41,6 @@ import 'zlib';
40
41
  import 'buffer';
41
42
  import 'https';
42
43
  import 'tls';
43
- import 'node:net';
44
44
  import 'assert';
45
45
  import 'node:querystring';
46
46
  import 'node:zlib';
@@ -66,9 +66,9 @@ function mri2 (args, opts) {
66
66
  var k, arr, arg, name, val, out={ _:[] };
67
67
  var i=0, j=0, idx=0, len=args.length;
68
68
 
69
- const alibi = opts.alias !== undefined;
70
- const strict = opts.unknown !== undefined;
71
- const defaults = opts.default !== undefined;
69
+ const alibi = opts.alias !== void 0;
70
+ const strict = opts.unknown !== void 0;
71
+ const defaults = opts.default !== void 0;
72
72
 
73
73
  opts.alias = opts.alias || {};
74
74
  opts.string = toArr(opts.string);
@@ -97,7 +97,7 @@ function mri2 (args, opts) {
97
97
  for (k in opts.default) {
98
98
  name = typeof opts.default[k];
99
99
  arr = opts.alias[k] = opts.alias[k] || [];
100
- if (opts[name] !== undefined) {
100
+ if (opts[name] !== void 0) {
101
101
  opts[name].push(k);
102
102
  for (i=0; i < arr.length; i++) {
103
103
  opts[name].push(arr[i]);
@@ -147,7 +147,7 @@ function mri2 (args, opts) {
147
147
 
148
148
  if (defaults) {
149
149
  for (k in opts.default) {
150
- if (out[k] === undefined) {
150
+ if (out[k] === void 0) {
151
151
  out[k] = opts.default[k];
152
152
  }
153
153
  }
@@ -401,7 +401,7 @@ class Command {
401
401
  sections.push({
402
402
  title: "Options",
403
403
  body: options.map((option) => {
404
- return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? "" : `(default: ${option.config.default})`}`;
404
+ return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
405
405
  }).join("\n")
406
406
  });
407
407
  }
@@ -530,8 +530,8 @@ class CAC extends EventEmitter {
530
530
  return this;
531
531
  }
532
532
  unsetMatchedCommand() {
533
- this.matchedCommand = undefined;
534
- this.matchedCommandName = undefined;
533
+ this.matchedCommand = void 0;
534
+ this.matchedCommandName = void 0;
535
535
  }
536
536
  parse(argv = processArgs, {
537
537
  run = true
@@ -611,13 +611,13 @@ class CAC extends EventEmitter {
611
611
  const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
612
612
  let transforms = Object.create(null);
613
613
  for (const cliOption of cliOptions) {
614
- if (!ignoreDefault && cliOption.config.default !== undefined) {
614
+ if (!ignoreDefault && cliOption.config.default !== void 0) {
615
615
  for (const name of cliOption.names) {
616
616
  options[name] = cliOption.config.default;
617
617
  }
618
618
  }
619
619
  if (Array.isArray(cliOption.config.type)) {
620
- if (transforms[cliOption.name] === undefined) {
620
+ if (transforms[cliOption.name] === void 0) {
621
621
  transforms[cliOption.name] = Object.create(null);
622
622
  transforms[cliOption.name]["shouldTransform"] = true;
623
623
  transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
@@ -675,7 +675,7 @@ const stopProfiler = (log) => {
675
675
  `CPU profile written to ${colors.white(colors.dim(outPath))}`
676
676
  )
677
677
  );
678
- profileSession = undefined;
678
+ profileSession = void 0;
679
679
  res();
680
680
  } else {
681
681
  rej(err);
@@ -713,7 +713,7 @@ function cleanGlobalCLIOptions(options) {
713
713
  }
714
714
  if ("watch" in ret) {
715
715
  const watch = ret.watch;
716
- ret.watch = watch ? {} : undefined;
716
+ ret.watch = watch ? {} : void 0;
717
717
  }
718
718
  return ret;
719
719
  }
@@ -745,7 +745,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
745
745
  `[boolean] force the optimizer to ignore the cache and re-bundle`
746
746
  ).action(async (root, options) => {
747
747
  filterDuplicateOptions(options);
748
- const { createServer } = await import('./chunks/dep-CfG9u7Cn.js').then(function (n) { return n.S; });
748
+ const { createServer } = await import('./chunks/dep-C6SLLVWG.js').then(function (n) { return n.S; });
749
749
  try {
750
750
  const server = await createServer({
751
751
  root,
@@ -763,6 +763,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
763
763
  }
764
764
  await server.listen();
765
765
  const info = server.config.logger.info;
766
+ const modeString = options.mode && options.mode !== "development" ? ` ${colors.bgGreen(` ${colors.bold(options.mode)} `)}` : "";
766
767
  const viteStartTime = global.__vite_start_time ?? false;
767
768
  const startupDurationString = viteStartTime ? colors.dim(
768
769
  `ready in ${colors.reset(
@@ -774,7 +775,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
774
775
  `
775
776
  ${colors.green(
776
777
  `${colors.bold("VITE")} v${VERSION}`
777
- )} ${startupDurationString}
778
+ )}${modeString} ${startupDurationString}
778
779
  `,
779
780
  {
780
781
  clear: !hasExistingLogs
@@ -839,7 +840,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
839
840
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
840
841
  async (root, options) => {
841
842
  filterDuplicateOptions(options);
842
- const { createBuilder } = await import('./chunks/dep-CfG9u7Cn.js').then(function (n) { return n.T; });
843
+ const { createBuilder } = await import('./chunks/dep-C6SLLVWG.js').then(function (n) { return n.T; });
843
844
  const buildOptions = cleanGlobalCLIOptions(
844
845
  cleanBuilderCLIOptions(options)
845
846
  );
@@ -878,7 +879,7 @@ cli.command(
878
879
  ).action(
879
880
  async (root, options) => {
880
881
  filterDuplicateOptions(options);
881
- const { optimizeDeps } = await import('./chunks/dep-CfG9u7Cn.js').then(function (n) { return n.R; });
882
+ const { optimizeDeps } = await import('./chunks/dep-C6SLLVWG.js').then(function (n) { return n.R; });
882
883
  try {
883
884
  const config = await resolveConfig(
884
885
  {
@@ -905,7 +906,7 @@ ${e.stack}`),
905
906
  cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
906
907
  async (root, options) => {
907
908
  filterDuplicateOptions(options);
908
- const { preview } = await import('./chunks/dep-CfG9u7Cn.js').then(function (n) { return n.U; });
909
+ const { preview } = await import('./chunks/dep-C6SLLVWG.js').then(function (n) { return n.U; });
909
910
  try {
910
911
  const server = await preview({
911
912
  root,
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { PluginHooks, RollupError, SourceMap, ModuleInfo, PartialResolvedId, RollupOptions, WatcherOptions, InputOption, ModuleFormat, RollupOutput, RollupWatcher, InputOptions, CustomPluginOptions, LoadResult, SourceDescription, PluginContextMeta, RollupLog, OutputBundle, OutputChunk, ObjectHook, ResolveIdResult, SourceMapInput, ExistingRawSourceMap, GetManualChunk } from 'rollup';
2
+ import { PluginHooks, RollupError, SourceMap, ModuleInfo, PartialResolvedId, RollupOptions, InputOption, ModuleFormat, WatcherOptions, RollupOutput, RollupWatcher, InputOptions, CustomPluginOptions, LoadResult, SourceDescription, PluginContextMeta, RollupLog, OutputBundle, OutputChunk, ObjectHook, ResolveIdResult, ExistingRawSourceMap, SourceMapInput, GetManualChunk } from 'rollup';
3
3
  import * as rollup from 'rollup';
4
4
  export { rollup as Rollup };
5
5
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-CfG9u7Cn.js';
3
- export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, F as createFilter, h as createIdResolver, I as createLogger, n as createRunnableDevEnvironment, c as createServer, y as createServerHotChannel, w as createServerModuleRunner, x as createServerModuleRunnerTransport, d as defineConfig, v as fetchModule, j as formatPostcssSourceMap, L as isFileLoadingAllowed, K as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, M as loadEnv, E as mergeAlias, C as mergeConfig, z as moduleRunnerTransform, A as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, N as resolveEnvPrefix, G as rollupVersion, u as runnerImport, J as searchForWorkspaceRoot, H as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-CfG9u7Cn.js';
2
+ import { a as arraify, i as isInNodeModules } from './chunks/dep-C6SLLVWG.js';
3
+ export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, F as createFilter, h as createIdResolver, I as createLogger, n as createRunnableDevEnvironment, c as createServer, y as createServerHotChannel, w as createServerModuleRunner, x as createServerModuleRunnerTransport, d as defineConfig, v as fetchModule, j as formatPostcssSourceMap, L as isFileLoadingAllowed, K as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, M as loadEnv, E as mergeAlias, C as mergeConfig, z as moduleRunnerTransform, A as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, N as resolveEnvPrefix, G as rollupVersion, u as runnerImport, J as searchForWorkspaceRoot, H as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-C6SLLVWG.js';
4
4
  export { defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import 'node:fs';
@@ -26,6 +26,7 @@ import 'stream';
26
26
  import 'os';
27
27
  import 'child_process';
28
28
  import 'node:os';
29
+ import 'node:net';
29
30
  import 'node:dns';
30
31
  import 'vite/module-runner';
31
32
  import 'module';
@@ -41,7 +42,6 @@ import 'zlib';
41
42
  import 'buffer';
42
43
  import 'https';
43
44
  import 'tls';
44
- import 'node:net';
45
45
  import 'assert';
46
46
  import 'node:querystring';
47
47
  import 'node:zlib';
@@ -1,7 +1,7 @@
1
1
  import { ModuleNamespace, ViteHotContext } from '../../types/hot.js';
2
2
  import { Update, HotPayload } from '../../types/hmrPayload.js';
3
3
  import { InferCustomEventPayload } from '../../types/customEvent.js';
4
- import { N as NormalizedModuleRunnerTransport, E as ExternalFetchResult, V as ViteFetchResult, F as FetchFunctionOptions, a as FetchResult, M as ModuleRunnerTransport } from './moduleRunnerTransport.d-CXw_Ws6P.js';
4
+ import { N as NormalizedModuleRunnerTransport, E as ExternalFetchResult, V as ViteFetchResult, M as ModuleRunnerTransport, F as FetchFunctionOptions, a as FetchResult } from './moduleRunnerTransport.d-CXw_Ws6P.js';
5
5
  export { b as ModuleRunnerTransportHandlers, c as createWebSocketModuleRunnerTransport } from './moduleRunnerTransport.d-CXw_Ws6P.js';
6
6
 
7
7
  interface SourceMapLike {
@@ -229,7 +229,7 @@ var colors = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
229
229
 
230
230
  var src = {exports: {}};
231
231
 
232
- var browser$1 = {exports: {}};
232
+ var browser = {exports: {}};
233
233
 
234
234
  /**
235
235
  * Helpers.
@@ -707,7 +707,7 @@ function requireCommon () {
707
707
  var hasRequiredBrowser;
708
708
 
709
709
  function requireBrowser () {
710
- if (hasRequiredBrowser) return browser$1.exports;
710
+ if (hasRequiredBrowser) return browser.exports;
711
711
  hasRequiredBrowser = 1;
712
712
  (function (module, exports) {
713
713
  /**
@@ -980,8 +980,8 @@ function requireBrowser () {
980
980
  return '[UnexpectedJSONParseError]: ' + error.message;
981
981
  }
982
982
  };
983
- } (browser$1, browser$1.exports));
984
- return browser$1.exports;
983
+ } (browser, browser.exports));
984
+ return browser.exports;
985
985
  }
986
986
 
987
987
  var node = {exports: {}};
@@ -1271,7 +1271,7 @@ if (typeof process === 'undefined' || process.type === 'renderer' || process.bro
1271
1271
  }
1272
1272
 
1273
1273
  var srcExports = src.exports;
1274
- var debug$2 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
1274
+ var debug$3 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
1275
1275
 
1276
1276
  var utils$4 = {};
1277
1277
 
@@ -2779,7 +2779,7 @@ const parse$2 = (input, options) => {
2779
2779
  }
2780
2780
 
2781
2781
  if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
2782
- const end = rest[1] !== undefined ? '|$' : '';
2782
+ const end = rest[1] !== void 0 ? '|$' : '';
2783
2783
 
2784
2784
  state.output = state.output.slice(0, -(prior.output + prev.output).length);
2785
2785
  prior.output = `(?:${prior.output}`;
@@ -3543,7 +3543,7 @@ const rollupVersion = resolvePackageData("rollup", _dirname, true)?.data.version
3543
3543
  const filter = process.env.VITE_DEBUG_FILTER;
3544
3544
  const DEBUG = process.env.DEBUG;
3545
3545
  function createDebugger(namespace, options = {}) {
3546
- const log = debug$2(namespace);
3546
+ const log = debug$3(namespace);
3547
3547
  const { onlyWhenFocused, depth } = options;
3548
3548
  if (depth && log.inspectOpts && log.inspectOpts.depth == null) {
3549
3549
  log.inspectOpts.depth = options.depth;
@@ -5543,7 +5543,7 @@ class MagicString {
5543
5543
  }
5544
5544
  }
5545
5545
 
5546
- const debug$1 = createDebugger("vite:sourcemap", {
5546
+ const debug$2 = createDebugger("vite:sourcemap", {
5547
5547
  onlyWhenFocused: true
5548
5548
  });
5549
5549
  function genSourceMapUrl(map) {
@@ -5553,7 +5553,7 @@ function genSourceMapUrl(map) {
5553
5553
  return `data:application/json;base64,${Buffer.from(map).toString("base64")}`;
5554
5554
  }
5555
5555
  function getCodeWithSourcemap(type, code, map) {
5556
- if (debug$1) {
5556
+ if (debug$2) {
5557
5557
  code += `
5558
5558
  /*${JSON.stringify(map, null, 2).replace(/\*\//g, "*\\/")}*/
5559
5559
  `;
@@ -5568,7 +5568,7 @@ function getCodeWithSourcemap(type, code, map) {
5568
5568
  return code;
5569
5569
  }
5570
5570
 
5571
- const debug = createDebugger("vite:send", {
5571
+ const debug$1 = createDebugger("vite:send", {
5572
5572
  onlyWhenFocused: true
5573
5573
  });
5574
5574
  const alias = {
@@ -5607,7 +5607,7 @@ function send(req, res, content, type, options) {
5607
5607
  } else if (type === "js" && (!map || map.mappings !== "")) {
5608
5608
  const code = content.toString();
5609
5609
  if (convertSourceMap.mapFileCommentRegex.test(code)) {
5610
- debug?.(`Skipped injecting fallback sourcemap for ${req.url}`);
5610
+ debug$1?.(`Skipped injecting fallback sourcemap for ${req.url}`);
5611
5611
  } else {
5612
5612
  const urlWithoutTimestamp = removeTimestampQuery(req.url);
5613
5613
  const ms = new MagicString(code);
@@ -5645,7 +5645,7 @@ function clearScreen() {
5645
5645
  }
5646
5646
  let timeFormatter;
5647
5647
  function getTimeFormatter() {
5648
- timeFormatter ??= new Intl.DateTimeFormat(undefined, {
5648
+ timeFormatter ??= new Intl.DateTimeFormat(void 0, {
5649
5649
  hour: "numeric",
5650
5650
  minute: "numeric",
5651
5651
  second: "numeric"
@@ -5806,84 +5806,11 @@ function isFileLoadingAllowed(config, filePath) {
5806
5806
  return false;
5807
5807
  }
5808
5808
 
5809
- var main$1 = {exports: {}};
5809
+ var main = {exports: {}};
5810
5810
 
5811
- var name = "dotenv";
5812
5811
  var version$1 = "16.4.7";
5813
- var description = "Loads environment variables from .env file";
5814
- var main = "lib/main.js";
5815
- var types = "lib/main.d.ts";
5816
- var exports$1 = {
5817
- ".": {
5818
- types: "./lib/main.d.ts",
5819
- require: "./lib/main.js",
5820
- "default": "./lib/main.js"
5821
- },
5822
- "./config": "./config.js",
5823
- "./config.js": "./config.js",
5824
- "./lib/env-options": "./lib/env-options.js",
5825
- "./lib/env-options.js": "./lib/env-options.js",
5826
- "./lib/cli-options": "./lib/cli-options.js",
5827
- "./lib/cli-options.js": "./lib/cli-options.js",
5828
- "./package.json": "./package.json"
5829
- };
5830
- var scripts = {
5831
- "dts-check": "tsc --project tests/types/tsconfig.json",
5832
- lint: "standard",
5833
- pretest: "npm run lint && npm run dts-check",
5834
- test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
5835
- "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",
5836
- prerelease: "npm test",
5837
- release: "standard-version"
5838
- };
5839
- var repository = {
5840
- type: "git",
5841
- url: "git://github.com/motdotla/dotenv.git"
5842
- };
5843
- var funding = "https://dotenvx.com";
5844
- var keywords = [
5845
- "dotenv",
5846
- "env",
5847
- ".env",
5848
- "environment",
5849
- "variables",
5850
- "config",
5851
- "settings"
5852
- ];
5853
- var readmeFilename = "README.md";
5854
- var license = "BSD-2-Clause";
5855
- var devDependencies = {
5856
- "@types/node": "^18.11.3",
5857
- decache: "^4.6.2",
5858
- sinon: "^14.0.1",
5859
- standard: "^17.0.0",
5860
- "standard-version": "^9.5.0",
5861
- tap: "^19.2.0",
5862
- typescript: "^4.8.4"
5863
- };
5864
- var engines = {
5865
- node: ">=12"
5866
- };
5867
- var browser = {
5868
- fs: false
5869
- };
5870
5812
  var require$$4 = {
5871
- name: name,
5872
- version: version$1,
5873
- description: description,
5874
- main: main,
5875
- types: types,
5876
- exports: exports$1,
5877
- scripts: scripts,
5878
- repository: repository,
5879
- funding: funding,
5880
- keywords: keywords,
5881
- readmeFilename: readmeFilename,
5882
- license: license,
5883
- devDependencies: devDependencies,
5884
- engines: engines,
5885
- browser: browser
5886
- };
5813
+ version: version$1};
5887
5814
 
5888
5815
  const fs = require$$1$2;
5889
5816
  const path = require$$1$1;
@@ -6237,15 +6164,15 @@ const DotenvModule = {
6237
6164
  populate
6238
6165
  };
6239
6166
 
6240
- main$1.exports.configDotenv = DotenvModule.configDotenv;
6241
- main$1.exports._configVault = DotenvModule._configVault;
6242
- main$1.exports._parseVault = DotenvModule._parseVault;
6243
- main$1.exports.config = DotenvModule.config;
6244
- main$1.exports.decrypt = DotenvModule.decrypt;
6245
- var parse_1 = main$1.exports.parse = DotenvModule.parse;
6246
- main$1.exports.populate = DotenvModule.populate;
6167
+ main.exports.configDotenv = DotenvModule.configDotenv;
6168
+ main.exports._configVault = DotenvModule._configVault;
6169
+ main.exports._parseVault = DotenvModule._parseVault;
6170
+ main.exports.config = DotenvModule.config;
6171
+ main.exports.decrypt = DotenvModule.decrypt;
6172
+ var parse_1 = main.exports.parse = DotenvModule.parse;
6173
+ main.exports.populate = DotenvModule.populate;
6247
6174
 
6248
- main$1.exports = DotenvModule;
6175
+ main.exports = DotenvModule;
6249
6176
 
6250
6177
  function _resolveEscapeSequences (value) {
6251
6178
  return value.replace(/\\\$/g, '$')
@@ -6346,6 +6273,7 @@ function expand (options) {
6346
6273
 
6347
6274
  var expand_1 = expand;
6348
6275
 
6276
+ const debug = createDebugger("vite:env");
6349
6277
  function getEnvFilesForMode(mode, envDir) {
6350
6278
  return [
6351
6279
  /** default file */
@@ -6359,6 +6287,8 @@ function getEnvFilesForMode(mode, envDir) {
6359
6287
  ].map((file) => normalizePath(path$1.join(envDir, file)));
6360
6288
  }
6361
6289
  function loadEnv(mode, envDir, prefixes = "VITE_") {
6290
+ const start = performance.now();
6291
+ const getTime = () => `${(performance.now() - start).toFixed(2)}ms`;
6362
6292
  if (mode === "local") {
6363
6293
  throw new Error(
6364
6294
  `"local" cannot be used as a mode name because it conflicts with the .local postfix for .env files.`
@@ -6367,19 +6297,21 @@ function loadEnv(mode, envDir, prefixes = "VITE_") {
6367
6297
  prefixes = arraify(prefixes);
6368
6298
  const env = {};
6369
6299
  const envFiles = getEnvFilesForMode(mode, envDir);
6300
+ debug?.(`loading env files: %O`, envFiles);
6370
6301
  const parsed = Object.fromEntries(
6371
6302
  envFiles.flatMap((filePath) => {
6372
6303
  if (!tryStatSync(filePath)?.isFile()) return [];
6373
6304
  return Object.entries(parse_1(fs$1.readFileSync(filePath)));
6374
6305
  })
6375
6306
  );
6376
- if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {
6307
+ debug?.(`env files loaded in ${getTime()}`);
6308
+ if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === void 0) {
6377
6309
  process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
6378
6310
  }
6379
- if (parsed.BROWSER && process.env.BROWSER === undefined) {
6311
+ if (parsed.BROWSER && process.env.BROWSER === void 0) {
6380
6312
  process.env.BROWSER = parsed.BROWSER;
6381
6313
  }
6382
- if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) {
6314
+ if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === void 0) {
6383
6315
  process.env.BROWSER_ARGS = parsed.BROWSER_ARGS;
6384
6316
  }
6385
6317
  const processEnv = { ...process.env };
@@ -6394,6 +6326,7 @@ function loadEnv(mode, envDir, prefixes = "VITE_") {
6394
6326
  env[key] = process.env[key];
6395
6327
  }
6396
6328
  }
6329
+ debug?.(`using resolved env: %O`, env);
6397
6330
  return env;
6398
6331
  }
6399
6332
  function resolveEnvPrefix({