vite 6.0.0-beta.5 → 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-BW_D9zgJ.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-BW_D9zgJ.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-BW_D9zgJ.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-BW_D9zgJ.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-BW_D9zgJ.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';
@@ -26,7 +26,9 @@ export { CustomEventMap, InferCustomEventPayload, InvalidatePayload } from '../.
26
26
  import { SecureContextOptions } from 'node:tls';
27
27
  import { ZlibOptions } from 'node:zlib';
28
28
  import * as PostCSS from 'postcss';
29
- import { SassLegacyPreprocessBaseOptions, SassModernPreprocessBaseOptions, LessPreprocessorBaseOptions, StylusPreprocessorBaseOptions } from '../../types/cssPreprocessorOptions.js';
29
+ import { LightningCSSOptions } from '../../types/internal/lightningcssOptions.js';
30
+ export { LightningCSSOptions } from '../../types/internal/lightningcssOptions.js';
31
+ import { SassLegacyPreprocessBaseOptions, SassModernPreprocessBaseOptions, LessPreprocessorBaseOptions, StylusPreprocessorBaseOptions } from '../../types/internal/cssPreprocessorOptions.js';
30
32
  export { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap } from '../../types/importGlob.js';
31
33
  export { ChunkMetadata } from '../../types/metadata.js';
32
34
 
@@ -61,211 +63,107 @@ interface ResolverObject {
61
63
  */
62
64
  type AliasOptions = readonly Alias[] | { [find: string]: string }
63
65
 
64
- type AnymatchFn = (testString: string) => boolean
65
- type AnymatchPattern = string | RegExp | AnymatchFn
66
- type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]
67
-
68
- // Inlined to avoid extra dependency (chokidar is bundled in the published build)
69
-
70
- declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
71
- options: WatchOptions
72
-
73
- /**
74
- * Constructs a new FSWatcher instance with optional WatchOptions parameter.
75
- */
76
- constructor(options?: WatchOptions)
77
-
78
- /**
79
- * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
80
- * Calling watcher.ref() multiple times will have no effect.
81
- */
82
- ref(): this
83
-
84
- /**
85
- * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
86
- * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
87
- * Calling watcher.unref() multiple times will have no effect.
88
- */
89
- unref(): this
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
90
71
 
91
- /**
92
- * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
93
- * string.
94
- */
95
- add(paths: string | ReadonlyArray<string>): this
96
-
97
- /**
98
- * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
99
- * string.
100
- */
101
- unwatch(paths: string | ReadonlyArray<string>): this
102
-
103
- /**
104
- * Returns an object representing all the paths on the file system being watched by this
105
- * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
106
- * the `cwd` option was used), and the values are arrays of the names of the items contained in
107
- * each directory.
108
- */
109
- getWatched(): {
110
- [directory: string]: string[]
111
- }
112
-
113
- /**
114
- * Removes all listeners from watched files.
115
- */
116
- close(): Promise<void>
117
-
118
- on(
119
- event: 'add' | 'addDir' | 'change',
120
- listener: (path: string, stats?: fs.Stats) => void,
121
- ): this
122
-
123
- on(
124
- event: 'all',
125
- listener: (
126
- eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir',
127
- path: string,
128
- stats?: fs.Stats,
129
- ) => void,
130
- ): this
72
+ // #region handler.d.ts
131
73
 
132
- /**
133
- * Error occurred
134
- */
135
- on(event: 'error', listener: (error: Error) => void): this
136
-
137
- /**
138
- * Exposes the native Node `fs.FSWatcher events`
139
- */
140
- on(
141
- event: 'raw',
142
- listener: (eventName: string, path: string, details: any) => void,
143
- ): this
144
-
145
- /**
146
- * Fires when the initial scan is complete
147
- */
148
- on(event: 'ready', listener: () => void): this
149
-
150
- on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this
151
-
152
- 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'
153
84
  }
85
+ type EventName = (typeof EVENTS)[keyof typeof EVENTS]
154
86
 
