vite 6.0.0-beta.6 → 6.0.0-beta.7

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/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 { K as colors, E as createLogger, r as resolveConfig } from './chunks/dep-D4jOq5eU.js';
5
+ import { K as colors, E as createLogger, r as resolveConfig } from './chunks/dep-Vd7gFLqj.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -19,6 +19,7 @@ import 'util';
19
19
  import 'net';
20
20
  import 'url';
21
21
  import 'http';
22
+ import 'fs/promises';
22
23
  import 'stream';
23
24
  import 'os';
24
25
  import 'child_process';
@@ -27,15 +28,15 @@ import 'node:crypto';
27
28
  import 'node:dns';
28
29
  import 'vite/module-runner';
29
30
  import 'rollup/parseAst';
31
+ import 'module';
30
32
  import 'node:readline';
31
33
  import 'node:process';
32
34
  import 'node:buffer';
33
- import 'node:events';
34
35
  import 'crypto';
35
- import 'module';
36
36
  import 'node:assert';
37
37
  import 'node:v8';
38
38
  import 'node:worker_threads';
39
+ import 'node:events';
39
40
  import 'zlib';
40
41
  import 'buffer';
41
42
  import 'https';
@@ -740,7 +741,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
740
741
  `[boolean] force the optimizer to ignore the cache and re-bundle`
