vite 6.0.0-beta.6 → 6.0.0-beta.8
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/LICENSE.md +4 -279
- package/dist/node/chunks/{dep-DmJnO2SA.js → dep-DUn1iy3F.js} +6 -192
- package/dist/node/chunks/{dep-D4jOq5eU.js → dep-Ddvoc4zx.js} +9704 -16431
- package/dist/node/chunks/{dep-BBdZfOY1.js → dep-qU9-vqRp.js} +13 -13
- package/dist/node/cli.js +8 -7
- package/dist/node/constants.js +9 -1
- package/dist/node/index.d.ts +126 -223
- package/dist/node/index.js +5 -4
- package/dist/node-cjs/publicUtils.cjs +4 -3
- package/package.json +4 -8
package/dist/node/index.d.ts
CHANGED
@@ -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
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
//
|
71
|
-
|
72
|
-
declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
73
|
-
options: WatchOptions
|
74
|
-
|
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
|
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
|
151
71
|
|
152
|
-
|
72
|
+
// #region handler.d.ts
|
153
73
|
|
154
|
-
|
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
|
-
|
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
|
87
|
+
type Path = string
|
164
88
|
|
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
|
89
|
+
// #endregion
|
173
90
|
|
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
|
91
|
+
// #region index.d.ts
|
179
92
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
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
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
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
|
-
|
202
|
-
|
203
|
-
|
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
|
-
|
225
|
-
|
226
|
-
|
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
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
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
|
-
*
|
248
|
-
*
|
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
|
-
|
254
|
-
|
152
|
+
add(paths_: Path | Path[], _origAdd?: string, _internal?: boolean): FSWatcher
|
255
153
|
/**
|
256
|
-
*
|
154
|
+
* Close watchers or start ignoring events from specified paths.
|
257
155
|
*/
|
258
|
-
|
259
|
-
}
|
260
|
-
|
261
|
-
interface AwaitWriteFinishOptions {
|
156
|
+
unwatch(paths_: Path | Path[]): FSWatcher
|
262
157
|
/**
|
263
|
-
*
|
158
|
+
* Close watchers and remove all listeners from watched paths.
|
264
159
|
*/
|
265
|
-
|
266
|
-
|
160
|
+
close(): Promise<void>
|
267
161
|
/**
|
268
|
-
*
|
162
|
+
* Expose list of watched paths
|
163
|
+
* @returns for chaining
|
269
164
|
*/
|
270
|
-
|
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,
|
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
|
*
|
@@ -1789,18 +1687,6 @@ interface TerserOptions extends Terser.MinifyOptions {
|
|
1789
1687
|
maxWorkers?: number;
|
1790
1688
|
}
|
1791
1689
|
|
1792
|
-
interface FsUtils {
|
1793
|
-
existsSync: (path: string) => boolean;
|
1794
|
-
isDirectory: (path: string) => boolean;
|
1795
|
-
tryResolveRealFile: (path: string, preserveSymlinks?: boolean) => string | undefined;
|
1796
|
-
tryResolveRealFileWithExtensions: (path: string, extensions: string[], preserveSymlinks?: boolean) => string | undefined;
|
1797
|
-
tryResolveRealFileOrType: (path: string, preserveSymlinks?: boolean) => {
|
1798
|
-
path?: string;
|
1799
|
-
type: 'directory' | 'file';
|
1800
|
-
} | undefined;
|
1801
|
-
initWatcher?: (watcher: FSWatcher) => void;
|
1802
|
-
}
|
1803
|
-
|
1804
1690
|
interface EnvironmentResolveOptions {
|
1805
1691
|
/**
|
1806
1692
|
* @default ['browser', 'module', 'jsnext:main', 'jsnext']
|
@@ -1814,11 +1700,16 @@ interface EnvironmentResolveOptions {
|
|
1814
1700
|
extensions?: string[];
|
1815
1701
|
dedupe?: string[];
|
1816
1702
|
/**
|
1817
|
-
*
|
1818
|
-
* Previously this was ssr.
|
1819
|
-
*
|
1703
|
+
* Prevent listed dependencies from being externalized and will get bundled in build.
|
1704
|
+
* Only works in server environments for now. Previously this was `ssr.noExternal`.
|
1705
|
+
* @experimental
|
1820
1706
|
*/
|
1821
1707
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
1708
|
+
/**
|
1709
|
+
* Externalize the given dependencies and their transitive dependencies.
|
1710
|
+
* Only works in server environments for now. Previously this was `ssr.external`.
|
1711
|
+
* @experimental
|
1712
|
+
*/
|
1822
1713
|
external?: string[] | true;
|
1823
1714
|
}
|
1824
1715
|
interface ResolveOptions extends EnvironmentResolveOptions {
|
@@ -1832,7 +1723,6 @@ interface ResolvePluginOptions {
|
|
1832
1723
|
isBuild: boolean;
|
1833
1724
|
isProduction: boolean;
|
1834
1725
|
packageCache?: PackageCache;
|
1835
|
-
fsUtils?: FsUtils;
|
1836
1726
|
/**
|
1837
1727
|
* src code mode also attempts the following:
|
1838
1728
|
* - resolving /xxx as URLs
|
@@ -1843,10 +1733,8 @@ interface ResolvePluginOptions {
|
|
1843
1733
|
tryPrefix?: string;
|
1844
1734
|
preferRelative?: boolean;
|
1845
1735
|
isRequire?: boolean;
|
1846
|
-
webCompatible?: boolean;
|
1847
1736
|
isFromTsImporter?: boolean;
|
1848
1737
|
scan?: boolean;
|
1849
|
-
ssrOptimizeCheck?: boolean;
|
1850
1738
|
/**
|
1851
1739
|
* @deprecated environment.config are used instead
|
1852
1740
|
*/
|
@@ -1854,15 +1742,14 @@ interface ResolvePluginOptions {
|
|
1854
1742
|
}
|
1855
1743
|
interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {
|
1856
1744
|
}
|
1857
|
-
type InternalResolveOptionsWithOverrideConditions = InternalResolveOptions & {};
|
1858
1745
|
|
1859
1746
|
/** Cache for package.json resolution and package.json contents */
|
1860
1747
|
type PackageCache = Map<string, PackageData>;
|
1861
1748
|
interface PackageData {
|
1862
1749
|
dir: string;
|
1863
1750
|
hasSideEffects: (id: string) => boolean | 'no-treeshake' | null;
|
1864
|
-
setResolvedCache: (key: string, entry: string, options:
|
1865
|
-
getResolvedCache: (key: string, options:
|
1751
|
+
setResolvedCache: (key: string, entry: string, options: InternalResolveOptions) => void;
|
1752
|
+
getResolvedCache: (key: string, options: InternalResolveOptions) => string | undefined;
|
1866
1753
|
data: {
|
1867
1754
|
[field: string]: any;
|
1868
1755
|
name: string;
|
@@ -2093,6 +1980,12 @@ interface LibraryOptions {
|
|
2093
1980
|
* format as an argument.
|
2094
1981
|
*/
|
2095
1982
|
fileName?: string | ((format: ModuleFormat, entryName: string) => string);
|
1983
|
+
/**
|
1984
|
+
* The name of the CSS file output if the library imports CSS. Defaults to the
|
1985
|
+
* same value as `build.lib.fileName` if it's set a string, otherwise it falls
|
1986
|
+
* back to the name option of the project package.json.
|
1987
|
+
*/
|
1988
|
+
cssFileName?: string;
|
2096
1989
|
}
|
2097
1990
|
type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife' | 'system';
|
2098
1991
|
interface ModulePreloadOptions {
|
@@ -2150,7 +2043,19 @@ interface ViteBuilder {
|
|
2150
2043
|
build(environment: BuildEnvironment): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
|
2151
2044
|
}
|
2152
2045
|
interface BuilderOptions {
|
2046
|
+
/**
|
2047
|
+
* Whether to share the config instance among environments to align with the behavior of dev server.
|
2048
|
+
*
|
2049
|
+
* @default false
|
2050
|
+
* @experimental
|
2051
|
+
*/
|
2153
2052
|
sharedConfigBuild?: boolean;
|
2053
|
+
/**
|
2054
|
+
* Whether to share the plugin instances among environments to align with the behavior of dev server.
|
2055
|
+
*
|
2056
|
+
* @default false
|
2057
|
+
* @experimental
|
2058
|
+
*/
|
2154
2059
|
sharedPlugins?: boolean;
|
2155
2060
|
buildApp?: (builder: ViteBuilder) => Promise<void>;
|
2156
2061
|
}
|
@@ -2840,7 +2745,7 @@ interface ServerOptions extends CommonServerOptions {
|
|
2840
2745
|
};
|
2841
2746
|
/**
|
2842
2747
|
* chokidar watch options or null to disable FS watching
|
2843
|
-
* https://github.com/paulmillr/chokidar#
|
2748
|
+
* https://github.com/paulmillr/chokidar#getting-started
|
2844
2749
|
*/
|
2845
2750
|
watch?: WatchOptions | null;
|
2846
2751
|
/**
|
@@ -2885,7 +2790,7 @@ interface ServerOptions extends CommonServerOptions {
|
|
2885
2790
|
* @default false
|
2886
2791
|
* @experimental
|
2887
2792
|
*/
|
2888
|
-
|
2793
|
+
perEnvironmentStartEndDuringDev?: boolean;
|
2889
2794
|
/**
|
2890
2795
|
* Run HMR tasks, by default the HMR propagation is done in parallel for all environments
|
2891
2796
|
* @experimental
|
@@ -2919,16 +2824,9 @@ interface FileSystemServeOptions {
|
|
2919
2824
|
* This will have higher priority than `allow`.
|
2920
2825
|
* picomatch patterns are supported.
|
2921
2826
|
*
|
2922
|
-
* @default ['.env', '.env.*', '*.crt', '
|
2827
|
+
* @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
|
2923
2828
|
*/
|
2924
2829
|
deny?: string[];
|
2925
|
-
/**
|
2926
|
-
* Enable caching of fs calls. It is enabled by default if no custom watch ignored patterns are provided.
|
2927
|
-
*
|
2928
|
-
* @experimental
|
2929
|
-
* @default undefined
|
2930
|
-
*/
|
2931
|
-
cachedChecks?: boolean;
|
2932
2830
|
}
|
2933
2831
|
type ServerHook = (this: void, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
|
2934
2832
|
type HttpServer = http.Server | Http2SecureServer;
|
@@ -2952,8 +2850,9 @@ interface ViteDevServer {
|
|
2952
2850
|
*/
|
2953
2851
|
httpServer: HttpServer | null;
|
2954
2852
|
/**
|
2955
|
-
*
|
2956
|
-
*
|
2853
|
+
* Chokidar watcher instance. If `config.server.watch` is set to `null`,
|
2854
|
+
* it will not watch any files and calling `add` will have no effect.
|
2855
|
+
* https://github.com/paulmillr/chokidar#getting-started
|
2957
2856
|
*/
|
2958
2857
|
watcher: FSWatcher;
|
2959
2858
|
/**
|
@@ -3065,6 +2964,10 @@ interface ResolvedServerUrls {
|
|
3065
2964
|
}
|
3066
2965
|
declare function createServer(inlineConfig?: InlineConfig): Promise<ViteDevServer>;
|
3067
2966
|
|
2967
|
+
type AnymatchFn = (testString: string) => boolean
|
2968
|
+
type AnymatchPattern = string | RegExp | AnymatchFn
|
2969
|
+
type AnymatchMatcher = AnymatchPattern | AnymatchPattern[]
|
2970
|
+
|
3068
2971
|
interface ESBuildOptions extends esbuild_TransformOptions {
|
3069
2972
|
include?: string | RegExp | string[] | RegExp[];
|
3070
2973
|
exclude?: string | RegExp | string[] | RegExp[];
|
@@ -3077,7 +2980,7 @@ interface ESBuildOptions extends esbuild_TransformOptions {
|
|
3077
2980
|
type ESBuildTransformResult = Omit<esbuild_TransformResult, 'map'> & {
|
3078
2981
|
map: SourceMap;
|
3079
2982
|
};
|
3080
|
-
declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object): Promise<ESBuildTransformResult>;
|
2983
|
+
declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<ESBuildTransformResult>;
|
3081
2984
|
|
3082
2985
|
interface CSSOptions {
|
3083
2986
|
/**
|
@@ -3455,7 +3358,7 @@ interface SSROptions {
|
|
3455
3358
|
/**
|
3456
3359
|
* Define the target for the ssr build. The browser field in package.json
|
3457
3360
|
* is ignored for node but used if webworker is the target
|
3458
|
-
* This option
|
3361
|
+
* This option will be removed in a future major version
|
3459
3362
|
* @default 'node'
|
3460
3363
|
*/
|
3461
3364
|
target?: SSRTarget;
|
@@ -3592,10 +3495,10 @@ interface SharedEnvironmentOptions {
|
|
3592
3495
|
*/
|
3593
3496
|
consumer?: 'client' | 'server';
|
3594
3497
|
/**
|
3595
|
-
*
|
3596
|
-
*
|
3498
|
+
* If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
|
3499
|
+
* Otherwise, it is statically replaced as an empty object.
|
3597
3500
|
*/
|
3598
|
-
|
3501
|
+
keepProcessEnv?: boolean;
|
3599
3502
|
/**
|
3600
3503
|
* Optimize deps config
|
3601
3504
|
*/
|
@@ -3616,12 +3519,12 @@ type ResolvedEnvironmentOptions = {
|
|
3616
3519
|
define?: Record<string, any>;
|
3617
3520
|
resolve: ResolvedResolveOptions;
|
3618
3521
|
consumer: 'client' | 'server';
|
3619
|
-
|
3522
|
+
keepProcessEnv?: boolean;
|
3620
3523
|
optimizeDeps: DepOptimizationOptions;
|
3621
3524
|
dev: ResolvedDevEnvironmentOptions;
|
3622
3525
|
build: ResolvedBuildEnvironmentOptions;
|
3623
3526
|
};
|
3624
|
-
type DefaultEnvironmentOptions = Omit<EnvironmentOptions, 'consumer' | '
|
3527
|
+
type DefaultEnvironmentOptions = Omit<EnvironmentOptions, 'consumer' | 'resolve'> & {
|
3625
3528
|
resolve?: AllResolveOptions;
|
3626
3529
|
};
|
3627
3530
|
interface UserConfig extends DefaultEnvironmentOptions {
|
@@ -4062,4 +3965,4 @@ interface ManifestChunk {
|
|
4062
3965
|
dynamicImports?: string[];
|
4063
3966
|
}
|
4064
3967
|
|
4065
|
-
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type
|
3968
|
+
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 };
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
2
|
-
import { i as isInNodeModules, a as arraify } from './chunks/dep-
|
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-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-Ddvoc4zx.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-Ddvoc4zx.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';
|
@@ -3547,10 +3547,8 @@ function loadPackageData(pkgPath) {
|
|
3547
3547
|
function getResolveCacheKey(key, options) {
|
3548
3548
|
return [
|
3549
3549
|
key,
|
3550
|
-
options.webCompatible ? "1" : "0",
|
3551
3550
|
options.isRequire ? "1" : "0",
|
3552
3551
|
options.conditions.join("_"),
|
3553
|
-
options.overrideConditions?.join("_") || "",
|
3554
3552
|
options.extensions.join("_"),
|
3555
3553
|
options.mainFields.join("_")
|
3556
3554
|
].join("|");
|
@@ -3568,7 +3566,10 @@ const filter = process.env.VITE_DEBUG_FILTER;
|
|
3568
3566
|
const DEBUG = process.env.DEBUG;
|
3569
3567
|
function createDebugger(namespace, options = {}) {
|
3570
3568
|
const log = debug$2(namespace);
|
3571
|
-
const { onlyWhenFocused } = options;
|
3569
|
+
const { onlyWhenFocused, depth } = options;
|
3570
|
+
if (depth && log.inspectOpts && log.inspectOpts.depth == null) {
|
3571
|
+
log.inspectOpts.depth = options.depth;
|
3572
|
+
}
|
3572
3573
|
let enabled = log.enabled;
|
3573
3574
|
if (enabled && onlyWhenFocused) {
|
3574
3575
|
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.
|
3
|
+
"version": "6.0.0-beta.8",
|
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": "^
|
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": "
|
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 &&
|
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/**",
|