155
- interface WatchOptions {
156
- /**
157
- * Indicates whether the process should continue to run as long as files are being watched. If
158
- * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
159
- * even if the process continues to run.
160
- */
161
- persistent?: boolean
162
-
163
- /**
164
- * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
165
- * be ignored. The whole relative or absolute path is tested, not just filename. If a function
166
- * with two arguments is provided, it gets called twice per path - once with a single argument
167
- * (the path), second time with two arguments (the path and the
168
- * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
169
- */
170
- ignored?: AnymatchMatcher
87
+ type Path = string
171
88
 
172
- /**
173
- * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
174
- * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
175
- */
176
- ignoreInitial?: boolean
89
+ // #endregion
177
90
 
178
- /**
179
- * When `false`, only the symlinks themselves will be watched for changes instead of following
180
- * the link references and bubbling events through the link's path.
181
- */
182
- followSymlinks?: boolean
91
+ // #region index.d.ts
183
92
 
184
- /**
185
- * The base directory from which watch `paths` are to be derived. Paths emitted with events will
186
- * be relative to this.
187
- */
93
+ type AWF = {
94
+ stabilityThreshold: number
95
+ pollInterval: number
96
+ }
97
+ type BasicOpts = {
98
+ persistent: boolean
99
+ ignoreInitial: boolean
100
+ followSymlinks: boolean
188
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
+ }
189
110
 
190
- /**
191
- * If set to true then the strings passed to .watch() and .add() are treated as literal path
192
- * names, even if they look like globs.
193
- *
194
- * @default false
195
- */
196
- disableGlobbing?: boolean
111
+ type WatchOptions = Partial<
112
+ BasicOpts & {
113
+ ignored: Matcher | Matcher[]
114
+ awaitWriteFinish: boolean | Partial<AWF>
115
+ }
116
+ >
197
117
 
198
- /**
199
- * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
200
- * utilization, consider setting this to `false`. It is typically necessary to **set this to
201
- * `true` to successfully watch files over a network**, and it may be necessary to successfully
202
- * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
203
- * the `useFsEvents` default.
204
- */
205
- usePolling?: boolean
118
+ type FSWInstanceOptions = BasicOpts & {
119
+ ignored: Matcher[]
120
+ awaitWriteFinish: false | AWF
121
+ }
206
122
 
207
- /**
208
- * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
209
- * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
210
- * OS X, `usePolling: true` becomes the default.
211
- */
212
- useFsEvents?: boolean
123
+ type EmitArgs = [EventName, Path | Error, any?, any?, any?]
213
124
 
214
- /**
215
- * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
216
- * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
217
- * provided even in cases where it wasn't already available from the underlying watch events.
218
- */
219
- alwaysStat?: boolean
125
+ type MatchFunction = (val: string, stats?: Stats) => boolean
220
126
 
221
- /**
222
- * If set, limits how many levels of subdirectories will be traversed.
223
- */
224
- depth?: number
127
+ interface MatcherObject {
128
+ path: string
129
+ recursive?: boolean
130
+ }
225
131
 
226
- /**
227
- * Interval of file system polling.
228
- */
229
- interval?: number
132
+ type Matcher = string | RegExp | MatchFunction | MatcherObject
230
133
 
231
- /**
232
- * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
233
- * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
234
- */
235
- 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
236
145
 
237
- /**
238
- * Indicates whether to watch files that don't have read permissions if possible. If watching
239
- * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
240
- * silently.
241
- */
242
- ignorePermissionErrors?: boolean
146
+ constructor(_opts?: WatchOptions)
243
147
 
244
148
  /**
245
- * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
246
- * that occur when using editors that use "atomic writes" instead of writing directly to the
247
- * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
248
- * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
249
- * 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
250
151
  */
251
- atomic?: boolean | number
252
-
152
+ add(paths_: Path | Path[], _origAdd?: string, _internal?: boolean): FSWatcher
253
153
  /**
254
- * can be set to an object in order to adjust timing params:
154
+ * Close watchers or start ignoring events from specified paths.
255
155
  */
256
- awaitWriteFinish?: AwaitWriteFinishOptions | boolean
257
- }
258
-
259
- interface AwaitWriteFinishOptions {
156
+ unwatch(paths_: Path | Path[]): FSWatcher
260
157
  /**
261
- * 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.
262
159
  */
263
- stabilityThreshold?: number
264
-
160
+ close(): Promise<void>
265
161
  /**
266
- * File size polling interval.
162
+ * Expose list of watched paths
163
+ * @returns for chaining
267
164
  */
268
- pollInterval?: number
165
+ getWatched(): Record<string, string[]>
166
+ emitWithAll(event: EventName, args: EmitArgs): void
269
167
  }
270
168
 
271
169
  // Inlined to avoid extra dependency
@@ -618,7 +516,9 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
618
516
  /**
619
517
  * webpack-dev-server style bypass function
620
518
  */
