vite 6.0.2 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

@@ -1,4 +1,4 @@
1
- import { N as getDefaultExportFromCjs } from './dep-A4nAWF7x.js';
1
+ import { N as getDefaultExportFromCjs } from './dep-BZMjGe_U.js';
2
2
  import require$$0 from 'path';
3
3
  import { l as lib } from './dep-3RmXg9uo.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { O as commonjsGlobal, N as getDefaultExportFromCjs } from './dep-A4nAWF7x.js';
1
+ import { O as commonjsGlobal, N as getDefaultExportFromCjs } from './dep-BZMjGe_U.js';
2
2
  import require$$0$2 from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
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 { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-A4nAWF7x.js';
5
+ import { M as colors, G as createLogger, r as resolveConfig } from './chunks/dep-BZMjGe_U.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -740,7 +740,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
740
740
  `[boolean] force the optimizer to ignore the cache and re-bundle`
741
741
  ).action(async (root, options) => {
742
742
  filterDuplicateOptions(options);
743
- const { createServer } = await import('./chunks/dep-A4nAWF7x.js').then(function (n) { return n.Q; });
743
+ const { createServer } = await import('./chunks/dep-BZMjGe_U.js').then(function (n) { return n.Q; });
744
744
  try {
745
745
  const server = await createServer({
746
746
  root,
@@ -833,7 +833,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
833
833
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
834
834
  async (root, options) => {
835
835
  filterDuplicateOptions(options);
836
- const { createBuilder } = await import('./chunks/dep-A4nAWF7x.js').then(function (n) { return n.R; });
836
+ const { createBuilder } = await import('./chunks/dep-BZMjGe_U.js').then(function (n) { return n.R; });
837
837
  const buildOptions = cleanGlobalCLIOptions(
838
838
  cleanBuilderCLIOptions(options)
839
839
  );
@@ -868,7 +868,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
868
868
  ).action(
869
869
  async (root, options) => {
870
870
  filterDuplicateOptions(options);
871
- const { optimizeDeps } = await import('./chunks/dep-A4nAWF7x.js').then(function (n) { return n.P; });
871
+ const { optimizeDeps } = await import('./chunks/dep-BZMjGe_U.js').then(function (n) { return n.P; });
872
872
  try {
873
873
  const config = await resolveConfig(
874
874
  {
@@ -894,7 +894,7 @@ ${e.stack}`),
894
894
  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(
895
895
  async (root, options) => {
896
896
  filterDuplicateOptions(options);
897
- const { preview } = await import('./chunks/dep-A4nAWF7x.js').then(function (n) { return n.S; });
897
+ const { preview } = await import('./chunks/dep-BZMjGe_U.js').then(function (n) { return n.S; });
898
898
  try {
899
899
  const server = await preview({
900
900
  root,
@@ -1087,12 +1087,6 @@ declare class EnvironmentModuleGraph {
1087
1087
  getModuleByEtag(etag: string): EnvironmentModuleNode | undefined;
1088
1088
  }
1089
1089
 
1090
- /**
1091
- * Backward compatible ModuleNode and ModuleGraph with mixed nodes from both the client and ssr environments
1092
- * It would be good to take the types names for the new EnvironmentModuleNode and EnvironmentModuleGraph but we can't
1093
- * do that at this point without breaking to much code in the ecosystem.
1094
- * We are going to deprecate these types and we can try to use them back in the future.
1095
- */
1096
1090
  declare class ModuleNode {
1097
1091
  _moduleGraph: ModuleGraph;
1098
1092
  _clientModule: EnvironmentModuleNode | undefined;
@@ -1102,6 +1096,8 @@ declare class ModuleNode {
1102
1096
  _set<T extends keyof EnvironmentModuleNode>(prop: T, value: EnvironmentModuleNode[T]): void;
1103
1097
  _wrapModuleSet(prop: ModuleSetNames, module: EnvironmentModuleNode | undefined): Set<ModuleNode>;
1104
1098
  _getModuleSetUnion(prop: 'importedModules' | 'importers'): Set<ModuleNode>;
1099
+ _getModuleInfoUnion(prop: 'info'): ModuleInfo | undefined;
1100
+ _getModuleObjectUnion(prop: 'meta'): Record<string, any> | undefined;
1105
1101
  get url(): string;
1106
1102
  set url(value: string);
1107
1103
  get id(): string | null;
@@ -1251,9 +1247,9 @@ interface NormalizedHotChannel<Api = any> {
1251
1247
  */
1252
1248
  off(event: string, listener: Function): void;
1253
1249
  handleInvoke(payload: HotPayload): Promise<{
1254
- r: any;
1250
+ result: any;
1255
1251
  } | {
1256
- e: any;
1252
+ error: any;
1257
1253
  }>;
1258
1254
  /**
1259
1255
  * Start listening for messages
@@ -2780,6 +2776,11 @@ type Environment = DevEnvironment | BuildEnvironment | UnknownEnvironment;
2780
2776
  */
2781
2777
  declare function perEnvironmentState<State>(initial: (environment: Environment) => State): (context: PluginContext) => State;
2782
2778
 
2779
+ type SkipInformation = {
2780
+ id: string;
2781
+ importer: string | undefined;
2782
+ plugin: Plugin;
2783
+ };
2783
2784
  declare class EnvironmentPluginContainer {
2784
2785
  environment: Environment;
2785
2786
  plugins: Plugin[];
@@ -2809,7 +2810,9 @@ declare class EnvironmentPluginContainer {
2809
2810
  resolveId(rawId: string, importer?: string | undefined, options?: {
2810
2811
  attributes?: Record<string, string>;
2811
2812
  custom?: CustomPluginOptions;
2813
+ /** @deprecated use `skipCalls` instead */
2812
2814
  skip?: Set<Plugin>;
2815
+ skipCalls?: readonly SkipInformation[];
2813
2816
  isEntry?: boolean;
2814
2817
  }): Promise<PartialResolvedId | null>;
2815
2818
  load(id: string): Promise<LoadResult | null>;
@@ -2840,7 +2843,9 @@ declare class PluginContainer {
2840
2843
  resolveId(rawId: string, importer?: string, options?: {
2841
2844
  attributes?: Record<string, string>;
2842
2845
  custom?: CustomPluginOptions;
2846
+ /** @deprecated use `skipCalls` instead */
2843
2847
  skip?: Set<Plugin>;
2848
+ skipCalls?: readonly SkipInformation[];
2844
2849
  ssr?: boolean;
2845
2850
  isEntry?: boolean;
2846
2851
  }): Promise<PartialResolvedId | null>;
@@ -4102,4 +4107,4 @@ interface ManifestChunk {
4102
4107
  dynamicImports?: string[];
4103
4108
  }
4104
4109
 
4105
- export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESBuildTransformResult, type Environment, EnvironmentModuleGraph, EnvironmentModuleNode, type EnvironmentOptions, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotUpdateOptions, type HtmlTagDescriptor, HttpProxy, type HttpServer, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type OptimizedDepInfo, type Plugin, PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHMRChannel, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteBuilder, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
4110
+ export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESBuildTransformResult, type Environment, EnvironmentModuleGraph, EnvironmentModuleNode, type EnvironmentOptions, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotUpdateOptions, type HtmlTagDescriptor, HttpProxy, type HttpServer, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type OptimizedDepInfo, type Plugin, PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHMRChannel, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions, type SkipInformation, SplitVendorChunkCache, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteBuilder, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createBuilder, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-A4nAWF7x.js';
3
- export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, C as createFilter, h as createIdResolver, G as createLogger, n as createRunnableDevEnvironment, c as createServer, w as createServerHotChannel, v as createServerModuleRunner, d as defineConfig, u as fetchModule, j as formatPostcssSourceMap, J as isFileLoadingAllowed, I as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, K as loadEnv, A as mergeAlias, z as mergeConfig, x as moduleRunnerTransform, y as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, L as resolveEnvPrefix, E as rollupVersion, H as searchForWorkspaceRoot, F as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-A4nAWF7x.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-BZMjGe_U.js';
3
+ export { B as BuildEnvironment, D as DevEnvironment, f as build, m as buildErrorMessage, g as createBuilder, C as createFilter, h as createIdResolver, G as createLogger, n as createRunnableDevEnvironment, c as createServer, w as createServerHotChannel, v as createServerModuleRunner, d as defineConfig, u as fetchModule, j as formatPostcssSourceMap, J as isFileLoadingAllowed, I as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, K as loadEnv, A as mergeAlias, z as mergeConfig, x as moduleRunnerTransform, y as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, L as resolveEnvPrefix, E as rollupVersion, H as searchForWorkspaceRoot, F as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BZMjGe_U.js';
4
4
  export { 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';
@@ -101,7 +101,7 @@ function splitVendorChunkPlugin() {
101
101
  const cache = new SplitVendorChunkCache();
102
102
  caches.push(cache);
103
103
  const build = config.build ?? {};
104
- const format = output?.format;
104
+ const format = output.format;
105
105
  if (!build.ssr && !build.lib && format !== "umd" && format !== "iife") {
106
106
  return splitVendorChunk({ cache });
107
107
  }
@@ -109,7 +109,7 @@ function splitVendorChunkPlugin() {
109
109
  return {
110
110
  name: "vite:split-vendor-chunk",
111
111
  config(config) {
112
- let outputs = config?.build?.rollupOptions?.output;
112
+ let outputs = config.build?.rollupOptions?.output;
113
113
  if (outputs) {
114
114
  outputs = arraify(outputs);
115
115
  for (const output of outputs) {
@@ -68,9 +68,9 @@ interface ModuleRunnerTransport {
68
68
  disconnect?(): Promise<void> | void;
69
69
  send?(data: HotPayload): Promise<void> | void;
70
70
  invoke?(data: HotPayload): Promise<{
71
- r: any;
71
+ result: any;
72
72
  } | {
73
- e: any;
73
+ error: any;
74
74
  }>;
75
75
  timeout?: number;
76
76
  }
@@ -87,7 +87,7 @@ const isAbsolute = function(p) {
87
87
  return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
88
88
  };
89
89
  function normalizeAbsoluteUrl(url, root) {
90
- return url = slash(url), url.startsWith("file://") && (url = url.slice(isWindows ? 8 : 7)), url.startsWith(root) && (url = url.slice(root.length - 1)), url;
90
+ return url = slash(url), url.startsWith("file://") && (url = decodeURI(url.slice(isWindows ? 8 : 7))), url.startsWith(root) && (url = url.slice(root.length - 1)), url;
91
91
  }
92
92
  const decodeBase64 = typeof atob < "u" ? atob : (str) => Buffer.from(str, "base64").toString("utf-8"), CHAR_FORWARD_SLASH = 47, CHAR_BACKWARD_SLASH = 92, percentRegEx = /%/g, backslashRegEx = /\\/g, newlineRegEx = /\n/g, carriageReturnRegEx = /\r/g, tabRegEx = /\t/g, questionRegex = /\?/g, hashRegex = /#/g;
93
93
  function encodePathChars(filepath) {
@@ -532,7 +532,7 @@ const {${missingBindings.join(", ")}} = pkg;
532
532
  }
533
533
  }
534
534
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", nanoid = (size = 21) => {
535
- let id = "", i = size;
535
+ let id = "", i = size | 0;
536
536
  for (; i--; )
537
537
  id += urlAlphabet[Math.random() * 64 | 0];
538
538
  return id;
@@ -559,9 +559,9 @@ const createInvokeableTransport = (transport) => {
559
559
  data
560
560
  }
561
561
  });
562
- if ("e" in result)
563
- throw reviveInvokeError(result.e);
564
- return result.r;
562
+ if ("error" in result)
563
+ throw reviveInvokeError(result.error);
564
+ return result.result;
565
565
  }
566
566
  };
567
567
  if (!transport.send || !transport.connect)
@@ -580,8 +580,8 @@ const createInvokeableTransport = (transport) => {
580
580
  const invokeId = data.id.slice(9), promise = rpcPromises.get(invokeId);
581
581
  if (!promise) return;
582
582
  promise.timeoutId && clearTimeout(promise.timeoutId), rpcPromises.delete(invokeId);
583
- const { e, r } = data.data;
584
- e ? promise.reject(e) : promise.resolve(r);
583
+ const { error, result } = data.data;
584
+ error ? promise.reject(error) : promise.resolve(result);
585
585
  return;
586
586
  }
587
587
  }
@@ -819,11 +819,11 @@ function getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Se
819
819
  visited.add(moduleId);
820
820
  const module = runner.evaluatedModules.getModuleById(moduleId);
821
821
  if (module) {
822
- if (module.importers && !module.importers.size) {
822
+ if (!module.importers.size) {
823
823
  entrypoints.add(module.url);
824
824
  continue;
825
825
  }
826
- for (const importer of module.importers || [])
826
+ for (const importer of module.importers)
827
827
  getModulesEntrypoints(runner, [importer], visited, entrypoints);
828
828
  }
829
829
  }
@@ -831,7 +831,7 @@ function getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Se
831
831
  }
832
832
  function findAllEntrypoints(runner, entrypoints = /* @__PURE__ */ new Set()) {
833
833
  for (const mod of runner.evaluatedModules.idToModuleMap.values())
834
- mod.importers && !mod.importers.size && entrypoints.add(mod.url);
834
+ mod.importers.size || entrypoints.add(mod.url);
835
835
  return entrypoints;
836
836
  }
837
837
  const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => (...args) => {
@@ -928,7 +928,7 @@ function mapSourcePosition(position) {
928
928
  map: null
929
929
  };
930
930
  }
931
- if (sourceMap && sourceMap.map && sourceMap.url) {
931
+ if (sourceMap.map && sourceMap.url) {
932
932
  const originalPosition = getOriginalPosition(sourceMap.map, position);
933
933
  if (originalPosition && originalPosition.source != null)
934
934
  return originalPosition.source = supportRelativeURL(
@@ -574,24 +574,62 @@ function requireCommon () {
574
574
  createDebug.names = [];
575
575
  createDebug.skips = [];
576
576
 
577
- let i;
578
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
579
- const len = split.length;
580
-
581
- for (i = 0; i < len; i++) {
582
- if (!split[i]) {
583
- // ignore empty strings
584
- continue;
577
+ const split = (typeof namespaces === 'string' ? namespaces : '')
578
+ .trim()
579
+ .replace(' ', ',')
580
+ .split(',')
581
+ .filter(Boolean);
582
+
583
+ for (const ns of split) {
584
+ if (ns[0] === '-') {
585
+ createDebug.skips.push(ns.slice(1));
586
+ } else {
587
+ createDebug.names.push(ns);
585
588
  }
589
+ }
590
+ }
586
591
 
587
- namespaces = split[i].replace(/\*/g, '.*?');
588
-
589
- if (namespaces[0] === '-') {
590
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
592
+ /**
593
+ * Checks if the given string matches a namespace template, honoring
594
+ * asterisks as wildcards.
595
+ *
596
+ * @param {String} search
597
+ * @param {String} template
598
+ * @return {Boolean}
599
+ */
600
+ function matchesTemplate(search, template) {
601
+ let searchIndex = 0;
602
+ let templateIndex = 0;
603
+ let starIndex = -1;
604
+ let matchIndex = 0;
605
+
606
+ while (searchIndex < search.length) {
607
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
608
+ // Match character or proceed with wildcard
609
+ if (template[templateIndex] === '*') {
610
+ starIndex = templateIndex;
611
+ matchIndex = searchIndex;
612
+ templateIndex++; // Skip the '*'
613
+ } else {
614
+ searchIndex++;
615
+ templateIndex++;
616
+ }
617
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
618
+ // Backtrack to the last '*' and try to match more characters
619
+ templateIndex = starIndex + 1;
620
+ matchIndex++;
621
+ searchIndex = matchIndex;
591
622
  } else {
592
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
623
+ return false; // No match
593
624
  }
594
625
  }
626
+
627
+ // Handle trailing '*' in template
628
+ while (templateIndex < template.length && template[templateIndex] === '*') {
629
+ templateIndex++;
630
+ }
631
+
632
+ return templateIndex === template.length;
595
633
  }
596
634
 
597
635
  /**
@@ -602,8 +640,8 @@ function requireCommon () {
602
640
  */
603
641
  function disable() {
604
642
  const namespaces = [
605
- ...createDebug.names.map(toNamespace),
606
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
643
+ ...createDebug.names,
644
+ ...createDebug.skips.map(namespace => '-' + namespace)
607
645
  ].join(',');
608
646
  createDebug.enable('');
609
647
  return namespaces;
@@ -617,21 +655,14 @@ function requireCommon () {
617
655
  * @api public
618
656
  */
619
657
  function enabled(name) {
620
- if (name[name.length - 1] === '*') {
621
- return true;
622
- }
623
-
624
- let i;
625
- let len;
626
-
627
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
628
- if (createDebug.skips[i].test(name)) {
658
+ for (const skip of createDebug.skips) {
659
+ if (matchesTemplate(name, skip)) {
629
660
  return false;
630
661
  }
631
662
  }
632
663
 
633
- for (i = 0, len = createDebug.names.length; i < len; i++) {
634
- if (createDebug.names[i].test(name)) {
664
+ for (const ns of createDebug.names) {
665
+ if (matchesTemplate(name, ns)) {
635
666
  return true;
636
667
  }
637
668
  }
@@ -639,19 +670,6 @@ function requireCommon () {
639
670
  return false;
640
671
  }
641
672
 
642
- /**
643
- * Convert regexp to namespace
644
- *
645
- * @param {RegExp} regxep
646
- * @return {String} namespace
647
- * @api private
648
- */
649
- function toNamespace(regexp) {
650
- return regexp.toString()
651
- .substring(2, regexp.toString().length - 2)
652
- .replace(/\.\*\?$/, '*');
653
- }
654
-
655
673
  /**
656
674
  * Coerce `val`.
657
675
  *
@@ -820,6 +838,7 @@ function requireBrowser () {
820
838
 
821
839
  // Is webkit? http://stackoverflow.com/a/16459606/376773
822
840
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
841
+ // eslint-disable-next-line no-return-assign
823
842
  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
824
843
  // Is firebug? http://stackoverflow.com/a/398120/376773
825
844
  (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
@@ -3389,11 +3408,17 @@ const createFilter$1 = function createFilter(include, exclude, options) {
3389
3408
  const pathId = normalizePath$1(id);
3390
3409
  for (let i = 0; i < excludeMatchers.length; ++i) {
3391
3410
  const matcher = excludeMatchers[i];
3411
+ if (matcher instanceof RegExp) {
3412
+ matcher.lastIndex = 0;
3413
+ }
3392
3414
  if (matcher.test(pathId))
3393
3415
  return false;
3394
3416
  }
3395
3417
  for (let i = 0; i < includeMatchers.length; ++i) {
3396
3418
  const matcher = includeMatchers[i];
3419
+ if (matcher instanceof RegExp) {
3420
+ matcher.lastIndex = 0;
3421
+ }
3397
3422
  if (matcher.test(pathId))
3398
3423
  return true;
3399
3424
  }
@@ -3798,7 +3823,7 @@ function splitVendorChunkPlugin() {
3798
3823
  const cache = new SplitVendorChunkCache();
3799
3824
  caches.push(cache);
3800
3825
  const build = config.build ?? {};
3801
- const format = output?.format;
3826
+ const format = output.format;
3802
3827
  if (!build.ssr && !build.lib && format !== "umd" && format !== "iife") {
3803
3828
  return splitVendorChunk({ cache });
3804
3829
  }
@@ -3806,7 +3831,7 @@ function splitVendorChunkPlugin() {
3806
3831
  return {
3807
3832
  name: "vite:split-vendor-chunk",
3808
3833
  config(config) {
3809
- let outputs = config?.build?.rollupOptions?.output;
3834
+ let outputs = config.build?.rollupOptions?.output;
3810
3835
  if (outputs) {
3811
3836
  outputs = arraify(outputs);
3812
3837
  for (const output of outputs) {
@@ -4362,7 +4387,7 @@ class Chunk {
4362
4387
  // ' test'.trim()
4363
4388
  // split -> ' ' + 'test'
4364
4389
  // ✔️ edit -> '' + 'test'
4365
- // ✖️ edit -> 'test' + ''
4390
+ // ✖️ edit -> 'test' + ''
4366
4391
  // TODO is this block necessary?...
4367
4392
  newChunk.edit('', false);
4368
4393
  this.content = '';
@@ -4609,6 +4634,7 @@ class Mappings {
4609
4634
  this.raw[this.generatedCodeLine] = this.rawSegments = [];
4610
4635
  this.generatedCodeColumn = 0;
4611
4636
  first = true;
4637
+ charInHiresBoundary = false;
4612
4638
  } else {
4613
4639
  if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
4614
4640
  const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
@@ -4686,6 +4712,7 @@ class MagicString {
4686
4712
  storedNames: { writable: true, value: {} },
4687
4713
  indentStr: { writable: true, value: undefined },
4688
4714
  ignoreList: { writable: true, value: options.ignoreList },
4715
+ offset: { writable: true, value: options.offset || 0 },
4689
4716
  });
4690
4717
 
4691
4718
  this.byStart[0] = chunk;
@@ -4704,6 +4731,8 @@ class MagicString {
4704
4731
  }
4705
4732
 
4706
4733
  appendLeft(index, content) {
4734
+ index = index + this.offset;
4735
+
4707
4736
  if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
4708
4737
 
4709
4738
  this._split(index);
@@ -4719,6 +4748,8 @@ class MagicString {
4719
4748
  }
4720
4749
 
4721
4750
  appendRight(index, content) {
4751
+ index = index + this.offset;
4752
+
4722
4753
  if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
4723
4754
 
4724
4755
  this._split(index);
@@ -4734,7 +4765,7 @@ class MagicString {
4734
4765
  }
4735
4766
 
4736
4767
  clone() {
4737
- const cloned = new MagicString(this.original, { filename: this.filename });
4768
+ const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });
4738
4769
 
4739
4770
  let originalChunk = this.firstChunk;
4740
4771
  let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
@@ -4932,7 +4963,7 @@ class MagicString {
4932
4963
  if (!warned.insertLeft) {
4933
4964
  console.warn(
4934
4965
  'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',
4935
- ); // eslint-disable-line no-console
4966
+ );
4936
4967
  warned.insertLeft = true;
4937
4968
  }
4938
4969
 
@@ -4943,7 +4974,7 @@ class MagicString {
4943
4974
  if (!warned.insertRight) {
4944
4975
  console.warn(
4945
4976
  'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',
4946
- ); // eslint-disable-line no-console
4977
+ );
4947
4978
  warned.insertRight = true;
4948
4979
  }
4949
4980
 
@@ -4951,6 +4982,10 @@ class MagicString {
4951
4982
  }
4952
4983
 
4953
4984
  move(start, end, index) {
4985
+ start = start + this.offset;
4986
+ end = end + this.offset;
4987
+ index = index + this.offset;
4988
+
4954
4989
  if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');
4955
4990
 
4956
4991
  this._split(start);
@@ -4993,6 +5028,9 @@ class MagicString {
4993
5028
  }
4994
5029
 
4995
5030
  update(start, end, content, options) {
5031
+ start = start + this.offset;
5032
+ end = end + this.offset;
5033
+
4996
5034
  if (typeof content !== 'string') throw new TypeError('replacement content must be a string');
4997
5035
 
4998
5036
  if (this.original.length !== 0) {
@@ -5013,7 +5051,7 @@ class MagicString {
5013
5051
  if (!warned.storeName) {
5014
5052
  console.warn(
5015
5053
  'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',
5016
- ); // eslint-disable-line no-console
5054
+ );
5017
5055
  warned.storeName = true;
5018
5056
  }
5019
5057
 
@@ -5064,6 +5102,8 @@ class MagicString {
5064
5102
  }
5065
5103
 
5066
5104
  prependLeft(index, content) {
5105
+ index = index + this.offset;
5106
+
5067
5107
  if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
5068
5108
 
5069
5109
  this._split(index);
@@ -5079,6 +5119,8 @@ class MagicString {
5079
5119
  }
5080
5120
 
5081
5121
  prependRight(index, content) {
5122
+ index = index + this.offset;
5123
+
5082
5124
  if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
5083
5125
 
5084
5126
  this._split(index);
@@ -5094,6 +5136,9 @@ class MagicString {
5094
5136
  }
5095
5137
 
5096
5138
  remove(start, end) {
5139
+ start = start + this.offset;
5140
+ end = end + this.offset;
5141
+
5097
5142
  if (this.original.length !== 0) {
5098
5143
  while (start < 0) start += this.original.length;
5099
5144
  while (end < 0) end += this.original.length;
@@ -5120,6 +5165,9 @@ class MagicString {
5120
5165
  }
5121
5166
 
5122
5167
  reset(start, end) {
5168
+ start = start + this.offset;
5169
+ end = end + this.offset;
5170
+
5123
5171
  if (this.original.length !== 0) {
5124
5172
  while (start < 0) start += this.original.length;
5125
5173
  while (end < 0) end += this.original.length;
@@ -5184,7 +5232,10 @@ class MagicString {
5184
5232
  return this.intro + lineStr;
5185
5233
  }
5186
5234
 
5187
- slice(start = 0, end = this.original.length) {
5235
+ slice(start = 0, end = this.original.length - this.offset) {
5236
+ start = start + this.offset;
5237
+ end = end + this.offset;
5238
+
5188
5239
  if (this.original.length !== 0) {
5189
5240
  while (start < 0) start += this.original.length;
5190
5241
  while (end < 0) end += this.original.length;
@@ -5420,11 +5471,7 @@ class MagicString {
5420
5471
  if (match.index != null) {
5421
5472
  const replacement = getReplacement(match, this.original);
5422
5473
  if (replacement !== match[0]) {
5423
- this.overwrite(
5424
- match.index,
5425
- match.index + match[0].length,
5426
- replacement
5427
- );
5474
+ this.overwrite(match.index, match.index + match[0].length, replacement);
5428
5475
  }
5429
5476
  }
5430
5477
  });
@@ -5433,11 +5480,7 @@ class MagicString {
5433
5480
  if (match && match.index != null) {
5434
5481
  const replacement = getReplacement(match, this.original);
5435
5482
  if (replacement !== match[0]) {
5436
- this.overwrite(
5437
- match.index,
5438
- match.index + match[0].length,
5439
- replacement
5440
- );
5483
+ this.overwrite(match.index, match.index + match[0].length, replacement);
5441
5484
  }
5442
5485
  }
5443
5486
  }
@@ -5472,8 +5515,7 @@ class MagicString {
5472
5515
  index = original.indexOf(string, index + stringLength)
5473
5516
  ) {
5474
5517
  const previous = original.slice(index, index + stringLength);
5475
- if (previous !== replacement)
5476
- this.overwrite(index, index + stringLength, replacement);
5518
+ if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
5477
5519
  }
5478
5520
 
5479
5521
  return this;
@@ -5760,7 +5802,7 @@ function isFileLoadingAllowed(config, filePath) {
5760
5802
  var main$1 = {exports: {}};
5761
5803
 
5762
5804
  var name = "dotenv";
5763
- var version$1 = "16.4.5";
5805
+ var version$1 = "16.4.7";
5764
5806
  var description = "Loads environment variables from .env file";
5765
5807
  var main = "lib/main.js";
5766
5808
  var types = "lib/main.d.ts";
@@ -5781,10 +5823,9 @@ var exports$1 = {
5781
5823
  var scripts = {
5782
5824
  "dts-check": "tsc --project tests/types/tsconfig.json",
5783
5825
  lint: "standard",
5784
- "lint-readme": "standard-markdown",
5785
5826
  pretest: "npm run lint && npm run dts-check",
5786
- test: "tap tests/*.js --100 -Rspec",
5787
- "test:coverage": "tap --coverage-report=lcov",
5827
+ test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
5828
+ "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",
5788
5829
  prerelease: "npm test",
5789
5830
  release: "standard-version"
5790
5831
  };
@@ -5805,15 +5846,12 @@ var keywords = [
5805
5846
  var readmeFilename = "README.md";
5806
5847
  var license = "BSD-2-Clause";
5807
5848
  var devDependencies = {
5808
- "@definitelytyped/dtslint": "^0.0.133",
5809
5849
  "@types/node": "^18.11.3",
5810
- decache: "^4.6.1",
5850
+ decache: "^4.6.2",
5811
5851
  sinon: "^14.0.1",
5812
5852
  standard: "^17.0.0",
5813
- "standard-markdown": "^7.1.0",
5814
5853
  "standard-version": "^9.5.0",
5815
- tap: "^16.3.0",
5816
- tar: "^6.1.11",
5854
+ tap: "^19.2.0",
5817
5855
  typescript: "^4.8.4"
5818
5856
  };
5819
5857
  var engines = {