vite 8.1.5 → 8.2.0
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 +35 -0
- package/dist/client/bundledDevClient.mjs +1463 -0
- package/dist/client/client.mjs +51 -82
- package/dist/node/chunks/build.js +19 -19
- package/dist/node/chunks/node.js +1182 -351
- package/dist/node/chunks/postcss-import.js +10 -10
- package/dist/node/index.d.ts +58 -14
- package/dist/node/module-runner.js +14 -9
- package/package.json +11 -11
- package/types/customEvent.d.ts +3 -1
- package/types/hmrPayload.d.ts +20 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ft as __commonJSMin, pt as __require } from "./node.js";
|
|
2
2
|
import { t as require_lib } from "./lib.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
3
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/format-import-prelude.js
|
|
4
4
|
var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
5
|
module.exports = function formatImportPrelude(layer, media, supports) {
|
|
6
6
|
const parts = [];
|
|
@@ -15,7 +15,7 @@ var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
15
15
|
};
|
|
16
16
|
}));
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
18
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/base64-encoded-import.js
|
|
19
19
|
var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
20
20
|
const formatImportPrelude = require_format_import_prelude();
|
|
21
21
|
module.exports = function base64EncodedConditionalImport(prelude, conditions) {
|
|
@@ -28,7 +28,7 @@ var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
28
28
|
};
|
|
29
29
|
}));
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
31
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/apply-conditions.js
|
|
32
32
|
var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33
33
|
const base64EncodedConditionalImport = require_base64_encoded_import();
|
|
34
34
|
module.exports = function applyConditions(bundle, atRule) {
|
|
@@ -103,7 +103,7 @@ var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
103
103
|
};
|
|
104
104
|
}));
|
|
105
105
|
//#endregion
|
|
106
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
106
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/apply-raws.js
|
|
107
107
|
var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
108
108
|
module.exports = function applyRaws(bundle) {
|
|
109
109
|
bundle.forEach((stmt, index) => {
|
|
@@ -117,7 +117,7 @@ var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
117
117
|
};
|
|
118
118
|
}));
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
120
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/apply-styles.js
|
|
121
121
|
var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
122
122
|
module.exports = function applyStyles(bundle, styles) {
|
|
123
123
|
styles.nodes = [];
|
|
@@ -137,7 +137,7 @@ var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
137
137
|
};
|
|
138
138
|
}));
|
|
139
139
|
//#endregion
|
|
140
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
140
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/data-url.js
|
|
141
141
|
var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
142
142
|
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
|
143
143
|
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
|
@@ -156,7 +156,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
156
156
|
};
|
|
157
157
|
}));
|
|
158
158
|
//#endregion
|
|
159
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
159
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/parse-statements.js
|
|
160
160
|
var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
161
161
|
const valueParser = require_lib();
|
|
162
162
|
const { stringify } = valueParser;
|
|
@@ -281,7 +281,7 @@ var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
281
281
|
}
|
|
282
282
|
}));
|
|
283
283
|
//#endregion
|
|
284
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
284
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/process-content.js
|
|
285
285
|
var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
286
286
|
const path$2 = __require("path");
|
|
287
287
|
let sugarss;
|
|
@@ -315,7 +315,7 @@ var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
315
315
|
}
|
|
316
316
|
}));
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
318
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/lib/parse-styles.js
|
|
319
319
|
var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
320
320
|
const path$1 = __require("path");
|
|
321
321
|
const dataURL = require_data_url();
|
|
@@ -418,7 +418,7 @@ var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
418
418
|
module.exports = parseStyles;
|
|
419
419
|
}));
|
|
420
420
|
//#endregion
|
|
421
|
-
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.
|
|
421
|
+
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.23/node_modules/postcss-import/index.js
|
|
422
422
|
var require_postcss_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
423
423
|
const path = __require("path");
|
|
424
424
|
const applyConditions = require_apply_conditions();
|
package/dist/node/index.d.ts
CHANGED
|
@@ -24,12 +24,13 @@ import { ZlibOptions } from "node:zlib";
|
|
|
24
24
|
import { ChunkMetadata, CustomPluginOptionsVite } from "#types/metadata";
|
|
25
25
|
import { Terser, TerserMinifyOptions } from "#types/internal/terserOptions";
|
|
26
26
|
import * as PostCSS from "postcss";
|
|
27
|
+
import { ProcessOptions, Processor, Transformer } from "postcss";
|
|
27
28
|
import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "#types/internal/lightningcssOptions";
|
|
28
29
|
import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "#types/internal/cssPreprocessorOptions";
|
|
29
30
|
import { withFilter } from "rolldown/filter";
|
|
30
31
|
import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap, KnownQueryTypeMap } from "#types/importGlob";
|
|
31
32
|
//#endregion
|
|
32
|
-
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.
|
|
33
|
+
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.4.8_crossws@0.4.10_srvx@0.11.15_typescript@6.0.3_valibot@1.4.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
|
|
33
34
|
//#region src/node/cli-commands.d.ts
|
|
34
35
|
interface StartOptions {
|
|
35
36
|
root?: string;
|
|
@@ -39,7 +40,7 @@ interface StartOptions {
|
|
|
39
40
|
open?: boolean;
|
|
40
41
|
}
|
|
41
42
|
//#endregion
|
|
42
|
-
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.
|
|
43
|
+
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.4.8_crossws@0.4.10_srvx@0.11.15_typescript@6.0.3_valibot@1.4.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
|
|
43
44
|
//#region src/node/config.d.ts
|
|
44
45
|
interface DevToolsConfig extends Partial<StartOptions> {
|
|
45
46
|
enabled: boolean;
|
|
@@ -1628,22 +1629,31 @@ declare class BundledDev {
|
|
|
1628
1629
|
private initialBuildCompleted;
|
|
1629
1630
|
private _closed;
|
|
1630
1631
|
private clients;
|
|
1631
|
-
private invalidateCalledModules;
|
|
1632
1632
|
private debouncedFullReload;
|
|
1633
1633
|
private fullReloadPending;
|
|
1634
|
+
private reloadNeededClientIds;
|
|
1635
|
+
private debouncedReloadNeededFlush;
|
|
1634
1636
|
private lastBuildError;
|
|
1635
1637
|
memoryFiles: MemoryFiles;
|
|
1636
1638
|
constructor(environment: DevEnvironment);
|
|
1637
1639
|
private get devEngine();
|
|
1640
|
+
private pendingPayloadFilenames;
|
|
1638
1641
|
listen(): Promise<void>;
|
|
1639
1642
|
private waitForInitialBuildFinish;
|
|
1640
|
-
|
|
1641
|
-
path: string;
|
|
1642
|
-
message?: string;
|
|
1643
|
-
firstInvalidatedBy: string;
|
|
1644
|
-
}, client: NormalizedHotChannelClient): Promise<void>;
|
|
1643
|
+
private ensureOutputAndFlushReloadNeeded;
|
|
1645
1644
|
triggerBundleRegenerationIfStale(): Promise<boolean>;
|
|
1646
|
-
triggerLazyBundling(moduleId: string | null, clientId: string | null): Promise<
|
|
1645
|
+
triggerLazyBundling(moduleId: string | null, clientId: string | null): Promise<{
|
|
1646
|
+
code: string;
|
|
1647
|
+
filename: string;
|
|
1648
|
+
} | undefined>;
|
|
1649
|
+
/**
|
|
1650
|
+
* Called by the serving middlewares when the response for a payload completed.
|
|
1651
|
+
* Only delivered payloads are recorded on the server's per-client ship map, so
|
|
1652
|
+
* later chunks may omit a module only if the payload carrying it was delivered.
|
|
1653
|
+
*
|
|
1654
|
+
* Note: the payload filename is unique across all clients.
|
|
1655
|
+
*/
|
|
1656
|
+
markPayloadDelivered(filename: string): void;
|
|
1647
1657
|
close(): Promise<void>;
|
|
1648
1658
|
private storeOutputFiles;
|
|
1649
1659
|
private getRolldownOptions;
|
|
@@ -2002,7 +2012,6 @@ interface ResolveOptions extends EnvironmentResolveOptions {
|
|
|
2002
2012
|
* Enable tsconfig paths resolution
|
|
2003
2013
|
*
|
|
2004
2014
|
* @default false
|
|
2005
|
-
* @experimental
|
|
2006
2015
|
*/
|
|
2007
2016
|
tsconfigPaths?: boolean;
|
|
2008
2017
|
}
|
|
@@ -2280,9 +2289,10 @@ interface BuildEnvironmentOptions {
|
|
|
2280
2289
|
type BuildOptions = BuildEnvironmentOptions;
|
|
2281
2290
|
interface LibraryOptions {
|
|
2282
2291
|
/**
|
|
2283
|
-
* Path of library entry
|
|
2292
|
+
* Path of library entry.
|
|
2293
|
+
* Defaults to the top-level `input` option when omitted.
|
|
2284
2294
|
*/
|
|
2285
|
-
entry
|
|
2295
|
+
entry?: InputOption;
|
|
2286
2296
|
/**
|
|
2287
2297
|
* The name of the exposed global variable. Required when the `formats` option includes
|
|
2288
2298
|
* `umd` or `iife`
|
|
@@ -2759,6 +2769,13 @@ interface ViteDevServer {
|
|
|
2759
2769
|
interface ResolvedServerUrls {
|
|
2760
2770
|
local: string[];
|
|
2761
2771
|
network: string[];
|
|
2772
|
+
/**
|
|
2773
|
+
* Names of the network interface that each {@link ResolvedServerUrls.network}
|
|
2774
|
+
* URL is bound to, in the same order as `network`. An entry is `undefined`
|
|
2775
|
+
* when the interface name is not known, for example when an explicit `host`
|
|
2776
|
+
* is set.
|
|
2777
|
+
*/
|
|
2778
|
+
networkInterfaceNames?: (string | undefined)[];
|
|
2762
2779
|
}
|
|
2763
2780
|
declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Promise<ViteDevServer>;
|
|
2764
2781
|
//#endregion
|
|
@@ -3083,6 +3100,18 @@ type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: stri
|
|
|
3083
3100
|
*/
|
|
3084
3101
|
declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
|
|
3085
3102
|
//#endregion
|
|
3103
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.23_tsx@4.23.1_yaml@2.9.0/node_modules/postcss-load-config/src/index.d.ts
|
|
3104
|
+
type ConfigPlugin = Transformer | PostCSS.Plugin | Processor;
|
|
3105
|
+
interface Config {
|
|
3106
|
+
parser?: string | ProcessOptions['parser'] | false;
|
|
3107
|
+
stringifier?: string | ProcessOptions['stringifier'] | false;
|
|
3108
|
+
syntax?: string | ProcessOptions['syntax'] | false;
|
|
3109
|
+
map?: string | false;
|
|
3110
|
+
from?: string;
|
|
3111
|
+
to?: string;
|
|
3112
|
+
plugins?: Array<ConfigPlugin | false> | Record<string, object | false>;
|
|
3113
|
+
}
|
|
3114
|
+
//#endregion
|
|
3086
3115
|
//#region src/node/plugins/css.d.ts
|
|
3087
3116
|
interface CSSOptions {
|
|
3088
3117
|
/**
|
|
@@ -3376,6 +3405,12 @@ type AllResolveOptions = ResolveOptions & {
|
|
|
3376
3405
|
alias?: AliasOptions;
|
|
3377
3406
|
};
|
|
3378
3407
|
interface SharedEnvironmentOptions {
|
|
3408
|
+
/**
|
|
3409
|
+
* Entry points of the application.
|
|
3410
|
+
*
|
|
3411
|
+
* Paths are resolved relative to the project root.
|
|
3412
|
+
*/
|
|
3413
|
+
input?: InputOption;
|
|
3379
3414
|
/**
|
|
3380
3415
|
* Define global variable replacements.
|
|
3381
3416
|
* Entries will be defined on `window` during dev and replaced during build.
|
|
@@ -3423,6 +3458,7 @@ interface EnvironmentOptions extends SharedEnvironmentOptions {
|
|
|
3423
3458
|
}
|
|
3424
3459
|
type ResolvedResolveOptions = Required<ResolveOptions>;
|
|
3425
3460
|
type ResolvedEnvironmentOptions = {
|
|
3461
|
+
input?: InputOption;
|
|
3426
3462
|
define?: Record<string, any>;
|
|
3427
3463
|
resolve: ResolvedResolveOptions;
|
|
3428
3464
|
consumer: "client" | "server";
|
|
@@ -3463,7 +3499,7 @@ interface UserConfig extends DefaultEnvironmentOptions {
|
|
|
3463
3499
|
* the performance. You can use `--force` flag or manually delete the directory
|
|
3464
3500
|
* to regenerate the cache files. The value can be either an absolute file
|
|
3465
3501
|
* system path or a path relative to project root.
|
|
3466
|
-
* Default to `.vite` when
|
|
3502
|
+
* Default to `.vite` when neither a `package.json` nor a `node_modules` directory is detected.
|
|
3467
3503
|
* @default 'node_modules/.vite'
|
|
3468
3504
|
*/
|
|
3469
3505
|
cacheDir?: string;
|
|
@@ -3680,6 +3716,14 @@ interface ExperimentalOptions {
|
|
|
3680
3716
|
*
|
|
3681
3717
|
* This is highly experimental.
|
|
3682
3718
|
*
|
|
3719
|
+
* HMR semantics under full bundle mode differ from the middleware-based dev server
|
|
3720
|
+
* in two ways (boundaries are computed in the browser from runtime state, not
|
|
3721
|
+
* statically on the server):
|
|
3722
|
+
*
|
|
3723
|
+
* - Acceptance counts only when it executed: an `import.meta.hot.accept()` that
|
|
3724
|
+
* is in a dead branch does not suppress the update and falls back to a full reload.
|
|
3725
|
+
* - `hot.invalidate()` is handled fully client-side.
|
|
3726
|
+
*
|
|
3683
3727
|
* @experimental
|
|
3684
3728
|
* @default false
|
|
3685
3729
|
*/
|
|
@@ -4007,4 +4051,4 @@ declare const parseAst: typeof parseAst$1;
|
|
|
4007
4051
|
declare const parseAstAsync: typeof parseAstAsync$1;
|
|
4008
4052
|
declare const esbuildVersion = "0.25.0";
|
|
4009
4053
|
//#endregion
|
|
4010
|
-
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESTree, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlAssetSource, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type KnownQueryTypeMap, type LegacyOptions, type LessPreprocessorOptions, 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, type MinifyOptions, type MinifyResult, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type OxcOptions, type ParseResult, type ParserOptions, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, 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 Rolldown, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, Visitor, type VisitorObject, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, type WsOptions, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, esmExternalRequirePlugin, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, minify, minifySync, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parse, parseAst, parseAstAsync, parseSync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rolldownVersion, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, transformWithOxc, VERSION as version, withFilter };
|
|
4054
|
+
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESTree, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlAssetSource, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type KnownQueryTypeMap, type LegacyOptions, type LessPreprocessorOptions, 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, type MinifyOptions, type MinifyResult, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type OxcOptions, type ParseResult, type ParserOptions, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type Config as PostcssUserConfig, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, 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 Rolldown, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, Visitor, type VisitorObject, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, type WsOptions, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, esmExternalRequirePlugin, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, minify, minifySync, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parse, parseAst, parseAstAsync, parseSync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rolldownVersion, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, transformWithOxc, VERSION as version, withFilter };
|
|
@@ -65,7 +65,7 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
65
65
|
else if (char === "/") break;
|
|
66
66
|
else char = "/";
|
|
67
67
|
if (char === "/") {
|
|
68
|
-
if (
|
|
68
|
+
if (lastSlash !== index - 1 && dots !== 1) if (dots === 2) {
|
|
69
69
|
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
70
70
|
if (res.length > 2) {
|
|
71
71
|
let lastSlashIndex = res.lastIndexOf("/");
|
|
@@ -464,13 +464,17 @@ var HMRContext = class {
|
|
|
464
464
|
this.hotModulesMap.clear(), this.disposeMap.clear(), this.pruneMap.clear(), this.dataMap.clear(), this.customListenersMap.clear(), this.ctxToListenersMap.clear();
|
|
465
465
|
}
|
|
466
466
|
async prunePaths(paths) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
467
|
+
try {
|
|
468
|
+
await Promise.all(paths.map((path) => {
|
|
469
|
+
let disposer = this.disposeMap.get(path);
|
|
470
|
+
if (disposer) return disposer(this.dataMap.get(path));
|
|
471
|
+
})), await Promise.all(paths.map((path) => {
|
|
472
|
+
let fn = this.pruneMap.get(path);
|
|
473
|
+
if (fn) return fn(this.dataMap.get(path));
|
|
474
|
+
}));
|
|
475
|
+
} finally {
|
|
476
|
+
paths.forEach((path) => this.dataMap.delete(path));
|
|
477
|
+
}
|
|
474
478
|
}
|
|
475
479
|
warnFailedUpdate(err, path) {
|
|
476
480
|
(!(err instanceof Error) || !err.message.includes("fetch")) && this.logger.error(err), this.logger.error(`Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
|
|
@@ -787,6 +791,7 @@ function createHMRHandlerForRunner(runner) {
|
|
|
787
791
|
break;
|
|
788
792
|
}
|
|
789
793
|
case "ping": break;
|
|
794
|
+
case "bundled-dev-update": break;
|
|
790
795
|
default: return payload;
|
|
791
796
|
}
|
|
792
797
|
});
|
|
@@ -937,7 +942,7 @@ function CallSiteToString() {
|
|
|
937
942
|
return addSuffix && (line += ` (${fileLocation})`), line;
|
|
938
943
|
}
|
|
939
944
|
function cloneCallSite(frame) {
|
|
940
|
-
let object =
|
|
945
|
+
let object = Object.create(null);
|
|
941
946
|
return Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach((name) => {
|
|
942
947
|
let key = name;
|
|
943
948
|
object[key] = /^(?:is|get)/.test(name) ? function() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "Native-ESM powered web dev build tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build-tool",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"./package.json": "./package.json"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"lightningcss": "^1.
|
|
59
|
+
"lightningcss": "^1.33.0",
|
|
60
60
|
"picomatch": "^4.0.5",
|
|
61
|
-
"postcss": "^8.5.
|
|
62
|
-
"rolldown": "~1.
|
|
61
|
+
"postcss": "^8.5.23",
|
|
62
|
+
"rolldown": "~1.2.0",
|
|
63
63
|
"tinyglobby": "^0.2.17"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"@types/escape-html": "^1.0.4",
|
|
74
74
|
"@types/pnpapi": "^0.0.5",
|
|
75
75
|
"@vercel/detect-agent": "^1.2.3",
|
|
76
|
-
"@vitejs/devtools": "^0.
|
|
76
|
+
"@vitejs/devtools": "^0.4.8",
|
|
77
77
|
"@vitest/utils": "4.1.10",
|
|
78
78
|
"@voidzero-dev/vite-task-client": "^0.2.0",
|
|
79
79
|
"artichokie": "^0.4.4",
|
|
80
|
-
"baseline-browser-mapping": "^2.
|
|
80
|
+
"baseline-browser-mapping": "^2.11.3",
|
|
81
81
|
"cac": "^7.0.0",
|
|
82
82
|
"chokidar": "^3.6.0",
|
|
83
83
|
"connect": "^3.7.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"host-validation-middleware": "^0.1.4",
|
|
95
95
|
"http-proxy-3": "^1.23.3",
|
|
96
96
|
"launch-editor-middleware": "^2.14.1",
|
|
97
|
-
"magic-string": "^
|
|
97
|
+
"magic-string": "^1.1.0",
|
|
98
98
|
"mlly": "^1.8.2",
|
|
99
99
|
"mrmime": "^2.0.1",
|
|
100
100
|
"nanoid": "^5.1.16",
|
|
@@ -109,20 +109,20 @@
|
|
|
109
109
|
"postcss-modules": "^9.0.1",
|
|
110
110
|
"premove": "^4.0.0",
|
|
111
111
|
"resolve.exports": "^2.0.3",
|
|
112
|
-
"rolldown-plugin-dts": "^0.27.
|
|
112
|
+
"rolldown-plugin-dts": "^0.27.9",
|
|
113
113
|
"rollup": "^4.59.0",
|
|
114
114
|
"rollup-plugin-license": "^3.7.1",
|
|
115
|
-
"sass": "^1.
|
|
115
|
+
"sass": "^1.102.0",
|
|
116
116
|
"sass-embedded": "^1.100.0",
|
|
117
117
|
"sirv": "^3.0.2",
|
|
118
118
|
"strip-literal": "^3.1.0",
|
|
119
119
|
"terser": "^5.49.0",
|
|
120
120
|
"ufo": "^1.6.4",
|
|
121
|
-
"ws": "^8.21.
|
|
121
|
+
"ws": "^8.21.1"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"@types/node": "^20.19.0 || >=22.12.0",
|
|
125
|
-
"@vitejs/devtools": "^0.
|
|
125
|
+
"@vitejs/devtools": "^0.4.0",
|
|
126
126
|
"esbuild": "^0.27.0 || ^0.28.0",
|
|
127
127
|
"jiti": ">=1.21.0",
|
|
128
128
|
"less": "^4.0.0",
|
package/types/customEvent.d.ts
CHANGED
|
@@ -18,7 +18,9 @@ export interface CustomEventMap {
|
|
|
18
18
|
/** @internal */
|
|
19
19
|
'vite:forward-console': ForwardConsolePayload
|
|
20
20
|
/** @internal */
|
|
21
|
-
'vite:
|
|
21
|
+
'vite:client-connected': { clientId: string }
|
|
22
|
+
/** @internal */
|
|
23
|
+
'vite:bundled-dev:reload-needed': { reason: string }
|
|
22
24
|
|
|
23
25
|
// server events
|
|
24
26
|
'vite:client:connect': undefined
|
package/types/hmrPayload.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type HotPayload =
|
|
|
4
4
|
| ConnectedPayload
|
|
5
5
|
| PingPayload
|
|
6
6
|
| UpdatePayload
|
|
7
|
+
| BundledDevUpdatePayload
|
|
7
8
|
| FullReloadPayload
|
|
8
9
|
| CustomPayload
|
|
9
10
|
| ErrorPayload
|
|
@@ -22,14 +23,21 @@ export interface UpdatePayload {
|
|
|
22
23
|
updates: Update[]
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Full-bundle-mode update notification. The client computes the HMR boundaries
|
|
28
|
+
* itself from `changedIds`.
|
|
29
|
+
*/
|
|
30
|
+
export interface BundledDevUpdatePayload {
|
|
31
|
+
type: 'bundled-dev-update'
|
|
32
|
+
changedIds: string[]
|
|
33
|
+
/** URL of the per-client HMR patch chunk */
|
|
34
|
+
url: string
|
|
35
|
+
/** Per-client sequence number */
|
|
36
|
+
seq: number
|
|
37
|
+
}
|
|
38
|
+
|
|
25
39
|
export interface Update {
|
|
26
40
|
type: 'js-update' | 'css-update'
|
|
27
|
-
/**
|
|
28
|
-
* URL of HMR patch chunk
|
|
29
|
-
*
|
|
30
|
-
* This only exists when full-bundle mode is enabled.
|
|
31
|
-
*/
|
|
32
|
-
url?: string
|
|
33
41
|
path: string
|
|
34
42
|
acceptedPath: string
|
|
35
43
|
timestamp: number
|
|
@@ -53,6 +61,12 @@ export interface FullReloadPayload {
|
|
|
53
61
|
path?: string
|
|
54
62
|
/** @internal */
|
|
55
63
|
triggeredBy?: string
|
|
64
|
+
/**
|
|
65
|
+
* When set, only the bundling-fallback page acts on the reload;
|
|
66
|
+
* other pages ignore the message.
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
ifFallback?: boolean
|
|
56
70
|
}
|
|
57
71
|
|
|
58
72
|
export interface CustomPayload {
|