621
- 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;
622
522
  /**
623
523
  * rewrite the Origin header of a WebSocket request to match the target
624
524
  *
@@ -650,6 +550,7 @@ interface LoggerOptions {
650
550
  prefix?: string;
651
551
  allowClearScreen?: boolean;
652
552
  customLogger?: Logger;
553
+ console?: Console;
653
554
  }
654
555
  declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
655
556
 
@@ -1129,6 +1030,7 @@ declare class ModuleGraph {
1129
1030
  idToModuleMap: Map<string, ModuleNode>;
1130
1031
  etagToModuleMap: Map<string, ModuleNode>;
1131
1032
  fileToModulesMap: Map<string, Set<ModuleNode>>;
1033
+ private moduleNodeCache;
1132
1034
  constructor(moduleGraphs: {
1133
1035
  client: () => EnvironmentModuleGraph;
1134
1036
  ssr: () => EnvironmentModuleGraph;
@@ -1810,11 +1712,16 @@ interface EnvironmentResolveOptions {
1810
1712
  extensions?: string[];
1811
1713
  dedupe?: string[];
1812
1714
  /**
1813
- * external/noExternal logic, this only works for certain environments
1814
- * Previously this was ssr.external/ssr.noExternal
1815
- * 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
1816
1718
  */
1817
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
+ */
1818
1725
  external?: string[] | true;
1819
1726
  }
1820
1727
  interface ResolveOptions extends EnvironmentResolveOptions {
@@ -2089,6 +1996,12 @@ interface LibraryOptions {
2089
1996
  * format as an argument.
2090
1997
  */
2091
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;
2092
2005
  }
2093
2006
  type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife' | 'system';
2094
2007
  interface ModulePreloadOptions {
@@ -2146,7 +2059,19 @@ interface ViteBuilder {
2146
2059
  build(environment: BuildEnvironment): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
2147
2060
  }
2148
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
+ */
2149
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
+ */
2150
2075
  sharedPlugins?: boolean;
2151
2076
  buildApp?: (builder: ViteBuilder) => Promise<void>;
2152
2077
  }
@@ -2836,7 +2761,7 @@ interface ServerOptions extends CommonServerOptions {
2836
2761
  };
2837
2762
  /**
2838
2763
  * chokidar watch options or null to disable FS watching
2839
- * https://github.com/paulmillr/chokidar#api
2764
+ * https://github.com/paulmillr/chokidar#getting-started
2840
2765
  */
2841
2766
  watch?: WatchOptions | null;
2842
2767
  /**
@@ -2881,7 +2806,7 @@ interface ServerOptions extends CommonServerOptions {
2881
2806
  * @default false
2882
2807
  * @experimental
2883
2808
  */
2884
- perEnvironmentBuildStartEnd?: boolean;
2809
+ perEnvironmentStartEndDuringDev?: boolean;
2885
2810
  /**
2886
2811
  * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2887
2812
  * @experimental
@@ -2915,7 +2840,7 @@ interface FileSystemServeOptions {
2915
2840
  * This will have higher priority than `allow`.
2916
2841
  * picomatch patterns are supported.
2917
2842
  *
2918
- * @default ['.env', '.env.*', '*.crt', '*.pem']
2843
+ * @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
2919
2844
  */
2920
2845
  deny?: string[];
2921
2846
  /**
@@ -2948,8 +2873,9 @@ interface ViteDevServer {
2948
2873
  */
2949
2874
  httpServer: HttpServer | null;
2950
2875
  /**
2951
- * chokidar watcher instance
2952
- * 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
2953
2879
  */
2954
2880
  watcher: FSWatcher;
2955
2881
  /**
@@ -3061,6 +2987,10 @@ interface ResolvedServerUrls {
3061
2987
  }
3062
2988
  declare function createServer(inlineConfig?: InlineConfig): Promise<ViteDevServer>;
3063
2989
 
2990
+ type AnymatchFn = (testString: string) => boolean
2991
+ type AnymatchPattern = string | RegExp | AnymatchFn
2992
+ type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]
2993
+
3064
2994
  interface ESBuildOptions extends esbuild_TransformOptions {
3065
2995
  include?: string | RegExp | string[] | RegExp[];
3066
2996
  exclude?: string | RegExp | string[] | RegExp[];
@@ -3073,70 +3003,7 @@ interface ESBuildOptions extends esbuild_TransformOptions {
3073
3003
  type ESBuildTransformResult = Omit<esbuild_TransformResult, 'map'> & {
3074
3004
  map: SourceMap;
3075
3005
  };
3076
- declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object): Promise<ESBuildTransformResult>;
3077
-
3078
- // This file is autogenerated by build-prefixes.js. DO NOT EDIT!
3079
-
3080
- interface Targets {
3081
- android?: number,
3082
- chrome?: number,
3083
- edge?: number,
3084
- firefox?: number,
3085
- ie?: number,
3086
- ios_saf?: number,
3087
- opera?: number,
3088
- safari?: number,
3089
- samsung?: number
3090
- }
3091
-
3092
- interface Drafts {
3093
- /** Whether to enable @custom-media rules. */
3094
- customMedia?: boolean
3095
- }
3096
-
3097
- interface NonStandard {
3098
- /** Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue. */
3099
- deepSelectorCombinator?: boolean
3100
- }
3101
-
3102
- interface PseudoClasses {
3103
- hover?: string,
3104
- active?: string,
3105
- focus?: string,
3106
- focusVisible?: string,
3107
- focusWithin?: string
3108
- }
3109
-
3110
- interface CSSModulesConfig {
3111
- /** The pattern to use when renaming class names and other identifiers. Default is `[hash]_[local]`. */
3112
- pattern?: string,
3113
- /** Whether to rename dashed identifiers, e.g. custom properties. */
3114
- dashedIdents?: boolean,
3115
- /** Whether to enable hashing for `@keyframes`. */
3116
- animation?: boolean,
3117
- /** Whether to enable hashing for CSS grid identifiers. */
3118
- grid?: boolean,
3119
- /** Whether to enable hashing for custom identifiers. */
3120
- customIdents?: boolean,
3121
- /** Whether to require at least one class or id selector in each rule. */
3122
- pure?: boolean
3123
- }
3124
-
3125
- /**
3126
- * Options are spread, so you can also use options that are not typed here like
3127
- * visitor (not exposed because it would impact too much the bundle size)
3128
- */
3129
- type LightningCSSOptions = {
3130
- targets?: Targets
3131
- include?: number
3132
- exclude?: number
3133
- drafts?: Drafts
3134
- nonStandard?: NonStandard
3135
- pseudoClasses?: PseudoClasses
3136
- unusedSymbols?: string[]
3137
- cssModules?: CSSModulesConfig
3138
- errorRecovery?: boolean
3139
- }
3006
+ declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<ESBuildTransformResult>;
3140
3007
 
