vite 6.3.0-beta.0 → 6.3.0-beta.1

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 { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-Bt1yO2CH.js';
1
+ import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-CY3sqczG.js';
2
2
  import require$$0$2 from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -1,4 +1,4 @@
1
- import { P as getDefaultExportFromCjs } from './dep-Bt1yO2CH.js';
1
+ import { P as getDefaultExportFromCjs } from './dep-CY3sqczG.js';
2
2
  import require$$0 from 'path';
3
3
  import { l as lib } from './dep-3RmXg9uo.js';
4
4
 
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-Bt1yO2CH.js';
5
+ import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-CY3sqczG.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -747,7 +747,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
747
747
  `[boolean] force the optimizer to ignore the cache and re-bundle`
748
748
  ).action(async (root, options) => {
749
749
  filterDuplicateOptions(options);
750
- const { createServer } = await import('./chunks/dep-Bt1yO2CH.js').then(function (n) { return n.S; });
750
+ const { createServer } = await import('./chunks/dep-CY3sqczG.js').then(function (n) { return n.S; });
751
751
  try {
752
752
  const server = await createServer({
753
753
  root,
@@ -842,7 +842,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
842
842
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
843
843
  async (root, options) => {
844
844
  filterDuplicateOptions(options);
845
- const { createBuilder } = await import('./chunks/dep-Bt1yO2CH.js').then(function (n) { return n.T; });
845
+ const { createBuilder } = await import('./chunks/dep-CY3sqczG.js').then(function (n) { return n.T; });
846
846
  const buildOptions = cleanGlobalCLIOptions(
847
847
  cleanBuilderCLIOptions(options)
848
848
  );
@@ -881,7 +881,7 @@ cli.command(
881
881
  ).action(
882
882
  async (root, options) => {
883
883
  filterDuplicateOptions(options);
884
- const { optimizeDeps } = await import('./chunks/dep-Bt1yO2CH.js').then(function (n) { return n.R; });
884
+ const { optimizeDeps } = await import('./chunks/dep-CY3sqczG.js').then(function (n) { return n.R; });
885
885
  try {
886
886
  const config = await resolveConfig(
887
887
  {
@@ -908,7 +908,7 @@ ${e.stack}`),
908
908
  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(
909
909
  async (root, options) => {
910
910
  filterDuplicateOptions(options);
911
- const { preview } = await import('./chunks/dep-Bt1yO2CH.js').then(function (n) { return n.U; });
911
+ const { preview } = await import('./chunks/dep-CY3sqczG.js').then(function (n) { return n.U; });
912
912
  try {
913
913
  const server = await preview({
914
914
  root,
@@ -848,7 +848,7 @@ declare class BaseEnvironment extends PartialEnvironment {
848
848
  * const isDev = environment.mode === 'dev' // good
849
849
  * ```
850
850
  *
851
- * You should also not check against `"unknown"` specfically. It's
851
+ * You should also not check against `"unknown"` specifically. It's
852
852
  * a placeholder for more possible environment types.
853
853
  */
854
854
  declare class UnknownEnvironment extends BaseEnvironment {
@@ -3200,9 +3200,9 @@ type IndexHtmlTransform = IndexHtmlTransformHook | {
3200
3200
  handler: IndexHtmlTransformHook;
3201
3201
  };
3202
3202
 
3203
- type StringFilter = string | RegExp | Array<string | RegExp> | {
3204
- include?: string | RegExp | Array<string | RegExp>;
3205
- exclude?: string | RegExp | Array<string | RegExp>;
3203
+ type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
3204
+ include?: Value | Array<Value>;
3205
+ exclude?: Value | Array<Value>;
3206
3206
  };
3207
3207
 
3208
3208
  /**
@@ -3287,7 +3287,7 @@ interface Plugin<A = any> extends rollup.Plugin<A> {
3287
3287
  isEntry: boolean;
3288
3288
  }) => Promise<ResolveIdResult> | ResolveIdResult, {
3289
3289
  filter?: {
3290
- id?: StringFilter;
3290
+ id?: StringFilter<RegExp>;
3291
3291
  };
3292
3292
  }>;
3293
3293
  load?: ObjectHook<(this: PluginContext, id: string, options?: {
@@ -3855,7 +3855,7 @@ interface UserConfig extends DefaultEnvironmentOptions {
3855
3855
  * root.
3856
3856
  * @default root
3857
3857
  */
3858
- envDir?: string;
3858
+ envDir?: string | false;
3859
3859
  /**
3860
3860
  * Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
3861
3861
  * @default 'VITE_'
@@ -3983,6 +3983,7 @@ interface InlineConfig extends UserConfig {
3983
3983
  configFile?: string | false;
3984
3984
  /** @experimental */
3985
3985
  configLoader?: 'bundle' | 'runner' | 'native';
3986
+ /** @deprecated */
3986
3987
  envFile?: false;
3987
3988
  forceOptimizeDeps?: boolean;
3988
3989
  }
@@ -3998,7 +3999,7 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, 'plugins' | 'css' | '
3998
3999
  mode: string;
3999
4000
  isWorker: boolean;
4000
4001
  isProduction: boolean;
4001
- envDir: string;
4002
+ envDir: string | false;
4002
4003
  env: Record<string, any>;
4003
4004
  resolve: Required<ResolveOptions> & {
4004
4005
  alias: Alias[];
@@ -4204,7 +4205,7 @@ declare function isFileServingAllowed(config: ResolvedConfig, url: string): bool
4204
4205
  declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
4205
4206
  declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
4206
4207
 
4207
- declare function loadEnv(mode: string, envDir: string, prefixes?: string | string[]): Record<string, string>;
4208
+ declare function loadEnv(mode: string, envDir: string | false, prefixes?: string | string[]): Record<string, string>;
4208
4209
  declare function resolveEnvPrefix({ envPrefix, }: UserConfig): string[];
4209
4210
 
4210
4211
  type Manifest = Record<string, ManifestChunk>;
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { a as arraify, i as isInNodeModules, D as DevEnvironment } from './chunks/dep-Bt1yO2CH.js';
3
- export { B as BuildEnvironment, 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-Bt1yO2CH.js';
2
+ import { a as arraify, i as isInNodeModules, D as DevEnvironment } from './chunks/dep-CY3sqczG.js';
3
+ export { B as BuildEnvironment, 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-CY3sqczG.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';
@@ -466,7 +466,7 @@ class HMRClient {
466
466
  });
467
467
  }
468
468
  warnFailedUpdate(err, path) {
469
- err.message.includes("fetch") || this.logger.error(err), this.logger.error(
469
+ (!(err instanceof Error) || !err.message.includes("fetch")) && this.logger.error(err), this.logger.error(
470
470
  `Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`
471
471
  );
472
472
  }