vite 6.0.0-alpha.21 → 6.0.0-alpha.22

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.
@@ -63301,8 +63301,8 @@ function createCachedImport(imp) {
63301
63301
  return cached;
63302
63302
  };
63303
63303
  }
63304
- const importPostcssImport = createCachedImport(() => import('./dep-B35KR9PC.js').then(function (n) { return n.i; }));
63305
- const importPostcssModules = createCachedImport(() => import('./dep-BAOcN7N1.js').then(function (n) { return n.i; }));
63304
+ const importPostcssImport = createCachedImport(() => import('./dep-BzHfSPcV.js').then(function (n) { return n.i; }));
63305
+ const importPostcssModules = createCachedImport(() => import('./dep-DGaPvi2R.js').then(function (n) { return n.i; }));
63306
63306
  const importPostcss = createCachedImport(() => import('postcss'));
63307
63307
  const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
63308
63308
  let alwaysFakeWorkerWorkerControllerCache;
@@ -67623,11 +67623,10 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
67623
67623
  config.root ? path$n.resolve(config.root) : process.cwd()
67624
67624
  );
67625
67625
  checkBadCharactersInPath(resolvedRoot, logger);
67626
- const { entries, force, ...deprecatedClientOptimizeDepsConfig } = config.optimizeDeps ?? {};
67627
67626
  const configEnvironmentsClient = config.environments.client;
67628
67627
  configEnvironmentsClient.dev ??= {};
67629
67628
  configEnvironmentsClient.dev.optimizeDeps = mergeConfig(
67630
- deprecatedClientOptimizeDepsConfig,
67629
+ config.optimizeDeps ?? {},
67631
67630
  configEnvironmentsClient.dev.optimizeDeps ?? {}
67632
67631
  );
67633
67632
  const deprecatedSsrOptimizeDepsConfig = config.ssr?.optimizeDeps ?? {};
@@ -1,4 +1,4 @@
1
- import { J as getDefaultExportFromCjs } from './dep-D2vSWyBt.js';
1
+ import { J as getDefaultExportFromCjs } from './dep-1C5gbBiU.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-IQS-Za7F.js';
@@ -1,4 +1,4 @@
1
- import { K as commonjsGlobal, J as getDefaultExportFromCjs } from './dep-D2vSWyBt.js';
1
+ import { K as commonjsGlobal, J as getDefaultExportFromCjs } from './dep-1C5gbBiU.js';
2
2
  import require$$0__default 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 { I as colors, A as createLogger, r as resolveConfig } from './chunks/dep-D2vSWyBt.js';
5
+ import { I as colors, A as createLogger, r as resolveConfig } from './chunks/dep-1C5gbBiU.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -736,7 +736,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
736
736
  `[boolean] force the optimizer to ignore the cache and re-bundle`