3141
3008
  interface CSSOptions {
3142
3009
  /**
@@ -3200,9 +3067,7 @@ interface CSSModulesOptions {
3200
3067
  localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
3201
3068
  }
3202
3069
  type ResolvedCSSOptions = Omit<CSSOptions, 'lightningcss'> & {
3203
- lightningcss?: LightningCSSOptions & {
3204
- targets: LightningCSSOptions['targets'];
3205
- };
3070
+ lightningcss?: LightningCSSOptions;
3206
3071
  };
3207
3072
  interface PreprocessCSSResult {
3208
3073
  code: string;
@@ -3223,9 +3088,9 @@ type PreprocessorAdditionalData = string | ((source: string, filename: string) =
3223
3088
  type SassPreprocessorOptions = {
3224
3089
  additionalData?: PreprocessorAdditionalData;
3225
3090
  } & (({
3226
- api?: 'legacy';
3091
+ api: 'legacy';
3227
3092
  } & SassLegacyPreprocessBaseOptions) | ({
3228
- api: 'modern' | 'modern-compiler';
3093
+ api?: 'modern' | 'modern-compiler';
3229
3094
  } & SassModernPreprocessBaseOptions));
3230
3095
  type LessPreprocessorOptions = {
3231
3096
  additionalData?: PreprocessorAdditionalData;
@@ -3615,10 +3480,6 @@ interface DevEnvironmentOptions {
3615
3480
  * sourcemap path and returns whether to ignore the source path.
3616
3481
  */
3617
3482
  sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
3618
- /**
3619
- * Optimize deps config
3620
- */
3621
- optimizeDeps?: DepOptimizationOptions;
3622
3483
  /**
3623
3484
  * create the Dev Environment instance
3624
3485
  */
@@ -3661,6 +3522,10 @@ interface SharedEnvironmentOptions {
3661
3522
  * Temporal options, we should remove these in favor of fine-grained control
3662
3523
  */
3663
3524
  webCompatible?: boolean;
3525
+ /**
3526
+ * Optimize deps config
3527
+ */
3528
+ optimizeDeps?: DepOptimizationOptions;
3664
3529
  }
3665
3530
  interface EnvironmentOptions extends SharedEnvironmentOptions {
3666
3531
  /**
@@ -3678,6 +3543,7 @@ type ResolvedEnvironmentOptions = {
3678
3543
  resolve: ResolvedResolveOptions;
3679
3544
  consumer: 'client' | 'server';
3680
3545
  webCompatible: boolean;
3546
+ optimizeDeps: DepOptimizationOptions;
3681
3547
  dev: ResolvedDevEnvironmentOptions;
3682
3548
  build: ResolvedBuildEnvironmentOptions;
3683
3549
  };
@@ -4122,4 +3988,4 @@ interface ManifestChunk {
4122
3988
  dynamicImports?: string[];
4123
3989
  }
4124
3990
 
4125
- 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 LibraryFormats, type LibraryOptions, type LightningCSSOptions, 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 SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationConfig, 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 };