vite 8.0.3 → 8.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.
package/client.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  /// <reference path="./types/importMeta.d.ts" />
2
2
 
3
+ // virtual modules
4
+ declare module 'vite/modulepreload-polyfill' {}
5
+
3
6
  // CSS modules
4
7
  type CSSModuleClasses = { readonly [key: string]: string }
5
8
 
@@ -8,34 +8,34 @@ interface FetchFunctionOptions {
8
8
  type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
9
9
  interface CachedFetchResult {
10
10
  /**
11
- * If module cached in the runner, we can just confirm
12
- * it wasn't invalidated on the server side.
11
+ * If the module is cached in the runner, this confirms
12
+ * it was not invalidated on the server side.
13
13
  */
14
14
  cache: true;
15
15
  }
16
16
  interface ExternalFetchResult {
17
17
  /**
18
- * The path to the externalized module starting with file://,
19
- * by default this will be imported via a dynamic "import"
20
- * instead of being transformed by vite and loaded with vite runner
18
+ * The path to the externalized module starting with file://.
19
+ * By default this will be imported via a dynamic "import"
20
+ * instead of being transformed by Vite and loaded with the Vite runner.
21
21
  */
22
22
  externalize: string;
23
23
  /**
24
- * Type of the module. Will be used to determine if import statement is correct.
25
- * For example, if Vite needs to throw an error if variable is not actually exported
24
+ * Type of the module. Used to determine if the import statement is correct.
25
+ * For example, if Vite needs to throw an error if a variable is not actually exported.
26
26
  */
27
27
  type: "module" | "commonjs" | "builtin" | "network";
28
28
  }
29
29
  interface ViteFetchResult {
30
30
  /**
31
- * Code that will be evaluated by vite runner
32
- * by default this will be wrapped in an async function
31
+ * Code that will be evaluated by the Vite runner.
32
+ * By default this will be wrapped in an async function.
33
33
  */
34
34
  code: string;
35
35
  /**
36
36
  * File path of the module on disk.
37
- * This will be resolved as import.meta.url/filename
38
- * Will be equal to `null` for virtual modules
37
+ * This will be resolved as import.meta.url/filename.
38
+ * Will be `null` for virtual modules.
39
39
  */
40
40
  file: string | null;
41
41
  /**
@@ -2,7 +2,7 @@ import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __
2
2
  import { A as OPTIMIZABLE_ENTRY_RE, C as ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, D as JS_TYPES_RE, E as FS_PREFIX, F as defaultAllowedOrigins, I as loopbackHosts, L as wildcardHosts, M as SPECIAL_QUERY_RE, N as VERSION, O as KNOWN_ASSET_TYPES, P as VITE_PACKAGE_DIR, R as require_picocolors, S as ENV_PUBLIC_PATH, T as ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET, _ as DEFAULT_SERVER_CONDITIONS, a as CLIENT_ENTRY, b as DEV_PROD_CONDITION, c as DEFAULT_ASSETS_INLINE_LIMIT, d as DEFAULT_CLIENT_MAIN_FIELDS, f as DEFAULT_CONFIG_FILES, g as DEFAULT_PREVIEW_PORT, h as DEFAULT_EXTERNAL_CONDITIONS, i as CLIENT_DIR, j as ROLLUP_HOOKS, k as METADATA_FILENAME, l as DEFAULT_ASSETS_RE, m as DEFAULT_EXTENSIONS, n as createLogger, o as CLIENT_PUBLIC_PATH, p as DEFAULT_DEV_PORT, r as printServerUrls, s as CSS_LANGS_RE, t as LogLevels, u as DEFAULT_CLIENT_CONDITIONS, v as DEFAULT_SERVER_MAIN_FIELDS, w as ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, x as ENV_ENTRY, y as DEP_VERSION_RE } from "./logger.js";
3
3
  import { builtinModules, createRequire } from "node:module";
4
4
  import { parseAst, parseAstAsync } from "rolldown/parseAst";
5
- import { esmExternalRequirePlugin } from "rolldown/plugins";
5
+ import { esmExternalRequirePlugin, esmExternalRequirePlugin as esmExternalRequirePlugin$1 } from "rolldown/plugins";
6
6
  import { TsconfigCache, Visitor, minify, minifySync, parse, parseSync, transformSync } from "rolldown/utils";
7
7
  import * as fs$1 from "node:fs";
8
8
  import fs, { existsSync, readFileSync } from "node:fs";
@@ -2252,7 +2252,7 @@ function hasBothRollupOptionsAndRolldownOptions(options) {
2252
2252
  options.worker,
2253
2253
  options.optimizeDeps,
2254
2254
  options.ssr?.optimizeDeps
2255
- ]) if (opt != null && opt.rollupOptions != null && opt.rolldownOptions != null) return true;
2255
+ ]) if (opt != null && opt.rollupOptions != null && opt.rolldownOptions != null && opt.rollupOptions !== opt.rolldownOptions) return true;
2256
2256
  return false;
2257
2257
  }
2258
2258
  function mergeConfigRecursively(defaults, overrides, rootPath) {
@@ -2521,6 +2521,25 @@ function monotonicDateNow() {
2521
2521
  lastDateNow++;
2522
2522
  return lastDateNow;
2523
2523
  }
2524
+ function formatAndTruncateFileList(files) {
2525
+ const MAX_LOG_LENGTH = 500;
2526
+ let log = "";
2527
+ let truncated = false;
2528
+ for (let i = 0; i < files.length; i++) {
2529
+ const file = files[i];
2530
+ if (log === "") log = file;
2531
+ else if (log.length + 2 + file.length < MAX_LOG_LENGTH) log += ", " + file;
2532
+ else {
2533
+ log += ` and ${files.length - i} more`;
2534
+ truncated = true;
2535
+ break;
2536
+ }
2537
+ }
2538
+ return {
2539
+ formatted: log,
2540
+ truncated
2541
+ };
2542
+ }
2524
2543
  //#endregion
2525
2544
  //#region src/node/plugin.ts
2526
2545
  async function resolveEnvironmentPlugins(environment) {
@@ -2795,7 +2814,7 @@ async function reloadOnTsconfigChange(server, changedFile) {
2795
2814
  }
2796
2815
  }
2797
2816
  //#endregion
2798
- //#region ../../node_modules/.pnpm/artichokie@0.4.2/node_modules/artichokie/dist/index.js
2817
+ //#region ../../node_modules/.pnpm/artichokie@0.4.3/node_modules/artichokie/dist/index.js
2799
2818
  const AsyncFunction = async function() {}.constructor;
2800
2819
  const codeToDataUrl = (code) => `data:application/javascript,${encodeURIComponent(code + "\n//# sourceURL=[worker-eval(artichokie)]")}`;
2801
2820
  const viteSsrDynamicImport = "__vite_ssr_dynamic_import__";
@@ -3024,10 +3043,10 @@ function genWorkerCode(fn, isModule, waitTimeout, parentFunctions) {
3024
3043
  else return resArgs.result;
3025
3044
  };
3026
3045
  asyncPort.on("message", (args) => {
3027
- const id$1 = args.id;
3028
- if (resolvers.has(id$1)) {
3029
- const { resolve, reject } = resolvers.get(id$1);
3030
- resolvers.delete(id$1);
3046
+ const id = args.id;
3047
+ if (resolvers.has(id)) {
3048
+ const { resolve, reject } = resolvers.get(id);
3049
+ resolvers.delete(id);
3031
3050
  if ("result" in args) resolve(args.result);
3032
3051
  else reject(args.error);
3033
3052
  }
@@ -15990,7 +16009,7 @@ require_subprotocol();
15990
16009
  require_websocket();
15991
16010
  var import_websocket_server = /* @__PURE__ */ __toESM(require_websocket_server(), 1);
15992
16011
  //#endregion
15993
- //#region ../../node_modules/.pnpm/host-validation-middleware@0.1.2/node_modules/host-validation-middleware/dist/index.js
16012
+ //#region ../../node_modules/.pnpm/host-validation-middleware@0.1.4/node_modules/host-validation-middleware/dist/index.js
15994
16013
  /**
15995
16014
  * This function assumes that the input is not malformed.
15996
16015
  * This is because we only care about browser requests.
@@ -16052,8 +16071,8 @@ function isHostAllowed(hostHeader, allowedHosts) {
16052
16071
  * If the host header is not in the allowed hosts list, a 403 Forbidden response
16053
16072
  * is sent.
16054
16073
  */
16055
- function hostValidationMiddleware$2(options) {
16056
- return async function hostValidationMiddleware$1(req, res, next) {
16074
+ function hostValidationMiddleware$1(options) {
16075
+ return async function hostValidationMiddleware(req, res, next) {
16057
16076
  const hostHeader = req.headers.host;
16058
16077
  if (!isHostAllowed(hostHeader, options.allowedHosts)) {
16059
16078
  const hostname = hostHeader?.replace(/:\d+$/, "") ?? "";
@@ -22944,7 +22963,7 @@ async function getHmrImplementation(config) {
22944
22963
  //#endregion
22945
22964
  //#region src/node/ssr/fetchModule.ts
22946
22965
  /**
22947
- * Fetch module information for Vite runner.
22966
+ * Fetch module information for Vite module runner.
22948
22967
  * @experimental
22949
22968
  */
22950
22969
  async function fetchModule(environment, url, importer, options = {}) {
@@ -23107,6 +23126,9 @@ function createDepsOptimizer(environment) {
23107
23126
  (async () => {
23108
23127
  try {
23109
23128
  debug$9?.(import_picocolors.default.green(`scanning for dependencies...`));
23129
+ const scanTimer = setTimeout(() => {
23130
+ logger.info("[optimizer] scanning dependencies...", { timestamp: true });
23131
+ }, 1e3);
23110
23132
  let deps;
23111
23133
  try {
23112
23134
  discover = discoverProjectDependencies(devToScanEnvironment(environment));
@@ -23115,6 +23137,8 @@ function createDepsOptimizer(environment) {
23115
23137
  } catch (e) {
23116
23138
  environment.logger.error(import_picocolors.default.red("(!) Failed to run dependency scan. Skipping dependency pre-bundling. " + e.stack));
23117
23139
  return;
23140
+ } finally {
23141
+ clearTimeout(scanTimer);
23118
23142
  }
23119
23143
  const manuallyIncluded = Object.keys(manuallyIncludedDepsInfo);
23120
23144
  discoveredDepsWhileScanning.push(...Object.keys(metadata.discovered).filter((dep) => !deps[dep] && !manuallyIncluded.includes(dep)));
@@ -24427,6 +24451,12 @@ var DevEnvironment = class extends BaseEnvironment {
24427
24451
  await this.depsOptimizer?.init();
24428
24452
  warmupFiles(server, this);
24429
24453
  }
24454
+ /**
24455
+ * Called by the module runner to retrieve information about the specified
24456
+ * module. Internally calls `transformRequest` and wraps the result in the
24457
+ * format that the module runner understands.
24458
+ * This method is not meant to be called manually.
24459
+ */
24430
24460
  fetchModule(id, importer, options) {
24431
24461
  return fetchModule(this, id, importer, {
24432
24462
  ...this._remoteRunnerOptions,
@@ -24755,7 +24785,10 @@ var FullBundleDevEnvironment = class extends DevEnvironment {
24755
24785
  type: "update",
24756
24786
  updates
24757
24787
  });
24758
- this.logger.info(import_picocolors.default.green(`hmr update `) + import_picocolors.default.dim([...new Set(updates.map((u) => u.path))].join(", ")), {
24788
+ const filePaths = [...new Set(updates.map((u) => u.path))];
24789
+ const { formatted, truncated } = formatAndTruncateFileList(filePaths);
24790
+ if (truncated) debugHmr?.(`hmr update ${filePaths.join(", ")}`);
24791
+ this.logger.info(import_picocolors.default.green(`hmr update `) + import_picocolors.default.dim(formatted), {
24759
24792
  clear: !invalidateInformation,
24760
24793
  timestamp: true
24761
24794
  });
@@ -25805,7 +25838,7 @@ function getAdditionalAllowedHosts(resolvedServerOptions, resolvedPreviewOptions
25805
25838
  return list;
25806
25839
  }
25807
25840
  function hostValidationMiddleware(allowedHosts, isPreview) {
25808
- return hostValidationMiddleware$2({
25841
+ return hostValidationMiddleware$1({
25809
25842
  allowedHosts: Object.freeze([...allowedHosts]),
25810
25843
  generateErrorMessage(hostname) {
25811
25844
  const hostnameWithQuotes = JSON.stringify(hostname);
@@ -26681,7 +26714,10 @@ function updateModules(environment, file, modules, timestamp, firstInvalidatedBy
26681
26714
  debugHmr?.(import_picocolors.default.yellow(`no update happened `) + import_picocolors.default.dim(file));
26682
26715
  return;
26683
26716
  }
26684
- environment.logger.info(import_picocolors.default.green(`hmr update `) + import_picocolors.default.dim([...new Set(updates.map((u) => u.path))].join(", ")), {
26717
+ const filePaths = [...new Set(updates.map((u) => u.path))];
26718
+ const { formatted, truncated } = formatAndTruncateFileList(filePaths);
26719
+ if (truncated) debugHmr?.(`hmr update ${filePaths.join(", ")}`);
26720
+ environment.logger.info(import_picocolors.default.green(`hmr update `) + import_picocolors.default.dim(formatted), {
26685
26721
  clear: !firstInvalidatedBy,
26686
26722
  timestamp: true
26687
26723
  });
@@ -29056,7 +29092,7 @@ function createFilterForTransform(idFilter, codeFilter, moduleTypeFilter, cwd) {
29056
29092
  };
29057
29093
  }
29058
29094
  //#endregion
29059
- //#region ../../node_modules/.pnpm/@vitest+utils@4.1.0/node_modules/@vitest/utils/dist/helpers.js
29095
+ //#region ../../node_modules/.pnpm/@vitest+utils@4.1.2/node_modules/@vitest/utils/dist/helpers.js
29060
29096
  function notNullish(v) {
29061
29097
  return v != null;
29062
29098
  }
@@ -29064,7 +29100,7 @@ function isPrimitive(value) {
29064
29100
  return value === null || typeof value !== "function" && typeof value !== "object";
29065
29101
  }
29066
29102
  //#endregion
29067
- //#region ../../node_modules/.pnpm/@vitest+utils@4.1.0/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
29103
+ //#region ../../node_modules/.pnpm/@vitest+utils@4.1.2/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
29068
29104
  const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
29069
29105
  function normalizeWindowsPath(input = "") {
29070
29106
  if (!input) return input;
@@ -29143,7 +29179,7 @@ const isAbsolute$2 = function(p) {
29143
29179
  return _IS_ABSOLUTE_RE.test(p);
29144
29180
  };
29145
29181
  //#endregion
29146
- //#region ../../node_modules/.pnpm/@vitest+utils@4.1.0/node_modules/@vitest/utils/dist/source-map.js
29182
+ //#region ../../node_modules/.pnpm/@vitest+utils@4.1.2/node_modules/@vitest/utils/dist/source-map.js
29147
29183
  var comma = ",".charCodeAt(0);
29148
29184
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
29149
29185
  var intToChar = new Uint8Array(64);
@@ -31352,9 +31388,15 @@ function runOptimizeDeps(environment, depsInfo) {
31352
31388
  cancel: cleanUp
31353
31389
  };
31354
31390
  const start = performance$1.now();
31391
+ const bundleTimer = setTimeout(() => {
31392
+ environment.logger.info("[optimizer] bundling dependencies...", { timestamp: true });
31393
+ }, 1e3);
31355
31394
  const preparedRun = prepareRolldownOptimizerRun(environment, depsInfo, processingCacheDir, optimizerContext);
31356
31395
  const runResult = preparedRun.then(({ context, idToExports }) => {
31357
- if (!context || optimizerContext.cancelled) return cancelledResult;
31396
+ if (!context || optimizerContext.cancelled) {
31397
+ clearTimeout(bundleTimer);
31398
+ return cancelledResult;
31399
+ }
31358
31400
  return context.build().then((result) => {
31359
31401
  const depForEntryFileName = {};
31360
31402
  for (const dep of Object.values(depsInfo)) {
@@ -31385,9 +31427,11 @@ function runOptimizeDeps(environment, depsInfo) {
31385
31427
  });
31386
31428
  }
31387
31429
  }
31430
+ clearTimeout(bundleTimer);
31388
31431
  debug$2?.(`Dependencies bundled in ${(performance$1.now() - start).toFixed(2)}ms`);
31389
31432
  return successfulResult;
31390
31433
  }).catch((e) => {
31434
+ clearTimeout(bundleTimer);
31391
31435
  if (e.errors && e.message.includes("The build was canceled")) return cancelledResult;
31392
31436
  e.message = import_picocolors.default.red("Error during dependency optimization:\n\n") + e.message;
31393
31437
  throw e;
@@ -32015,6 +32059,7 @@ function resolveSubpathImports(id, importer, options) {
32015
32059
  importsPath = path.relative(basedir, path.join(pkgData.dir, importsPath));
32016
32060
  if (!relativePrefixRE.test(importsPath)) importsPath = `./${importsPath}`;
32017
32061
  }
32062
+ if (importsPath == null) return;
32018
32063
  return importsPath + postfix;
32019
32064
  }
32020
32065
  function ensureVersionQuery(resolved, id, options, depsOptimizer) {
@@ -32648,7 +32693,7 @@ const _buildEnvironmentOptionsDefaults = Object.freeze({
32648
32693
  watch: null
32649
32694
  });
32650
32695
  const buildEnvironmentOptionsDefaults = _buildEnvironmentOptionsDefaults;
32651
- function resolveBuildEnvironmentOptions(raw, logger, consumer, isBundledDev) {
32696
+ function resolveBuildEnvironmentOptions(raw, logger, consumer, isBundledDev, isSsrTargetWebworkerEnvironment) {
32652
32697
  const deprecatedPolyfillModulePreload = raw.polyfillModulePreload;
32653
32698
  const { polyfillModulePreload, ...rest } = raw;
32654
32699
  raw = rest;
@@ -32666,7 +32711,7 @@ function resolveBuildEnvironmentOptions(raw, logger, consumer, isBundledDev) {
32666
32711
  }, raw);
32667
32712
  setupRollupOptionCompat(merged, "build");
32668
32713
  merged.rolldownOptions = {
32669
- platform: consumer === "server" ? "node" : "browser",
32714
+ platform: consumer === "client" || isSsrTargetWebworkerEnvironment ? "browser" : "node",
32670
32715
  ...merged.rolldownOptions
32671
32716
  };
32672
32717
  if (merged.target === "baseline-widely-available") merged.target = ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET;
@@ -32760,6 +32805,7 @@ function resolveRolldownOptions(environment, chunkMetadataMap) {
32760
32805
  }
32761
32806
  };
32762
32807
  const isSsrTargetWebworkerEnvironment = environment.name === "ssr" && environment.getTopLevelConfig().ssr?.target === "webworker";
32808
+ if (isSsrTargetWebworkerEnvironment) plugins.push(esmExternalRequirePlugin());
32763
32809
  const buildOutputOptions = (output = {}) => {
32764
32810
  if (output.output) logger.warn("You've set \"rollupOptions.output.output\" in your config. This is deprecated and will override all Vite.js default output options. Please use \"rollupOptions.output\" instead.");
32765
32811
  if (output.file) throw new Error("Vite does not support \"rollupOptions.output.file\". Please use \"rollupOptions.output.dir\" and \"rollupOptions.output.entryFileNames\" instead.");
@@ -33880,7 +33926,7 @@ function resolveEnvironmentOptions(options, alias, preserveSymlinks, forceOptimi
33880
33926
  consumer,
33881
33927
  optimizeDeps: resolveDepOptimizationOptions(options.optimizeDeps, resolve.preserveSymlinks, forceOptimizeDeps, consumer, logger),
33882
33928
  dev: resolveDevEnvironmentOptions(options.dev, environmentName, consumer, preTransformRequests),
33883
- build: resolveBuildEnvironmentOptions(options.build ?? {}, logger, consumer, isBundledDev),
33929
+ build: resolveBuildEnvironmentOptions(options.build ?? {}, logger, consumer, isBundledDev, isSsrTargetWebworkerEnvironment),
33884
33930
  plugins: void 0,
33885
33931
  optimizeDepsPluginNames: void 0
33886
33932
  };
@@ -34676,4 +34722,4 @@ const parseAst$1 = parseAst;
34676
34722
  const parseAstAsync$1 = parseAstAsync;
34677
34723
  const esbuildVersion = "0.25.0";
34678
34724
  //#endregion
34679
- export { depsFromOptimizedDepInfo as $, builderOptionsDefaults as A, searchForWorkspaceRoot as At, resolveBuilderOptions as B, transformWithEsbuild as Bt, resolvePreviewOptions as C, send as Ct, ChunkMetadataMap as D, fetchModule as Dt, BuildEnvironment as E, isFileServingAllowed as Et, injectEnvironmentToHooks as F, createServerModuleRunnerTransport as Ft, toOutputFilePathInHtml as G, mergeConfig as Gt, resolveRolldownOptions as H, createFilter$1 as Ht, onRollupLog as I, buildErrorMessage as It, addManuallyIncludedOptimizeDeps as J, rollupVersion as Jt, toOutputFilePathInJS as K, normalizePath as Kt, resolveBuildEnvironmentOptions as L, loadEnv as Lt, createBuilder as M, perEnvironmentState as Mt, createToImportMetaURLBasedRelativeRuntime as N, ssrTransform as Nt, build as O, formatPostcssSourceMap as Ot, enhanceRollupError as P, createServerModuleRunner as Pt, createIsOptimizedDepUrl as Q, resolveBuildOutputs as R, resolveEnvPrefix as Rt, preview as S, serverConfigDefaults as St, isRunnableDevEnvironment as T, isFileLoadingAllowed as Tt, resolveUserExternal as U, isCSSRequest as Ut, resolveLibFilename as V, perEnvironmentPlugin as Vt, toOutputFilePathInCss as W, mergeAlias as Wt, cleanupDepsCacheStaleDirs as X, addOptimizedDepInfo as Y, withFilter as Yt, createIsOptimizedDepFile as Z, resolveConfig as _, createServer$2 as _t, minifySync as a, initDepsOptimizerMetadata as at, sortUserPlugins as b, resolveServerOptions as bt, parseAstAsync$1 as c, optimizeDeps as ct, isFetchableDevEnvironment as d, optimizedDepInfoFromId as dt, depsLogString as et, defineConfig as f, optimizedDepNeedsInterop as ft, resolveBaseUrl as g, _createServer as gt, loadConfigFromFile as h, createServerHotChannel as ht, minify as i, getOptimizedDepPath as it, clearLine as j, createIdResolver as jt, buildEnvironmentOptionsDefaults as k, preprocessCSS as kt, parseSync as l, optimizeExplicitEnvironmentDeps as lt, isResolvedConfig as m, toDiscoveredDependencies as mt, esbuildVersion as n, extractExportsData as nt, parse as o, isDepOptimizationDisabled as ot, getDefaultEnvironmentOptions as p, runOptimizeDeps as pt, toOutputFilePathWithoutRuntime as q, rolldownVersion as qt, esmExternalRequirePlugin as r, getDepsCacheDir as rt, parseAst$1 as s, loadCachedDepOptimizationMetadata as st, Visitor as t, discoverProjectDependencies as tt, createFetchableDevEnvironment as u, optimizedDepInfoFromFile as ut, resolveDevEnvironmentOptions as v, createServerCloseFn as vt, createRunnableDevEnvironment as w, DevEnvironment as wt, runnerImport as x, restartServerWithUrls as xt, resolveDevToolsConfig as y, resolveForwardConsoleOptions as yt, resolveBuildPlugins as z, transformWithOxc as zt };
34725
+ export { depsFromOptimizedDepInfo as $, builderOptionsDefaults as A, searchForWorkspaceRoot as At, resolveBuilderOptions as B, transformWithEsbuild as Bt, resolvePreviewOptions as C, send as Ct, ChunkMetadataMap as D, fetchModule as Dt, BuildEnvironment as E, isFileServingAllowed as Et, injectEnvironmentToHooks as F, createServerModuleRunnerTransport as Ft, toOutputFilePathInHtml as G, mergeConfig as Gt, resolveRolldownOptions as H, createFilter$1 as Ht, onRollupLog as I, buildErrorMessage as It, addManuallyIncludedOptimizeDeps as J, rollupVersion as Jt, toOutputFilePathInJS as K, normalizePath as Kt, resolveBuildEnvironmentOptions as L, loadEnv as Lt, createBuilder as M, perEnvironmentState as Mt, createToImportMetaURLBasedRelativeRuntime as N, ssrTransform as Nt, build as O, formatPostcssSourceMap as Ot, enhanceRollupError as P, createServerModuleRunner as Pt, createIsOptimizedDepUrl as Q, resolveBuildOutputs as R, resolveEnvPrefix as Rt, preview as S, serverConfigDefaults as St, isRunnableDevEnvironment as T, isFileLoadingAllowed as Tt, resolveUserExternal as U, isCSSRequest as Ut, resolveLibFilename as V, perEnvironmentPlugin as Vt, toOutputFilePathInCss as W, mergeAlias as Wt, cleanupDepsCacheStaleDirs as X, addOptimizedDepInfo as Y, withFilter as Yt, createIsOptimizedDepFile as Z, resolveConfig as _, createServer$2 as _t, minifySync as a, initDepsOptimizerMetadata as at, sortUserPlugins as b, resolveServerOptions as bt, parseAstAsync$1 as c, optimizeDeps as ct, isFetchableDevEnvironment as d, optimizedDepInfoFromId as dt, depsLogString as et, defineConfig as f, optimizedDepNeedsInterop as ft, resolveBaseUrl as g, _createServer as gt, loadConfigFromFile as h, createServerHotChannel as ht, minify as i, getOptimizedDepPath as it, clearLine as j, createIdResolver as jt, buildEnvironmentOptionsDefaults as k, preprocessCSS as kt, parseSync as l, optimizeExplicitEnvironmentDeps as lt, isResolvedConfig as m, toDiscoveredDependencies as mt, esbuildVersion as n, extractExportsData as nt, parse as o, isDepOptimizationDisabled as ot, getDefaultEnvironmentOptions as p, runOptimizeDeps as pt, toOutputFilePathWithoutRuntime as q, rolldownVersion as qt, esmExternalRequirePlugin$1 as r, getDepsCacheDir as rt, parseAst$1 as s, loadCachedDepOptimizationMetadata as st, Visitor as t, discoverProjectDependencies as tt, createFetchableDevEnvironment as u, optimizedDepInfoFromFile as ut, resolveDevEnvironmentOptions as v, createServerCloseFn as vt, createRunnableDevEnvironment as w, DevEnvironment as wt, runnerImport as x, restartServerWithUrls as xt, resolveDevToolsConfig as y, resolveForwardConsoleOptions as yt, resolveBuildPlugins as z, transformWithOxc as zt };
@@ -31,7 +31,7 @@ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownA
31
31
 
32
32
  //#region \0rolldown/runtime.js
33
33
  //#endregion
34
- //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.5_typescript@5.9.3_vite@packages+vite_vue@3.5.30_typescript@5.9.3_/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
34
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.13_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
35
35
  //#region src/node/cli-commands.d.ts
36
36
  interface StartOptions {
37
37
  root?: string;
@@ -41,7 +41,7 @@ interface StartOptions {
41
41
  open?: boolean;
42
42
  }
43
43
  //#endregion
44
- //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.5_typescript@5.9.3_vite@packages+vite_vue@3.5.30_typescript@5.9.3_/node_modules/@vitejs/devtools/dist/config.d.ts
44
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.13_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
45
45
  //#region src/node/config.d.ts
46
46
  interface DevToolsConfig extends Partial<StartOptions> {
47
47
  enabled: boolean;
@@ -1608,6 +1608,12 @@ declare class DevEnvironment extends BaseEnvironment {
1608
1608
  * - new instance `listen`
1609
1609
  */
1610
1610
  listen(server: ViteDevServer): Promise<void>;
1611
+ /**
1612
+ * Called by the module runner to retrieve information about the specified
1613
+ * module. Internally calls `transformRequest` and wraps the result in the
1614
+ * format that the module runner understands.
1615
+ * This method is not meant to be called manually.
1616
+ */
1611
1617
  fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
1612
1618
  reloadModule(module: EnvironmentModuleNode): Promise<void>;
1613
1619
  transformRequest(url: string, options?: TransformOptionsInternal): Promise<TransformResult | null>;
@@ -3727,7 +3733,7 @@ interface FetchModuleOptions {
3727
3733
  startOffset?: number;
3728
3734
  }
3729
3735
  /**
3730
- * Fetch module information for Vite runner.
3736
+ * Fetch module information for Vite module runner.
3731
3737
  * @experimental
3732
3738
  */
3733
3739
  declare function fetchModule(environment: DevEnvironment, url: string, importer?: string, options?: FetchModuleOptions): Promise<moduleRunner_FetchResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "8.0.3",
3
+ "version": "8.0.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -80,10 +80,10 @@
80
80
  "@vercel/detect-agent": "^1.2.1",
81
81
  "@types/escape-html": "^1.0.4",
82
82
  "@types/pnpapi": "^0.0.5",
83
- "@vitest/utils": "4.1.0",
84
- "@vitejs/devtools": "^0.1.5",
85
- "artichokie": "^0.4.2",
86
- "baseline-browser-mapping": "^2.10.10",
83
+ "@vitest/utils": "4.1.2",
84
+ "@vitejs/devtools": "^0.1.13",
85
+ "artichokie": "^0.4.3",
86
+ "baseline-browser-mapping": "^2.10.15",
87
87
  "cac": "^7.0.0",
88
88
  "chokidar": "^3.6.0",
89
89
  "connect": "^3.7.0",
@@ -92,11 +92,11 @@
92
92
  "cross-spawn": "^7.0.6",
93
93
  "dotenv-expand": "^12.0.3",
94
94
  "es-module-lexer": "^1.7.0",
95
- "esbuild": "^0.27.4",
95
+ "esbuild": "^0.28.0",
96
96
  "escape-html": "^1.0.3",
97
97
  "estree-walker": "^3.0.3",
98
98
  "etag": "^1.8.1",
99
- "host-validation-middleware": "^0.1.2",
99
+ "host-validation-middleware": "^0.1.4",
100
100
  "http-proxy-3": "^1.23.2",
101
101
  "launch-editor-middleware": "^2.13.2",
102
102
  "magic-string": "^0.30.21",
@@ -114,11 +114,11 @@
114
114
  "postcss-modules": "^6.0.1",
115
115
  "premove": "^4.0.0",
116
116
  "resolve.exports": "^2.0.3",
117
- "rolldown-plugin-dts": "^0.22.5",
117
+ "rolldown-plugin-dts": "^0.23.2",
118
118
  "rollup": "^4.59.0",
119
119
  "rollup-plugin-license": "^3.7.0",
120
- "sass": "^1.98.0",
121
- "sass-embedded": "^1.98.0",
120
+ "sass": "^1.99.0",
121
+ "sass-embedded": "^1.99.0",
122
122
  "sirv": "^3.0.2",
123
123
  "strip-literal": "^3.1.0",
124
124
  "terser": "^5.46.1",
@@ -128,7 +128,7 @@
128
128
  "peerDependencies": {
129
129
  "@types/node": "^20.19.0 || >=22.12.0",
130
130
  "@vitejs/devtools": "^0.1.0",
131
- "esbuild": "^0.27.0",
131
+ "esbuild": "^0.27.0 || ^0.28.0",
132
132
  "jiti": ">=1.21.0",
133
133
  "less": "^4.0.0",
134
134
  "sass": "^1.70.0",