737
737
  ).action(async (root, options) => {
738
738
  filterDuplicateOptions(options);
739
- const { createServer } = await import('./chunks/dep-D2vSWyBt.js').then(function (n) { return n.M; });
739
+ const { createServer } = await import('./chunks/dep-1C5gbBiU.js').then(function (n) { return n.M; });
740
740
  try {
741
741
  const server = await createServer({
742
742
  root,
@@ -829,7 +829,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
829
829
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as builder.entireApp`).action(
830
830
  async (root, options) => {
831
831
  filterDuplicateOptions(options);
832
- const build = await import('./chunks/dep-D2vSWyBt.js').then(function (n) { return n.N; });
832
+ const build = await import('./chunks/dep-1C5gbBiU.js').then(function (n) { return n.N; });
833
833
  const buildOptions = cleanGlobalCLIOptions(
834
834
  cleanBuilderCLIOptions(options)
835
835
  );
@@ -884,7 +884,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
884
884
  ).action(
885
885
  async (root, options) => {
886
886
  filterDuplicateOptions(options);
887
- const { optimizeDeps } = await import('./chunks/dep-D2vSWyBt.js').then(function (n) { return n.L; });
887
+ const { optimizeDeps } = await import('./chunks/dep-1C5gbBiU.js').then(function (n) { return n.L; });
888
888
  try {
889
889
  const config = await resolveConfig(
890
890
  {
@@ -910,7 +910,7 @@ ${e.stack}`),
910
910
  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(
911
911
  async (root, options) => {
912
912
  filterDuplicateOptions(options);
913
- const { preview } = await import('./chunks/dep-D2vSWyBt.js').then(function (n) { return n.O; });
913
+ const { preview } = await import('./chunks/dep-1C5gbBiU.js').then(function (n) { return n.O; });
914
914
  try {
915
915
  const server = await preview({
916
916
  root,
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-D2vSWyBt.js';
3
- export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, x as createFilter, f as createIdResolver, A as createLogger, k as createNodeDevEnvironment, c as createServer, n as createServerModuleRunner, d as defineConfig, m as fetchModule, g as formatPostcssSourceMap, F as isFileLoadingAllowed, E as isFileServingAllowed, l as loadConfigFromFile, G as loadEnv, w as mergeAlias, v as mergeConfig, q as moduleRunnerTransform, u as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, H as resolveEnvPrefix, y as rollupVersion, C as searchForWorkspaceRoot, z as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-D2vSWyBt.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-1C5gbBiU.js';
3
+ export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, x as createFilter, f as createIdResolver, A as createLogger, k as createNodeDevEnvironment, c as createServer, n as createServerModuleRunner, d as defineConfig, m as fetchModule, g as formatPostcssSourceMap, F as isFileLoadingAllowed, E as isFileServingAllowed, l as loadConfigFromFile, G as loadEnv, w as mergeAlias, v as mergeConfig, q as moduleRunnerTransform, u as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, H as resolveEnvPrefix, y as rollupVersion, C as searchForWorkspaceRoot, z as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-1C5gbBiU.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import 'node:fs';
@@ -123,6 +123,7 @@ declare class ModuleRunner {
123
123
  private readonly transport;
124
124
  private readonly resetSourceMapSupport?;
125
125
  private readonly root;
126
+ private readonly moduleInfoCache;
126
127
  private destroyed;
127
128
  constructor(options: ModuleRunnerOptions, evaluator: ModuleEvaluator, debug?: ModuleRunnerDebugger | undefined);
128
129
  /**
@@ -148,6 +149,7 @@ declare class ModuleRunner {
148
149
  private isCircularImport;
149
150
  private cachedRequest;
150
151
  private cachedModule;
152
+ private getModuleInformation;
151
153
  protected directRequest(id: string, mod: ModuleCache, _callstack: string[]): Promise<any>;
152
154
  }
153
155
 
@@ -875,6 +875,7 @@ class ModuleRunner {
875
875
  transport;
876
876
  resetSourceMapSupport;
877
877
  root;
878
+ moduleInfoCache = /* @__PURE__ */ new Map();
878
879
  destroyed = !1;
879
880
  /**
880
881
  * URL to execute. Accepts file path, server path or id relative to the root.
@@ -959,6 +960,13 @@ ${getStack()}`
959
960
  }
960
961
  }
961
962
  async cachedModule(url, importer) {
963
+ const cacheKey = `${url}~~${importer}`;
964
+ let cached = this.moduleInfoCache.get(cacheKey);
965
+ return cached || (cached = this.getModuleInformation(url, importer).finally(() => {
966
+ this.moduleInfoCache.delete(cacheKey);
967
+ }), this.moduleInfoCache.set(cacheKey, cached)), cached;
968
+ }
969
+ async getModuleInformation(url, importer) {
962
970
  if (this.destroyed)
963
971
  throw new Error("Vite module runner has been destroyed.");
964
972
  this.debug?.("[module runner] fetching", url), url = normalizeAbsoluteUrl(url, this.root);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.0.0-alpha.21",
3
+ "version": "6.0.0-alpha.22",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",