vite 5.3.3 → 5.3.5
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 +44 -0
- package/dist/node/chunks/{dep-DDAZqU2f.js → dep-CjZz522d.js} +10 -14
- package/dist/node/chunks/{dep-CrWVpuYf.js → dep-D-7KCb9p.js} +32 -2
- package/dist/node/chunks/{dep-DL1Zl8zp.js → dep-VqAwxVIc.js} +1 -1
- package/dist/node/chunks/{dep-CzJTQ5q7.js → dep-mCdpKltl.js} +2023 -2642
- package/dist/node/cli.js +5 -5
- package/dist/node/index.d.ts +15 -8
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +10 -17
- package/package.json +6 -6
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 { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-mCdpKltl.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -730,7 +730,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
730
730
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
731
731
|
).action(async (root, options) => {
|
732
732
|
filterDuplicateOptions(options);
|
733
|
-
const { createServer } = await import('./chunks/dep-
|
733
|
+
const { createServer } = await import('./chunks/dep-mCdpKltl.js').then(function (n) { return n.E; });
|
734
734
|
try {
|
735
735
|
const server = await createServer({
|
736
736
|
root,
|
@@ -822,7 +822,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
822
822
|
`[boolean] force empty outDir when it's outside of root`
|
823
823
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
|
824
824
|
filterDuplicateOptions(options);
|
825
|
-
const { build } = await import('./chunks/dep-
|
825
|
+
const { build } = await import('./chunks/dep-mCdpKltl.js').then(function (n) { return n.F; });
|
826
826
|
const buildOptions = cleanOptions(options);
|
827
827
|
try {
|
828
828
|
await build({
|
@@ -851,7 +851,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
851
851
|
).action(
|
852
852
|
async (root, options) => {
|
853
853
|
filterDuplicateOptions(options);
|
854
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
854
|
+
const { optimizeDeps } = await import('./chunks/dep-mCdpKltl.js').then(function (n) { return n.D; });
|
855
855
|
try {
|
856
856
|
const config = await resolveConfig(
|
857
857
|
{
|
@@ -877,7 +877,7 @@ ${e.stack}`),
|
|
877
877
|
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(
|
878
878
|
async (root, options) => {
|
879
879
|
filterDuplicateOptions(options);
|
880
|
-
const { preview } = await import('./chunks/dep-
|
880
|
+
const { preview } = await import('./chunks/dep-mCdpKltl.js').then(function (n) { return n.G; });
|
881
881
|
try {
|
882
882
|
const server = await preview({
|
883
883
|
root,
|
package/dist/node/index.d.ts
CHANGED
@@ -414,6 +414,7 @@ declare namespace HttpProxy {
|
|
414
414
|
* @param req - Client request.
|
415
415
|
* @param res - Client response.
|
416
416
|
* @param options - Additional options.
|
417
|
+
* @param callback - Error callback.
|
417
418
|
*/
|
418
419
|
web(
|
419
420
|
req: http.IncomingMessage,
|
@@ -428,6 +429,7 @@ declare namespace HttpProxy {
|
|
428
429
|
* @param socket - Client socket.
|
429
430
|
* @param head - Client head.
|
430
431
|
* @param options - Additional options.
|
432
|
+
* @param callback - Error callback.
|
431
433
|
*/
|
432
434
|
ws(
|
433
435
|
req: http.IncomingMessage,
|
@@ -1471,7 +1473,7 @@ interface HmrOptions {
|
|
1471
1473
|
path?: string;
|
1472
1474
|
timeout?: number;
|
1473
1475
|
overlay?: boolean;
|
1474
|
-
server?:
|
1476
|
+
server?: HttpServer;
|
1475
1477
|
}
|
1476
1478
|
interface HmrContext {
|
1477
1479
|
file: string;
|
@@ -1621,7 +1623,7 @@ interface ServerOptions extends CommonServerOptions {
|
|
1621
1623
|
*
|
1622
1624
|
* This is needed to proxy WebSocket connections to the parent server.
|
1623
1625
|
*/
|
1624
|
-
server:
|
1626
|
+
server: HttpServer;
|
1625
1627
|
};
|
1626
1628
|
/**
|
1627
1629
|
* Options for files served via '/\@fs/'.
|
@@ -2096,6 +2098,9 @@ interface RollupDynamicImportVarsOptions {
|
|
2096
2098
|
declare namespace Terser {
|
2097
2099
|
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
2098
2100
|
|
2101
|
+
export type ConsoleProperty = keyof typeof console
|
2102
|
+
type DropConsoleOption = boolean | ConsoleProperty[]
|
2103
|
+
|
2099
2104
|
export interface ParseOptions {
|
2100
2105
|
bare_returns?: boolean
|
2101
2106
|
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
@@ -2116,7 +2121,7 @@ declare namespace Terser {
|
|
2116
2121
|
dead_code?: boolean
|
2117
2122
|
defaults?: boolean
|
2118
2123
|
directives?: boolean
|
2119
|
-
drop_console?:
|
2124
|
+
drop_console?: DropConsoleOption
|
2120
2125
|
drop_debugger?: boolean
|
2121
2126
|
ecma?: ECMA
|
2122
2127
|
evaluate?: boolean
|
@@ -2139,6 +2144,7 @@ declare namespace Terser {
|
|
2139
2144
|
passes?: number
|
2140
2145
|
properties?: boolean
|
2141
2146
|
pure_funcs?: string[]
|
2147
|
+
pure_new?: boolean
|
2142
2148
|
pure_getters?: boolean | 'strict'
|
2143
2149
|
reduce_funcs?: boolean
|
2144
2150
|
reduce_vars?: boolean
|
@@ -2188,7 +2194,7 @@ declare namespace Terser {
|
|
2188
2194
|
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
2189
2195
|
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
2190
2196
|
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
2191
|
-
* @param n
|
2197
|
+
* @param n The ordinal of the identifier.
|
2192
2198
|
*/
|
2193
2199
|
get(n: number): string
|
2194
2200
|
}
|
@@ -2200,8 +2206,8 @@ declare namespace Terser {
|
|
2200
2206
|
/**
|
2201
2207
|
* Modifies the internal weighting of the input characters by the specified delta.
|
2202
2208
|
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
2203
|
-
* @param chars
|
2204
|
-
* @param delta
|
2209
|
+
* @param chars The characters to modify the weighting of.
|
2210
|
+
* @param delta The numeric weight to add to the characters.
|
2205
2211
|
*/
|
2206
2212
|
consider(chars: string, delta: number): number
|
2207
2213
|
/**
|
@@ -2284,7 +2290,7 @@ declare namespace Terser {
|
|
2284
2290
|
module?: boolean
|
2285
2291
|
nameCache?: object
|
2286
2292
|
format?: FormatOptions
|
2287
|
-
/** @deprecated
|
2293
|
+
/** @deprecated */
|
2288
2294
|
output?: FormatOptions
|
2289
2295
|
parse?: ParseOptions
|
2290
2296
|
safari10?: boolean
|
@@ -2304,6 +2310,7 @@ declare namespace Terser {
|
|
2304
2310
|
includeSources?: boolean
|
2305
2311
|
filename?: string
|
2306
2312
|
root?: string
|
2313
|
+
asObject?: boolean
|
2307
2314
|
url?: string | 'inline'
|
2308
2315
|
}
|
2309
2316
|
}
|
@@ -3568,4 +3575,4 @@ declare class ServerHMRConnector implements HMRRuntimeConnection {
|
|
3568
3575
|
onUpdate(handler: (payload: HMRPayload) => void): void;
|
3569
3576
|
}
|
3570
3577
|
|
3571
|
-
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, type BuildOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type ESBuildOptions, type ESBuildTransformResult, 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 HtmlTagDescriptor, HttpProxy, 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 MainThreadRuntimeOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createServer, createViteRuntime, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
|
3578
|
+
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, type BuildOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type ESBuildOptions, type ESBuildTransformResult, 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 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 MainThreadRuntimeOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createServer, createViteRuntime, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, 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 build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-mCdpKltl.js';
|
3
|
+
export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-mCdpKltl.js';
|
4
4
|
export { VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
import { existsSync, readFileSync } from 'node:fs';
|
@@ -3454,7 +3454,6 @@ function tryStatSync(file) {
|
|
3454
3454
|
} catch {
|
3455
3455
|
}
|
3456
3456
|
}
|
3457
|
-
const splitRE = /\r?\n/g;
|
3458
3457
|
function isFileReadable(filename) {
|
3459
3458
|
if (!tryStatSync(filename)) {
|
3460
3459
|
return false;
|
@@ -5394,7 +5393,6 @@ function getTimeFormatter() {
|
|
5394
5393
|
});
|
5395
5394
|
return timeFormatter;
|
5396
5395
|
}
|
5397
|
-
const MAX_LOG_CHAR = 5e3;
|
5398
5396
|
function createLogger(level = "info", options = {}) {
|
5399
5397
|
if (options.customLogger) {
|
5400
5398
|
return options.customLogger;
|
@@ -5405,22 +5403,17 @@ function createLogger(level = "info", options = {}) {
|
|
5405
5403
|
const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
|
5406
5404
|
const clear = canClearScreen ? clearScreen : () => {
|
5407
5405
|
};
|
5408
|
-
function
|
5409
|
-
if (msg.length > MAX_LOG_CHAR) {
|
5410
|
-
const shorten = msg.slice(0, MAX_LOG_CHAR);
|
5411
|
-
const lines = msg.slice(MAX_LOG_CHAR).match(splitRE)?.length || 0;
|
5412
|
-
return `${shorten}
|
5413
|
-
... and ${lines} lines more`;
|
5414
|
-
}
|
5415
|
-
return msg;
|
5416
|
-
}
|
5417
|
-
function format(type, rawMsg, options2 = {}) {
|
5418
|
-
const msg = preventOverflow(rawMsg);
|
5406
|
+
function format(type, msg, options2 = {}) {
|
5419
5407
|
if (options2.timestamp) {
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5408
|
+
let tag = "";
|
5409
|
+
if (type === "info") {
|
5410
|
+
tag = colors.cyan(colors.bold(prefix));
|
5411
|
+
} else if (type === "warn") {
|
5412
|
+
tag = colors.yellow(colors.bold(prefix));
|
5413
|
+
} else {
|
5414
|
+
tag = colors.red(colors.bold(prefix));
|
5415
|
+
}
|
5416
|
+
return `${colors.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${msg}`;
|
5424
5417
|
} else {
|
5425
5418
|
return msg;
|
5426
5419
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "5.3.
|
3
|
+
"version": "5.3.5",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
},
|
82
82
|
"devDependencies": {
|
83
83
|
"@ampproject/remapping": "^2.3.0",
|
84
|
-
"@babel/parser": "^7.24.
|
84
|
+
"@babel/parser": "^7.24.8",
|
85
85
|
"@jridgewell/trace-mapping": "^0.3.25",
|
86
86
|
"@polka/compression": "^1.0.0-next.25",
|
87
87
|
"@rollup/plugin-alias": "^5.1.0",
|
@@ -127,8 +127,8 @@
|
|
127
127
|
"resolve.exports": "^2.0.2",
|
128
128
|
"rollup-plugin-dts": "^6.1.1",
|
129
129
|
"rollup-plugin-esbuild": "^6.1.1",
|
130
|
-
"rollup-plugin-license": "^3.5.
|
131
|
-
"sass": "^1.77.
|
130
|
+
"rollup-plugin-license": "^3.5.2",
|
131
|
+
"sass": "^1.77.8",
|
132
132
|
"sirv": "^2.0.4",
|
133
133
|
"source-map-support": "^0.5.21",
|
134
134
|
"strip-ansi": "^7.1.0",
|
@@ -136,8 +136,8 @@
|
|
136
136
|
"tsconfck": "^3.1.1",
|
137
137
|
"tslib": "^2.6.3",
|
138
138
|
"types": "link:./types",
|
139
|
-
"ufo": "^1.5.
|
140
|
-
"ws": "^8.
|
139
|
+
"ufo": "^1.5.4",
|
140
|
+
"ws": "^8.18.0"
|
141
141
|
},
|
142
142
|
"peerDependencies": {
|
143
143
|
"@types/node": "^18.0.0 || >=20.0.0",
|