741
742
  ).action(async (root, options) => {
742
743
  filterDuplicateOptions(options);
743
- const { createServer } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.O; });
744
+ const { createServer } = await import('./chunks/dep-Vd7gFLqj.js').then(function (n) { return n.O; });
744
745
  try {
745
746
  const server = await createServer({
746
747
  root,
@@ -833,7 +834,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
833
834
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
834
835
  async (root, options) => {
835
836
  filterDuplicateOptions(options);
836
- const { createBuilder } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.P; });
837
+ const { createBuilder } = await import('./chunks/dep-Vd7gFLqj.js').then(function (n) { return n.P; });
837
838
  const buildOptions = cleanGlobalCLIOptions(
838
839
  cleanBuilderCLIOptions(options)
839
840
  );
@@ -868,7 +869,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
868
869
  ).action(
869
870
  async (root, options) => {
870
871
  filterDuplicateOptions(options);
871
- const { optimizeDeps } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.N; });
872
+ const { optimizeDeps } = await import('./chunks/dep-Vd7gFLqj.js').then(function (n) { return n.N; });
872
873
  try {
873
874
  const config = await resolveConfig(
874
875
  {
@@ -894,7 +895,7 @@ ${e.stack}`),
894
895
  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
896
  async (root, options) => {
896
897
  filterDuplicateOptions(options);
897
- const { preview } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.Q; });
898
+ const { preview } = await import('./chunks/dep-Vd7gFLqj.js').then(function (n) { return n.Q; });
898
899
  try {
899
900
  const server = await preview({
900
901
  root,
@@ -6,7 +6,7 @@ export { parseAst, parseAstAsync } from 'rollup/parseAst';
6
6
  import * as http from 'node:http';
7
7
  import { OutgoingHttpHeaders, ClientRequestArgs, IncomingMessage, ClientRequest, Agent, Server, ServerResponse } from 'node:http';
8
8
  import { Http2SecureServer } from 'node:http2';
9
- import * as fs from 'node:fs';
9
+ import { Stats } from 'node:fs';
10
10
  import * as events from 'node:events';
11
11
  import { EventEmitter } from 'node:events';
12
12
  import { ServerOptions as HttpsServerOptions, Server as HttpsServer } from 'node:https';
@@ -63,211 +63,107 @@ interface ResolverObject {
63
63
  */
64
64
  type AliasOptions = readonly Alias[] | { [find: string]: string }
65
65
 
66
- type AnymatchFn = (testString: string) => boolean
67
- type AnymatchPattern = string | RegExp | AnymatchFn
68
- type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]
69
-
70
- // Inlined to avoid extra dependency (chokidar is bundled in the published build)
66
+ // Inlined with the following changes:
67
+ // 1. Rename `ChokidarOptions` to `WatchOptions` (compat with chokidar v3)
68
+ // 2. Remove internal properties exposed from `FSWatcher`
69
+ // 3. Remove unneeded types from the tweaks above
70
+ // 4. Add spacing and formatted for readability
71
71
 
72
- declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
73
- options: WatchOptions
72
+ // #region handler.d.ts
74
73
 
75
- /**
76
- * Constructs a new FSWatcher instance with optional WatchOptions parameter.
77
- */
78
- constructor(options?: WatchOptions)
79
-
80
- /**
81
- * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
82
- * Calling watcher.ref() multiple times will have no effect.
83
- */
84
- ref(): this
85
-
86
- /**
87
- * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
88
- * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
89
- * Calling watcher.unref() multiple times will have no effect.
90
- */
91
- unref(): this
92
-
93
- /**
94
- * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
95
- * string.
96
- */
97
- add(paths: string | ReadonlyArray<string>): this
98
-
99
- /**
100
- * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
101
- * string.
102
- */
103
- unwatch(paths: string | ReadonlyArray<string>): this
104
-
105
- /**
106
- * Returns an object representing all the paths on the file system being watched by this
107
- * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
108
- * the `cwd` option was used), and the values are arrays of the names of the items contained in
109
- * each directory.
110
- */
111
- getWatched(): {
112
- [directory: string]: string[]
113
- }
114
-
115
- /**
116
- * Removes all listeners from watched files.
117
- */
118
- close(): Promise<void>
119
-
120
- on(
121
- event: 'add' | 'addDir' | 'change',
122
- listener: (path: string, stats?: fs.Stats) => void,
123
- ): this
124
-
125
- on(
126
- event: 'all',
127
- listener: (
128
- eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir',
129
- path: string,
130
- stats?: fs.Stats,
131
- ) => void,
132
- ): this
133
-
134
- /**
135
- * Error occurred
136
- */
137
- on(event: 'error', listener: (error: Error) => void): this
138
-
139
- /**
140
- * Exposes the native Node `fs.FSWatcher events`
141
- */
142
- on(
143
- event: 'raw',
144
- listener: (eventName: string, path: string, details: any) => void,
145
- ): this
146
-
147
- /**
148
- * Fires when the initial scan is complete
149
- */
150
- on(event: 'ready', listener: () => void): this
151
-
152
- on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this
153
-
154
- on(event: string, listener: (...args: any[]) => void): this
74
+ declare const EVENTS: {
75
+ readonly ALL: 'all'
76
+ readonly READY: 'ready'
77
+ readonly ADD: 'add'
78
+ readonly CHANGE: 'change'
79
+ readonly ADD_DIR: 'addDir'
80
+ readonly UNLINK: 'unlink'
81
+ readonly UNLINK_DIR: 'unlinkDir'
82
+ readonly RAW: 'raw'
83
+ readonly ERROR: 'error'
155
84
  }
85
+ type EventName = (typeof EVENTS)[keyof typeof EVENTS]
156
86
 
157
- interface WatchOptions {
158
- /**
159
- * Indicates whether the process should continue to run as long as files are being watched. If
160
- * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
161
- * even if the process continues to run.
162
- */
163
- persistent?: boolean
164
-
165
- /**
166
- * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
167
- * be ignored. The whole relative or absolute path is tested, not just filename. If a function
168
- * with two arguments is provided, it gets called twice per path - once with a single argument
169
- * (the path), second time with two arguments (the path and the
170
- * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
171
- */
172
- ignored?: AnymatchMatcher
87
+ type Path = string
173
88
 
174
- /**
175
- * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
176
- * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
177
- */
178
- ignoreInitial?: boolean
89
+ // #endregion
179
90
 
180
- /**
181
- * When `false`, only the symlinks themselves will be watched for changes instead of following
182
- * the link references and bubbling events through the link's path.
183
- */
184
- followSymlinks?: boolean
91
+ // #region index.d.ts
185
92
 
186
- /**
187
- * The base directory from which watch `paths` are to be derived. Paths emitted with events will
188
- * be relative to this.
189
- */
93
+ type AWF = {
94
+ stabilityThreshold: number
95
+ pollInterval: number
96
+ }
97
+ type BasicOpts = {
98
+ persistent: boolean
99
+ ignoreInitial: boolean
100
+ followSymlinks: boolean
190
101
  cwd?: string
102
+ usePolling: boolean
103
+ interval: number
104
+ binaryInterval: number
105
+ alwaysStat?: boolean
106
+ depth?: number
107
+ ignorePermissionErrors: boolean
108
+ atomic: boolean | number
109
+ }
191
110
 
192
- /**
193
- * If set to true then the strings passed to .watch() and .add() are treated as literal path
194
- * names, even if they look like globs.
195
- *
196
- * @default false
197
- */
198
- disableGlobbing?: boolean
111
+ type WatchOptions = Partial<
112
+ BasicOpts & {
113
+ ignored: Matcher | Matcher[]
114
+ awaitWriteFinish: boolean | Partial<AWF>
115
+ }
116
+ >
199
117
 
200
- /**
201
- * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
202
- * utilization, consider setting this to `false`. It is typically necessary to **set this to
203
- * `true` to successfully watch files over a network**, and it may be necessary to successfully
204
- * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
205
- * the `useFsEvents` default.
206
- */
207
- usePolling?: boolean
118
+ type FSWInstanceOptions = BasicOpts & {
119
+ ignored: Matcher[]
120
+ awaitWriteFinish: false | AWF
121
+ }
208
122
 
209
- /**
210
- * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
211
- * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
212
- * OS X, `usePolling: true` becomes the default.
213
- */
214
- useFsEvents?: boolean
123
+ type EmitArgs = [EventName, Path | Error, any?, any?, any?]
215
124
 
216
- /**
217
- * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
218
- * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
219
- * provided even in cases where it wasn't already available from the underlying watch events.
220
- */
221
- alwaysStat?: boolean
125
+ type MatchFunction = (val: string, stats?: Stats) => boolean
222
126
 
223
- /**
224
- * If set, limits how many levels of subdirectories will be traversed.
225
- */
226
- depth?: number
127
+ interface MatcherObject {
128
+ path: string
129
+ recursive?: boolean
130
+ }
227
131
 
228
- /**
229
- * Interval of file system polling.
230
- */
231
- interval?: number
132
+ type Matcher = string | RegExp | MatchFunction | MatcherObject
232
133
 
233
- /**
234
- * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
235
- * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
236
- */
237
- binaryInterval?: number
134
+ /**
135
+ * Watches files & directories for changes. Emitted events:
136
+ * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
137
+ *
138
+ * new FSWatcher()
139
+ * .add(directories)
140
+ * .on('add', path => log('File', path, 'was added'))
141
+ */
142
+ declare class FSWatcher extends EventEmitter {
143
+ closed: boolean
144
+ options: FSWInstanceOptions
238
145
 
239
- /**
240
- * Indicates whether to watch files that don't have read permissions if possible. If watching
241
- * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
242
- * silently.
243
- */
244
- ignorePermissionErrors?: boolean
146
+ constructor(_opts?: WatchOptions)
245
147
 
246
148
  /**
247
- * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
248
- * that occur when using editors that use "atomic writes" instead of writing directly to the
249
- * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
250
- * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
251
- * you can override it by setting `atomic` to a custom value, in milliseconds.
149
+ * Adds paths to be watched on an existing FSWatcher instance.
150
+ * @param paths_ file or file list. Other arguments are unused
252
151
  */
253
- atomic?: boolean | number
254
-
152
+ add(paths_: Path | Path[], _origAdd?: string, _internal?: boolean): FSWatcher
255
153
  /**
256
- * can be set to an object in order to adjust timing params:
154
+ * Close watchers or start ignoring events from specified paths.
257
155
  */
258
- awaitWriteFinish?: AwaitWriteFinishOptions | boolean
259
- }
260
-
261
- interface AwaitWriteFinishOptions {
156
+ unwatch(paths_: Path | Path[]): FSWatcher
262
157
  /**
263
- * Amount of time in milliseconds for a file size to remain constant before emitting its event.
158
+ * Close watchers and remove all listeners from watched paths.
264
159
  */
265
- stabilityThreshold?: number
266
-
160
+ close(): Promise<void>
267
161
  /**
268
- * File size polling interval.
162
+ * Expose list of watched paths
163
+ * @returns for chaining
269
164
  */
270
- pollInterval?: number
165
+ getWatched(): Record<string, string[]>
166
+ emitWithAll(event: EventName, args: EmitArgs): void
271
167
  }
272
168
 
273
169
  // Inlined to avoid extra dependency
@@ -620,7 +516,9 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
620
516
  /**
621
517
  * webpack-dev-server style bypass function
622
518
  */
623
- bypass?: (req: http.IncomingMessage, res: http.ServerResponse, options: ProxyOptions) => void | null | undefined | false | string;
519
+ bypass?: (req: http.IncomingMessage,
520
+ /** undefined for WebSocket upgrade requests */
521
+ res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string;
624
522
  /**
625
523
  * rewrite the Origin header of a WebSocket request to match the target
626
524
  *
@@ -1814,11 +1712,16 @@ interface EnvironmentResolveOptions {
1814
1712
  extensions?: string[];
1815
1713
  dedupe?: string[];
1816
1714
  /**
1817
- * external/noExternal logic, this only works for certain environments
1818
- * Previously this was ssr.external/ssr.noExternal
1819
- * TODO: better abstraction that works for the client environment too?
1715
+ * Prevent listed dependencies from being externalized and will get bundled in build.
1716
+ * Only works in server environments for now. Previously this was `ssr.noExternal`.
1717
+ * @experimental
1820
1718
  */
1821
1719
  noExternal?: string | RegExp | (string | RegExp)[] | true;
1720
+ /**
1721
+ * Externalize the given dependencies and their transitive dependencies.
1722
+ * Only works in server environments for now. Previously this was `ssr.external`.
1723
+ * @experimental
1724
+ */
1822
1725
  external?: string[] | true;
1823
1726
  }
1824
1727
  interface ResolveOptions extends EnvironmentResolveOptions {
@@ -2093,6 +1996,12 @@ interface LibraryOptions {
2093
1996
  * format as an argument.
2094
1997
  */
2095
1998
  fileName?: string | ((format: ModuleFormat, entryName: string) => string);
1999
+ /**
2000
+ * The name of the CSS file output if the library imports CSS. Defaults to the
2001
+ * same value as `build.lib.fileName` if it's set a string, otherwise it falls
2002
+ * back to the name option of the project package.json.
2003
+ */
2004
+ cssFileName?: string;
2096
2005
  }
2097
2006
  type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife' | 'system';
2098
2007
  interface ModulePreloadOptions {
@@ -2150,7 +2059,19 @@ interface ViteBuilder {
2150
2059
  build(environment: BuildEnvironment): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
2151
2060
  }
2152
2061
  interface BuilderOptions {
2062
+ /**
2063
+ * Whether to share the config instance among environments to align with the behavior of dev server.
2064
+ *
2065
+ * @default false
2066
+ * @experimental
2067
+ */
2153
2068
  sharedConfigBuild?: boolean;
2069
+ /**
2070
+ * Whether to share the plugin instances among environments to align with the behavior of dev server.
2071
+ *
2072
+ * @default false
2073
+ * @experimental
2074
+ */
2154
2075
  sharedPlugins?: boolean;
2155
2076
  buildApp?: (builder: ViteBuilder) => Promise<void>;
2156
2077
  }
@@ -2840,7 +2761,7 @@ interface ServerOptions extends CommonServerOptions {
2840
2761
  };
2841
2762
  /**
2842
2763
  * chokidar watch options or null to disable FS watching
2843
- * https://github.com/paulmillr/chokidar#api
2764
+ * https://github.com/paulmillr/chokidar#getting-started
2844
2765
  */
2845
2766
  watch?: WatchOptions | null;
2846
2767
  /**
@@ -2885,7 +2806,7 @@ interface ServerOptions extends CommonServerOptions {
2885
2806
  * @default false
2886
2807
  * @experimental
2887
2808
  */
2888
- perEnvironmentBuildStartEnd?: boolean;
2809
+ perEnvironmentStartEndDuringDev?: boolean;
2889
2810
  /**
2890
2811
  * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2891
2812
  * @experimental
@@ -2919,7 +2840,7 @@ interface FileSystemServeOptions {
2919
2840
  * This will have higher priority than `allow`.
2920
2841
  * picomatch patterns are supported.
2921
2842
  *
2922
- * @default ['.env', '.env.*', '*.crt', '*.pem']
2843
+ * @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
2923
2844
  */
2924
2845
  deny?: string[];
2925
2846
  /**
@@ -2952,8 +2873,9 @@ interface ViteDevServer {
2952
2873
  */
2953
2874
  httpServer: HttpServer | null;
2954
2875
  /**
2955
- * chokidar watcher instance
2956
- * https://github.com/paulmillr/chokidar#api
2876
+ * Chokidar watcher instance. If `config.server.watch` is set to `null`,
2877
+ * it will not watch any files and calling `add` will have no effect.
2878
+ * https://github.com/paulmillr/chokidar#getting-started
2957
2879
  */
2958
2880
  watcher: FSWatcher;
2959
2881
  /**
@@ -3065,6 +2987,10 @@ interface ResolvedServerUrls {
3065
2987
  }
3066
2988
  declare function createServer(inlineConfig?: InlineConfig): Promise<ViteDevServer>;
3067
2989
 
2990
+ type AnymatchFn = (testString: string) => boolean
2991
+ type AnymatchPattern = string | RegExp | AnymatchFn
2992
+ type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]
2993
+
3068
2994
  interface ESBuildOptions extends esbuild_TransformOptions {
3069
2995
  include?: string | RegExp | string[] | RegExp[];
3070
2996
  exclude?: string | RegExp | string[] | RegExp[];
@@ -3077,7 +3003,7 @@ interface ESBuildOptions extends esbuild_TransformOptions {
3077
3003
  type ESBuildTransformResult = Omit<esbuild_TransformResult, 'map'> & {
3078
3004
  map: SourceMap;
3079
3005
  };
3080
- declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object): Promise<ESBuildTransformResult>;
3006
+ declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<ESBuildTransformResult>;
3081
3007
 
3082
3008
  interface CSSOptions {
3083
3009
  /**
@@ -4062,4 +3988,4 @@ interface ManifestChunk {
4062
3988
  dynamicImports?: string[];
4063
3989
  }
4064
3990
 
4065
- export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, 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 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, RemoteEnvironmentTransport, 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, ServerHMRConnector, 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, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
3991
+ 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 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, RemoteEnvironmentTransport, 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, ServerHMRConnector, 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, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, 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-D4jOq5eU.js';
3
- export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, z as createFilter, f as createIdResolver, E as createLogger, k as createRunnableDevEnvironment, c as createServer, u as createServerHotChannel, q as createServerModuleRunner, d as defineConfig, n as fetchModule, g as formatPostcssSourceMap, H as isFileLoadingAllowed, G as isFileServingAllowed, m as isRunnableDevEnvironment, l as loadConfigFromFile, I as loadEnv, y as mergeAlias, x as mergeConfig, v as moduleRunnerTransform, w as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, J as resolveEnvPrefix, A as rollupVersion, F as searchForWorkspaceRoot, C as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-D4jOq5eU.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-Vd7gFLqj.js';
3
+ export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, z as createFilter, f as createIdResolver, E as createLogger, k as createRunnableDevEnvironment, c as createServer, u as createServerHotChannel, q as createServerModuleRunner, d as defineConfig, n as fetchModule, g as formatPostcssSourceMap, H as isFileLoadingAllowed, G as isFileServingAllowed, m as isRunnableDevEnvironment, l as loadConfigFromFile, I as loadEnv, y as mergeAlias, x as mergeConfig, v as moduleRunnerTransform, w as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, J as resolveEnvPrefix, A as rollupVersion, F as searchForWorkspaceRoot, C as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Vd7gFLqj.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import 'node:fs';
@@ -21,6 +21,7 @@ import 'net';
21
21
  import 'events';
22
22
  import 'url';
23
23
  import 'http';
24
+ import 'fs/promises';
24
25
  import 'stream';
25
26
  import 'os';
26
27
  import 'child_process';
@@ -28,15 +29,15 @@ import 'node:os';
28
29
  import 'node:crypto';
29
30
  import 'node:dns';
30
31
  import 'vite/module-runner';
32
+ import 'module';
31
33
  import 'node:readline';
32
34
  import 'node:process';
33
35
  import 'node:buffer';
34
- import 'node:events';
35
36
  import 'crypto';
36
- import 'module';
37
37
  import 'node:assert';
38
38
  import 'node:v8';
39
39
  import 'node:worker_threads';
40
+ import 'node:events';
40
41
  import 'zlib';
41
42
  import 'buffer';
42
43
  import 'https';
@@ -3568,7 +3568,10 @@ const filter = process.env.VITE_DEBUG_FILTER;
3568
3568
  const DEBUG = process.env.DEBUG;
3569
3569
  function createDebugger(namespace, options = {}) {
3570
3570
  const log = debug$2(namespace);
3571
- const { onlyWhenFocused } = options;
3571
+ const { onlyWhenFocused, depth } = options;
3572
+ if (depth && log.inspectOpts.depth == null) {
3573
+ log.inspectOpts.depth = options.depth;
3574
+ }
3572
3575
  let enabled = log.enabled;
3573
3576
  if (enabled && onlyWhenFocused) {
3574
3577
  const ns = typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.0.0-beta.6",
3
+ "version": "6.0.0-beta.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -77,9 +77,6 @@
77
77
  "postcss": "^8.4.47",
78
78
  "rollup": "^4.23.0"
79
79
  },
80
- "optionalDependencies": {
81
- "fsevents": "~2.3.3"
82
- },
83
80
  "devDependencies": {
84
81
  "@ampproject/remapping": "^2.3.0",
85
82
  "@babel/parser": "^7.26.1",
@@ -95,7 +92,7 @@
95
92
  "@types/pnpapi": "^0.0.5",
96
93
  "artichokie": "^0.2.1",
97
94
  "cac": "^6.7.14",
98
- "chokidar": "^3.6.0",
95
+ "chokidar": "^4.0.1",
99
96
  "connect": "^3.7.0",
100
97
  "convert-source-map": "^2.0.0",
101
98
  "cors": "^2.8.5",
@@ -112,7 +109,6 @@
112
109
  "launch-editor-middleware": "^2.9.1",
113
110
  "lightningcss": "^1.27.0",
114
111
  "magic-string": "^0.30.12",
115
- "micromatch": "^4.0.8",
116
112
  "mlly": "^1.7.2",
117
113
  "mrmime": "^2.0.0",
118
114
  "nanoid": "^5.0.7",
@@ -192,11 +188,11 @@
192
188
  },
193
189
  "scripts": {
194
190
  "dev": "tsx scripts/dev.ts",
195
- "build": "rimraf dist && pnpm build-bundle && pnpm build-types",
191
+ "build": "premove dist && pnpm build-bundle && pnpm build-types",
196
192
  "build-bundle": "rollup --config rollup.config.ts --configPlugin esbuild",
197
193
  "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check",
198
194
  "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node",
199
- "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && rimraf temp",
195
+ "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && premove temp",
200
196
  "build-types-check": "tsc --project tsconfig.check.json",
201
197
  "typecheck": "tsc --noEmit && tsc --noEmit -p src/node",
202
198
  "lint": "eslint --cache --ext .ts src/**",