vite 7.1.11 → 7.2.0-beta.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 +81 -81
- package/dist/client/client.mjs +4 -4
- package/dist/node/chunks/build.js +2 -2
- package/dist/node/chunks/build2.js +2 -2
- package/dist/node/chunks/chunk.js +1 -1
- package/dist/node/chunks/config.js +20612 -20393
- package/dist/node/chunks/config2.js +2 -2
- package/dist/node/chunks/dist.js +1 -1
- package/dist/node/chunks/lib.js +2 -2
- package/dist/node/chunks/logger.js +11 -2
- package/dist/node/chunks/moduleRunnerTransport.d.ts +28 -27
- package/dist/node/chunks/optimizer.js +2 -2
- package/dist/node/chunks/postcss-import.js +2 -2
- package/dist/node/chunks/preview.js +2 -2
- package/dist/node/chunks/server.js +2 -2
- package/dist/node/cli.js +2 -2
- package/dist/node/index.d.ts +1292 -1259
- package/dist/node/index.js +2 -2
- package/dist/node/module-runner.d.ts +82 -78
- package/dist/node/module-runner.js +47 -13
- package/package.json +10 -10
- package/types/customEvent.d.ts +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as resolveBaseUrl, c as sortUserPlugins, i as loadConfigFromFile, n as getDefaultEnvironmentOptions, o as resolveConfig, r as isResolvedConfig, s as resolveDevEnvironmentOptions, t as defineConfig } from "./config.js";
|
|
3
3
|
|
|
4
|
-
export { resolveConfig };
|
|
4
|
+
export { defineConfig, getDefaultEnvironmentOptions, isResolvedConfig, loadConfigFromFile, resolveBaseUrl, resolveConfig, resolveDevEnvironmentOptions, sortUserPlugins };
|
package/dist/node/chunks/dist.js
CHANGED
package/dist/node/chunks/lib.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS } from "./chunk.js";
|
|
1
|
+
import { t as __commonJS } from "./chunk.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js
|
|
4
4
|
var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js": ((exports, module) => {
|
|
@@ -374,4 +374,4 @@ var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss
|
|
|
374
374
|
}) });
|
|
375
375
|
|
|
376
376
|
//#endregion
|
|
377
|
-
export { require_lib };
|
|
377
|
+
export { require_lib as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as __toESM, t as __commonJS } from "./chunk.js";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import path, { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -127,6 +127,15 @@ const DEFAULT_CONDITIONS = [
|
|
|
127
127
|
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(DEFAULT_CONDITIONS.filter((c) => c !== "node"));
|
|
128
128
|
const DEFAULT_SERVER_CONDITIONS = Object.freeze(DEFAULT_CONDITIONS.filter((c) => c !== "browser"));
|
|
129
129
|
const DEFAULT_EXTERNAL_CONDITIONS = Object.freeze(["node", "module-sync"]);
|
|
130
|
+
const DEFAULT_EXTENSIONS = [
|
|
131
|
+
".mjs",
|
|
132
|
+
".js",
|
|
133
|
+
".mts",
|
|
134
|
+
".ts",
|
|
135
|
+
".jsx",
|
|
136
|
+
".tsx",
|
|
137
|
+
".json"
|
|
138
|
+
];
|
|
130
139
|
/**
|
|
131
140
|
* The browser versions that are included in the Baseline Widely Available on 2025-05-01.
|
|
132
141
|
*
|
|
@@ -317,4 +326,4 @@ function printServerUrls(urls, optionsHost, info) {
|
|
|
317
326
|
}
|
|
318
327
|
|
|
319
328
|
//#endregion
|
|
320
|
-
export {
|
|
329
|
+
export { OPTIMIZABLE_ENTRY_RE as A, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR as C, JS_TYPES_RE as D, FS_PREFIX as E, defaultAllowedOrigins as F, loopbackHosts as I, wildcardHosts as L, SPECIAL_QUERY_RE as M, VERSION as N, KNOWN_ASSET_TYPES as O, VITE_PACKAGE_DIR as P, require_picocolors as R, ENV_PUBLIC_PATH as S, ESBUILD_BASELINE_WIDELY_AVAILABLE_TARGET as T, DEFAULT_SERVER_CONDITIONS as _, CLIENT_ENTRY as a, DEV_PROD_CONDITION as b, DEFAULT_ASSETS_INLINE_LIMIT as c, DEFAULT_CLIENT_MAIN_FIELDS as d, DEFAULT_CONFIG_FILES as f, DEFAULT_PREVIEW_PORT as g, DEFAULT_EXTERNAL_CONDITIONS as h, CLIENT_DIR as i, ROLLUP_HOOKS as j, METADATA_FILENAME as k, DEFAULT_ASSETS_RE as l, DEFAULT_EXTENSIONS as m, createLogger as n, CLIENT_PUBLIC_PATH as o, DEFAULT_DEV_PORT as p, printServerUrls as r, CSS_LANGS_RE as s, LogLevels as t, DEFAULT_CLIENT_CONDITIONS as u, DEFAULT_SERVER_MAIN_FIELDS as v, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR as w, ENV_ENTRY as x, DEP_VERSION_RE as y };
|
|
@@ -8,51 +8,52 @@ interface FetchFunctionOptions {
|
|
|
8
8
|
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
|
|
9
9
|
interface CachedFetchResult {
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* If module cached in the runner, we can just confirm
|
|
12
|
+
* it wasn't invalidated on the server side.
|
|
13
|
+
*/
|
|
14
14
|
cache: true;
|
|
15
15
|
}
|
|
16
16
|
interface ExternalFetchResult {
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
* The path to the externalized module starting with file://,
|
|
19
|
+
* by default this will be imported via a dynamic "import"
|
|
20
|
+
* instead of being transformed by vite and loaded with vite runner
|
|
21
|
+
*/
|
|
22
22
|
externalize: string;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type:
|
|
24
|
+
* Type of the module. Will be used to determine if import statement is correct.
|
|
25
|
+
* For example, if Vite needs to throw an error if variable is not actually exported
|
|
26
|
+
*/
|
|
27
|
+
type: "module" | "commonjs" | "builtin" | "network";
|
|
28
28
|
}
|
|
29
29
|
interface ViteFetchResult {
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
* Code that will be evaluated by vite runner
|
|
32
|
+
* by default this will be wrapped in an async function
|
|
33
|
+
*/
|
|
34
34
|
code: string;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
* File path of the module on disk.
|
|
37
|
+
* This will be resolved as import.meta.url/filename
|
|
38
|
+
* Will be equal to `null` for virtual modules
|
|
39
|
+
*/
|
|
40
40
|
file: string | null;
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
* Module ID in the server module graph.
|
|
43
|
+
*/
|
|
44
44
|
id: string;
|
|
45
45
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
* Module URL used in the import.
|
|
47
|
+
*/
|
|
48
48
|
url: string;
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
* Invalidate module on the client side.
|
|
51
|
+
*/
|
|
52
52
|
invalidate: boolean;
|
|
53
53
|
}
|
|
54
54
|
type InvokeMethods = {
|
|
55
55
|
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
|
56
|
+
getBuiltins: () => Promise<(string | RegExp)[]>;
|
|
56
57
|
};
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region src/shared/moduleRunnerTransport.d.ts
|
|
@@ -61,8 +62,8 @@ type ModuleRunnerTransportHandlers = {
|
|
|
61
62
|
onDisconnection: () => void;
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
* "send and connect" or "invoke" must be implemented
|
|
66
|
+
*/
|
|
66
67
|
interface ModuleRunnerTransport {
|
|
67
68
|
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
|
|
68
69
|
disconnect?(): Promise<void> | void;
|
|
@@ -85,4 +86,4 @@ declare const createWebSocketModuleRunnerTransport: (options: {
|
|
|
85
86
|
pingInterval?: number;
|
|
86
87
|
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
|
|
87
88
|
//#endregion
|
|
88
|
-
export { ExternalFetchResult
|
|
89
|
+
export { ExternalFetchResult as a, ViteFetchResult as c, createWebSocketModuleRunnerTransport as i, ModuleRunnerTransportHandlers as n, FetchFunctionOptions as o, NormalizedModuleRunnerTransport as r, FetchResult as s, ModuleRunnerTransport as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as runOptimizeDeps, B as depsLogString, F as addOptimizedDepInfo, G as initDepsOptimizerMetadata, H as extractExportsData, I as cleanupDepsCacheStaleDirs, J as optimizeDeps, K as isDepOptimizationDisabled, L as createIsOptimizedDepFile, P as addManuallyIncludedOptimizeDeps, Q as optimizedDepNeedsInterop, R as createIsOptimizedDepUrl, U as getDepsCacheDir, V as discoverProjectDependencies, W as getOptimizedDepPath, X as optimizedDepInfoFromFile, Y as optimizeExplicitEnvironmentDeps, Z as optimizedDepInfoFromId, et as toDiscoveredDependencies, q as loadCachedDepOptimizationMetadata, z as depsFromOptimizedDepInfo } from "./config.js";
|
|
3
3
|
|
|
4
|
-
export { optimizeDeps };
|
|
4
|
+
export { addManuallyIncludedOptimizeDeps, addOptimizedDepInfo, cleanupDepsCacheStaleDirs, createIsOptimizedDepFile, createIsOptimizedDepUrl, depsFromOptimizedDepInfo, depsLogString, discoverProjectDependencies, extractExportsData, getDepsCacheDir, getOptimizedDepPath, initDepsOptimizerMetadata, isDepOptimizationDisabled, loadCachedDepOptimizationMetadata, optimizeDeps, optimizeExplicitEnvironmentDeps, optimizedDepInfoFromFile, optimizedDepInfoFromId, optimizedDepNeedsInterop, runOptimizeDeps, toDiscoveredDependencies };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { require_lib } from "./lib.js";
|
|
1
|
+
import { n as __require, t as __commonJS } from "./chunk.js";
|
|
2
|
+
import { t as require_lib } from "./lib.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js
|
|
5
5
|
var require_format_import_prelude = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.6/node_modules/postcss-import/lib/format-import-prelude.js": ((exports, module) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./logger.js";
|
|
2
|
-
import { _createServer,
|
|
2
|
+
import { at as _createServer, ct as resolveServerOptions, lt as restartServerWithUrls, ot as createServer, st as createServerCloseFn, ut as serverConfigDefaults } from "./config.js";
|
|
3
3
|
|
|
4
|
-
export { createServer };
|
|
4
|
+
export { _createServer, createServer, createServerCloseFn, resolveServerOptions, restartServerWithUrls, serverConfigDefaults };
|
package/dist/node/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __toESM } from "./chunks/chunk.js";
|
|
2
|
-
import { VERSION,
|
|
1
|
+
import { i as __toESM } from "./chunks/chunk.js";
|
|
2
|
+
import { N as VERSION, R as require_picocolors, n as createLogger } from "./chunks/logger.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { performance } from "node:perf_hooks";
|