vite 7.2.7 → 8.0.0-beta.1
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 +33 -44
- package/dist/client/client.mjs +39 -5
- package/dist/node/chunks/build.js +1 -1
- package/dist/node/chunks/config.js +3 -35975
- package/dist/node/chunks/logger.js +7 -11
- package/dist/node/chunks/node.js +36036 -0
- package/dist/node/chunks/optimizer.js +1 -1
- package/dist/node/chunks/preview.js +1 -1
- package/dist/node/chunks/server.js +1 -1
- package/dist/node/cli.js +5 -4
- package/dist/node/index.d.ts +215 -78
- package/dist/node/index.js +2 -28
- package/dist/node/internal.d.ts +2 -0
- package/dist/node/internal.js +3 -0
- package/package.json +15 -22
- package/types/customEvent.d.ts +3 -1
- package/types/hmrPayload.d.ts +6 -0
- package/types/hot.d.ts +1 -1
- package/types/importMeta.d.ts +2 -2
- package/types/internal/esbuildOptions.d.ts +28 -0
- package/types/internal/rollupTypeCompat.d.ts +24 -0
- package/types/metadata.d.ts +6 -1
- package/dist/node/chunks/config2.js +0 -4
- package/types/package.json +0 -4
package/dist/node/index.js
CHANGED
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
import { F as defaultAllowedOrigins, N as VERSION, _ as DEFAULT_SERVER_CONDITIONS, d as DEFAULT_CLIENT_MAIN_FIELDS, h as DEFAULT_EXTERNAL_CONDITIONS, n as createLogger, u as DEFAULT_CLIENT_CONDITIONS, v as DEFAULT_SERVER_MAIN_FIELDS } from "./chunks/logger.js";
|
|
2
|
-
import { Ct as
|
|
3
|
-
import { parseAst, parseAstAsync } from "rollup/parseAst";
|
|
4
|
-
import { version as esbuildVersion } from "esbuild";
|
|
2
|
+
import { A as createBuilder, At as createServerModuleRunner, Bt as isCSSRequest, C as isRunnableDevEnvironment, Ct as isFileServingAllowed, Dt as searchForWorkspaceRoot, E as build, Et as preprocessCSS, Ft as transformWithOxc, Gt as rollupVersion, Ht as mergeConfig, It as transformWithEsbuild, Kt as withFilter, Lt as perEnvironmentState, Mt as buildErrorMessage, Nt as loadEnv, Ot as createIdResolver, Pt as resolveEnvPrefix, Rt as perEnvironmentPlugin, S as createRunnableDevEnvironment, St as isFileLoadingAllowed, Tt as formatPostcssSourceMap, Ut as normalizePath, Vt as mergeAlias, Wt as rolldownVersion, a as parse, b as preview, bt as send, c as parseSync, d as defineConfig, g as resolveConfig, ht as createServer, i as minifySync, jt as createServerModuleRunnerTransport, kt as ssrTransform, l as createFetchableDevEnvironment, m as loadConfigFromFile, n as esmExternalRequirePlugin, o as parseAst, ot as optimizeDeps, pt as createServerHotChannel, r as minify, s as parseAstAsync, t as esbuildVersion, u as isFetchableDevEnvironment, v as sortUserPlugins, w as BuildEnvironment, wt as fetchModule, xt as DevEnvironment, y as runnerImport, zt as createFilter } from "./chunks/node.js";
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
function createFetchableDevEnvironment(name, config, context) {
|
|
8
|
-
if (typeof Request === "undefined" || typeof Response === "undefined") throw new TypeError("FetchableDevEnvironment requires a global `Request` and `Response` object.");
|
|
9
|
-
if (!context.handleRequest) throw new TypeError("FetchableDevEnvironment requires a `handleRequest` method during initialisation.");
|
|
10
|
-
return new FetchableDevEnvironment(name, config, context);
|
|
11
|
-
}
|
|
12
|
-
function isFetchableDevEnvironment(environment) {
|
|
13
|
-
return environment instanceof FetchableDevEnvironment;
|
|
14
|
-
}
|
|
15
|
-
var FetchableDevEnvironment = class extends DevEnvironment {
|
|
16
|
-
_handleRequest;
|
|
17
|
-
constructor(name, config, context) {
|
|
18
|
-
super(name, config, context);
|
|
19
|
-
this._handleRequest = context.handleRequest;
|
|
20
|
-
}
|
|
21
|
-
async dispatchFetch(request) {
|
|
22
|
-
if (!(request instanceof Request)) throw new TypeError("FetchableDevEnvironment `dispatchFetch` must receive a `Request` object.");
|
|
23
|
-
const response = await this._handleRequest(request);
|
|
24
|
-
if (!(response instanceof Response)) throw new TypeError("FetchableDevEnvironment `context.handleRequest` must return a `Response` object.");
|
|
25
|
-
return response;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { BuildEnvironment, DevEnvironment, 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, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };
|
|
4
|
+
export { BuildEnvironment, DevEnvironment, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evan You",
|
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
"build-tool",
|
|
17
17
|
"vite"
|
|
18
18
|
],
|
|
19
|
-
"main": "./dist/node/index.js",
|
|
20
|
-
"types": "./dist/node/index.d.ts",
|
|
21
19
|
"exports": {
|
|
22
20
|
".": "./dist/node/index.js",
|
|
23
21
|
"./client": {
|
|
24
22
|
"types": "./client.d.ts"
|
|
25
23
|
},
|
|
26
24
|
"./module-runner": "./dist/node/module-runner.js",
|
|
25
|
+
"./internal": "./dist/node/internal.js",
|
|
27
26
|
"./dist/client/*": "./dist/client/*",
|
|
28
27
|
"./types/*": {
|
|
29
28
|
"types": "./types/*"
|
|
@@ -31,13 +30,6 @@
|
|
|
31
30
|
"./types/internal/*": null,
|
|
32
31
|
"./package.json": "./package.json"
|
|
33
32
|
},
|
|
34
|
-
"typesVersions": {
|
|
35
|
-
"*": {
|
|
36
|
-
"module-runner": [
|
|
37
|
-
"dist/node/module-runner.d.ts"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
33
|
"imports": {
|
|
42
34
|
"#module-sync-enabled": {
|
|
43
35
|
"module-sync": "./misc/true.js",
|
|
@@ -68,11 +60,12 @@
|
|
|
68
60
|
"funding": "https://github.com/vitejs/vite?sponsor=1",
|
|
69
61
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
|
70
62
|
"dependencies": {
|
|
71
|
-
"
|
|
63
|
+
"@oxc-project/runtime": "0.101.0",
|
|
72
64
|
"fdir": "^6.5.0",
|
|
65
|
+
"lightningcss": "^1.30.2",
|
|
73
66
|
"picomatch": "^4.0.3",
|
|
74
67
|
"postcss": "^8.5.6",
|
|
75
|
-
"
|
|
68
|
+
"rolldown": "1.0.0-beta.53",
|
|
76
69
|
"tinyglobby": "^0.2.15"
|
|
77
70
|
},
|
|
78
71
|
"optionalDependencies": {
|
|
@@ -82,9 +75,9 @@
|
|
|
82
75
|
"@babel/parser": "^7.28.5",
|
|
83
76
|
"@jridgewell/remapping": "^2.3.5",
|
|
84
77
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
85
|
-
"@oxc-project/types": "0.
|
|
78
|
+
"@oxc-project/types": "0.101.0",
|
|
86
79
|
"@polka/compression": "^1.0.0-next.25",
|
|
87
|
-
"@rolldown/pluginutils": "
|
|
80
|
+
"@rolldown/pluginutils": "1.0.0-beta.53",
|
|
88
81
|
"@rollup/plugin-alias": "^5.1.1",
|
|
89
82
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
90
83
|
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
|
@@ -103,13 +96,13 @@
|
|
|
103
96
|
"dotenv": "^17.2.3",
|
|
104
97
|
"dotenv-expand": "^12.0.3",
|
|
105
98
|
"es-module-lexer": "^1.7.0",
|
|
99
|
+
"esbuild": "^0.25.0",
|
|
106
100
|
"escape-html": "^1.0.3",
|
|
107
101
|
"estree-walker": "^3.0.3",
|
|
108
102
|
"etag": "^1.8.1",
|
|
109
103
|
"host-validation-middleware": "^0.1.2",
|
|
110
104
|
"http-proxy-3": "^1.22.0",
|
|
111
|
-
"launch-editor-middleware": "^2.
|
|
112
|
-
"lightningcss": "^1.30.2",
|
|
105
|
+
"launch-editor-middleware": "^2.11.1",
|
|
113
106
|
"magic-string": "^0.30.21",
|
|
114
107
|
"mlly": "^1.8.0",
|
|
115
108
|
"mrmime": "^2.0.1",
|
|
@@ -124,8 +117,8 @@
|
|
|
124
117
|
"postcss-modules": "^6.0.1",
|
|
125
118
|
"premove": "^4.0.0",
|
|
126
119
|
"resolve.exports": "^2.0.3",
|
|
127
|
-
"rolldown": "^
|
|
128
|
-
"
|
|
120
|
+
"rolldown-plugin-dts": "^0.18.3",
|
|
121
|
+
"rollup": "^4.43.0",
|
|
129
122
|
"rollup-plugin-license": "^3.6.0",
|
|
130
123
|
"sass": "^1.94.2",
|
|
131
124
|
"sass-embedded": "^1.93.3",
|
|
@@ -138,9 +131,9 @@
|
|
|
138
131
|
},
|
|
139
132
|
"peerDependencies": {
|
|
140
133
|
"@types/node": "^20.19.0 || >=22.12.0",
|
|
134
|
+
"esbuild": "^0.25.0",
|
|
141
135
|
"jiti": ">=1.21.0",
|
|
142
136
|
"less": "^4.0.0",
|
|
143
|
-
"lightningcss": "^1.21.0",
|
|
144
137
|
"sass": "^1.70.0",
|
|
145
138
|
"sass-embedded": "^1.70.0",
|
|
146
139
|
"stylus": ">=0.54.8",
|
|
@@ -153,6 +146,9 @@
|
|
|
153
146
|
"@types/node": {
|
|
154
147
|
"optional": true
|
|
155
148
|
},
|
|
149
|
+
"esbuild": {
|
|
150
|
+
"optional": true
|
|
151
|
+
},
|
|
156
152
|
"jiti": {
|
|
157
153
|
"optional": true
|
|
158
154
|
},
|
|
@@ -171,9 +167,6 @@
|
|
|
171
167
|
"sugarss": {
|
|
172
168
|
"optional": true
|
|
173
169
|
},
|
|
174
|
-
"lightningcss": {
|
|
175
|
-
"optional": true
|
|
176
|
-
},
|
|
177
170
|
"terser": {
|
|
178
171
|
"optional": true
|
|
179
172
|
},
|
package/types/customEvent.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
FullReloadPayload,
|
|
4
4
|
PrunePayload,
|
|
5
5
|
UpdatePayload,
|
|
6
|
-
} from './hmrPayload'
|
|
6
|
+
} from './hmrPayload.js'
|
|
7
7
|
|
|
8
8
|
export interface CustomEventMap {
|
|
9
9
|
// client events
|
|
@@ -15,6 +15,8 @@ export interface CustomEventMap {
|
|
|
15
15
|
'vite:invalidate': InvalidatePayload
|
|
16
16
|
'vite:ws:connect': WebSocketConnectionPayload
|
|
17
17
|
'vite:ws:disconnect': WebSocketConnectionPayload
|
|
18
|
+
/** @internal */
|
|
19
|
+
'vite:module-loaded': { modules: string[] }
|
|
18
20
|
|
|
19
21
|
// server events
|
|
20
22
|
'vite:client:connect': undefined
|
package/types/hmrPayload.d.ts
CHANGED
|
@@ -24,6 +24,12 @@ export interface UpdatePayload {
|
|
|
24
24
|
|
|
25
25
|
export interface Update {
|
|
26
26
|
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
|
|
27
33
|
path: string
|
|
28
34
|
acceptedPath: string
|
|
29
35
|
timestamp: number
|
package/types/hot.d.ts
CHANGED
package/types/importMeta.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ interface ImportMetaEnv extends Record<ImportMetaEnvFallbackKey, any> {
|
|
|
22
22
|
interface ImportMeta {
|
|
23
23
|
url: string
|
|
24
24
|
|
|
25
|
-
readonly hot?: import('./hot').ViteHotContext
|
|
25
|
+
readonly hot?: import('./hot.js').ViteHotContext
|
|
26
26
|
|
|
27
27
|
readonly env: ImportMetaEnv
|
|
28
28
|
|
|
29
|
-
glob: import('./importGlob').ImportGlobFunction
|
|
29
|
+
glob: import('./importGlob.js').ImportGlobFunction
|
|
30
30
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
|
|
3
|
+
// @ts-ignore `esbuild` may not be installed
|
|
4
|
+
import type esbuild from 'esbuild'
|
|
5
|
+
|
|
6
|
+
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
|
7
|
+
|
|
8
|
+
export type EsbuildTarget = string | string[]
|
|
9
|
+
|
|
10
|
+
export type EsbuildLoader = esbuild.Loader
|
|
11
|
+
export type EsbuildTransformOptions = esbuild.TransformOptions
|
|
12
|
+
export type EsbuildTransformResult = esbuild.TransformResult
|
|
13
|
+
|
|
14
|
+
export type EsbuildMessage = esbuild.Message
|
|
15
|
+
|
|
16
|
+
export type DepsOptimizerEsbuildOptions = Omit<
|
|
17
|
+
esbuild.BuildOptions,
|
|
18
|
+
| 'bundle'
|
|
19
|
+
| 'entryPoints'
|
|
20
|
+
| 'external'
|
|
21
|
+
| 'write'
|
|
22
|
+
| 'watch'
|
|
23
|
+
| 'outdir'
|
|
24
|
+
| 'outfile'
|
|
25
|
+
| 'outbase'
|
|
26
|
+
| 'outExtension'
|
|
27
|
+
| 'metafile'
|
|
28
|
+
>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type * as Rolldown from 'rolldown'
|
|
2
|
+
|
|
3
|
+
export * from 'rolldown'
|
|
4
|
+
|
|
5
|
+
/** @deprecated use RolldownBuild instead */
|
|
6
|
+
export type RollupBuild = Rolldown.RolldownBuild
|
|
7
|
+
|
|
8
|
+
/** @deprecated use RolldownOptions instead */
|
|
9
|
+
export type RollupOptions = Rolldown.RolldownOptions
|
|
10
|
+
|
|
11
|
+
/** @deprecated use RolldownOutput instead */
|
|
12
|
+
export type RollupOutput = Rolldown.RolldownOutput
|
|
13
|
+
|
|
14
|
+
/** @deprecated use RolldownPlugin instead */
|
|
15
|
+
export type RollupPlugin = Rolldown.RolldownPlugin
|
|
16
|
+
|
|
17
|
+
/** @deprecated use RolldownPluginOption instead */
|
|
18
|
+
export type RollupPluginOption = Rolldown.RolldownPluginOption
|
|
19
|
+
|
|
20
|
+
/** @deprecated use RolldownWatcher instead */
|
|
21
|
+
export type RollupWatcher = Rolldown.RolldownWatcher
|
|
22
|
+
|
|
23
|
+
/** @deprecated use RollupWatcherEvent instead */
|
|
24
|
+
export type RollupWatcherEvent = Rolldown.RolldownWatcherEvent
|
package/types/metadata.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface ChunkMetadata {
|
|
2
2
|
importedAssets: Set<string>
|
|
3
3
|
importedCss: Set<string>
|
|
4
|
+
/** @internal */
|
|
5
|
+
__modules: any
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
export interface CustomPluginOptionsVite {
|
|
@@ -22,10 +24,13 @@ export interface CustomPluginOptionsVite {
|
|
|
22
24
|
lang?: string
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
declare module '
|
|
27
|
+
declare module 'rolldown' {
|
|
26
28
|
export interface RenderedChunk {
|
|
27
29
|
viteMetadata?: ChunkMetadata
|
|
28
30
|
}
|
|
31
|
+
export interface OutputChunk {
|
|
32
|
+
viteMetadata?: ChunkMetadata
|
|
33
|
+
}
|
|
29
34
|
|
|
30
35
|
export interface CustomPluginOptions {
|
|
31
36
|
vite?: CustomPluginOptionsVite
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import "./logger.js";
|
|
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
|
-
|
|
4
|
-
export { resolveConfig };
|
package/types/package.json
DELETED