vite 6.4.1 → 7.1.12

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.
Files changed (41) hide show
  1. package/LICENSE.md +76 -338
  2. package/README.md +1 -1
  3. package/bin/openChrome.js +68 -0
  4. package/bin/vite.js +7 -7
  5. package/dist/client/client.mjs +893 -921
  6. package/dist/client/env.mjs +14 -19
  7. package/dist/node/chunks/build.js +4 -0
  8. package/dist/node/chunks/build2.js +5523 -0
  9. package/dist/node/chunks/chunk.js +31 -0
  10. package/dist/node/chunks/config.js +36197 -0
  11. package/dist/node/chunks/config2.js +4 -0
  12. package/dist/node/chunks/dist.js +6758 -0
  13. package/dist/node/chunks/lib.js +377 -0
  14. package/dist/node/chunks/logger.js +320 -0
  15. package/dist/node/chunks/moduleRunnerTransport.d.ts +88 -0
  16. package/dist/node/chunks/optimizer.js +4 -0
  17. package/dist/node/chunks/postcss-import.js +479 -0
  18. package/dist/node/chunks/preview.js +4 -0
  19. package/dist/node/chunks/server.js +4 -0
  20. package/dist/node/cli.js +614 -865
  21. package/dist/node/index.d.ts +2692 -3282
  22. package/dist/node/index.js +24 -188
  23. package/dist/node/module-runner.d.ts +251 -234
  24. package/dist/node/module-runner.js +992 -1177
  25. package/package.json +56 -61
  26. package/types/importGlob.d.ts +14 -0
  27. package/types/importMeta.d.ts +1 -2
  28. package/types/internal/cssPreprocessorOptions.d.ts +3 -22
  29. package/types/internal/terserOptions.d.ts +11 -0
  30. package/types/metadata.d.ts +0 -2
  31. package/bin/openChrome.applescript +0 -95
  32. package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
  33. package/dist/node/chunks/dep-C9BXG1mU.js +0 -822
  34. package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
  35. package/dist/node/chunks/dep-D4NMHUTW.js +0 -49531
  36. package/dist/node/chunks/dep-DWMUTS1A.js +0 -7113
  37. package/dist/node/constants.js +0 -149
  38. package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
  39. package/dist/node-cjs/publicUtils.cjs +0 -3987
  40. package/index.cjs +0 -96
  41. package/index.d.cts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.4.1",
3
+ "version": "7.1.12",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -19,11 +19,7 @@
19
19
  "main": "./dist/node/index.js",
20
20
  "types": "./dist/node/index.d.ts",
21
21
  "exports": {
22
- ".": {
23
- "module-sync": "./dist/node/index.js",
24
- "import": "./dist/node/index.js",
25
- "require": "./index.cjs"
26
- },
22
+ ".": "./dist/node/index.js",
27
23
  "./client": {
28
24
  "types": "./client.d.ts"
29
25
  },
@@ -46,19 +42,19 @@
46
42
  "#module-sync-enabled": {
47
43
  "module-sync": "./misc/true.js",
48
44
  "default": "./misc/false.js"
49
- }
45
+ },
46
+ "#types/*": "./types/*.d.ts",
47
+ "#dep-types/*": "./src/types/*.d.ts"
50
48
  },
51
49
  "files": [
52
50
  "bin",
53
51
  "dist",
54
52
  "misc/**/*.js",
55
53
  "client.d.ts",
56
- "index.cjs",
57
- "index.d.cts",
58
54
  "types"
59
55
  ],
60
56
  "engines": {
61
- "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
57
+ "node": "^20.19.0 || >=22.12.0"
62
58
  },
63
59
  "repository": {
64
60
  "type": "git",
@@ -73,83 +69,82 @@
73
69
  "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
74
70
  "dependencies": {
75
71
  "esbuild": "^0.25.0",
76
- "fdir": "^6.4.4",
77
- "picomatch": "^4.0.2",
78
- "postcss": "^8.5.3",
79
- "rollup": "^4.34.9",
80
- "tinyglobby": "^0.2.13"
72
+ "fdir": "^6.5.0",
73
+ "picomatch": "^4.0.3",
74
+ "postcss": "^8.5.6",
75
+ "rollup": "^4.43.0",
76
+ "tinyglobby": "^0.2.15"
81
77
  },
82
78
  "optionalDependencies": {
83
79
  "fsevents": "~2.3.3"
84
80
  },
85
81
  "devDependencies": {
86
- "@ampproject/remapping": "^2.3.0",
87
- "@babel/parser": "^7.27.0",
88
- "@jridgewell/trace-mapping": "^0.3.25",
82
+ "@babel/parser": "^7.28.4",
83
+ "@jridgewell/remapping": "^2.3.5",
84
+ "@jridgewell/trace-mapping": "^0.3.31",
85
+ "@oxc-project/types": "0.90.0",
89
86
  "@polka/compression": "^1.0.0-next.25",
87
+ "@rolldown/pluginutils": "^1.0.0-beta.43",
90
88
  "@rollup/plugin-alias": "^5.1.1",
91
- "@rollup/plugin-commonjs": "^28.0.3",
89
+ "@rollup/plugin-commonjs": "28.0.6",
92
90
  "@rollup/plugin-dynamic-import-vars": "2.1.4",
93
- "@rollup/plugin-json": "^6.1.0",
94
- "@rollup/plugin-node-resolve": "16.0.1",
95
- "@rollup/pluginutils": "^5.1.4",
91
+ "@rollup/pluginutils": "^5.3.0",
96
92
  "@types/escape-html": "^1.0.4",
97
93
  "@types/pnpapi": "^0.0.5",
98
- "artichokie": "^0.3.1",
94
+ "artichokie": "^0.4.2",
95
+ "baseline-browser-mapping": "^2.8.18",
99
96
  "cac": "^6.7.14",
100
97
  "chokidar": "^3.6.0",
101
98
  "connect": "^3.7.0",
102
99
  "convert-source-map": "^2.0.0",
103
100
  "cors": "^2.8.5",
104
101
  "cross-spawn": "^7.0.6",
105
- "debug": "^4.4.0",
106
- "dep-types": "link:./src/types",
107
- "dotenv": "^16.5.0",
108
- "dotenv-expand": "^12.0.2",
109
- "es-module-lexer": "^1.6.0",
102
+ "debug": "^4.4.3",
103
+ "dotenv": "^17.2.3",
104
+ "dotenv-expand": "^12.0.3",
105
+ "es-module-lexer": "^1.7.0",
110
106
  "escape-html": "^1.0.3",
111
107
  "estree-walker": "^3.0.3",
112
108
  "etag": "^1.8.1",
113
- "http-proxy": "^1.18.1",
114
- "launch-editor-middleware": "^2.10.0",
115
- "lightningcss": "^1.29.3",
116
- "magic-string": "^0.30.17",
117
- "mlly": "^1.7.4",
109
+ "host-validation-middleware": "^0.1.2",
110
+ "http-proxy-3": "^1.22.0",
111
+ "launch-editor-middleware": "^2.11.1",
112
+ "lightningcss": "^1.30.2",
113
+ "magic-string": "^0.30.19",
114
+ "mlly": "^1.8.0",
118
115
  "mrmime": "^2.0.1",
119
- "nanoid": "^5.1.5",
120
- "open": "^10.1.1",
121
- "parse5": "^7.2.1",
116
+ "nanoid": "^5.1.6",
117
+ "open": "^10.2.0",
118
+ "parse5": "^8.0.0",
122
119
  "pathe": "^2.0.3",
123
120
  "periscopic": "^4.0.2",
124
121
  "picocolors": "^1.1.1",
125
- "postcss-import": "^16.1.0",
122
+ "postcss-import": "^16.1.1",
126
123
  "postcss-load-config": "^6.0.1",
127
124
  "postcss-modules": "^6.0.1",
125
+ "premove": "^4.0.0",
128
126
  "resolve.exports": "^2.0.3",
129
- "rollup-plugin-dts": "^6.2.1",
130
- "rollup-plugin-esbuild": "^6.2.1",
127
+ "rolldown": "^1.0.0-beta.43",
128
+ "rolldown-plugin-dts": "^0.16.11",
131
129
  "rollup-plugin-license": "^3.6.0",
132
- "sass": "^1.86.3",
133
- "sass-embedded": "^1.86.3",
130
+ "sass": "^1.93.2",
131
+ "sass-embedded": "^1.93.2",
134
132
  "sirv": "^3.0.2",
135
- "source-map-support": "^0.5.21",
136
- "strip-literal": "^3.0.0",
137
- "terser": "^5.39.0",
138
- "tsconfck": "^3.1.5",
139
- "tslib": "^2.8.1",
140
- "types": "link:./types",
133
+ "strip-literal": "^3.1.0",
134
+ "terser": "^5.44.0",
135
+ "tsconfck": "^3.1.6",
141
136
  "ufo": "^1.6.1",
142
- "ws": "^8.18.1"
137
+ "ws": "^8.18.3"
143
138
  },
144
139
  "peerDependencies": {
145
- "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
140
+ "@types/node": "^20.19.0 || >=22.12.0",
146
141
  "jiti": ">=1.21.0",
147
- "less": "*",
142
+ "less": "^4.0.0",
148
143
  "lightningcss": "^1.21.0",
149
- "sass": "*",
150
- "sass-embedded": "*",
151
- "stylus": "*",
152
- "sugarss": "*",
144
+ "sass": "^1.70.0",
145
+ "sass-embedded": "^1.70.0",
146
+ "stylus": ">=0.54.8",
147
+ "sugarss": "^5.0.0",
153
148
  "terser": "^5.16.0",
154
149
  "tsx": "^4.8.1",
155
150
  "yaml": "^2.4.2"
@@ -190,15 +185,15 @@
190
185
  }
191
186
  },
192
187
  "scripts": {
193
- "dev": "tsx scripts/dev.ts",
188
+ "dev": "premove dist && pnpm build-bundle -w",
194
189
  "build": "premove dist && pnpm build-bundle && pnpm build-types",
195
- "build-bundle": "rollup --config rollup.config.ts --configPlugin esbuild",
196
- "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check",
197
- "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node/tsconfig.build.json",
198
- "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && premove temp",
190
+ "build-bundle": "rolldown --config rolldown.config.ts",
191
+ "build-types": "pnpm build-types-roll && pnpm build-types-check",
192
+ "build-types-roll": "rolldown --config rolldown.dts.config.ts",
199
193
  "build-types-check": "tsc --project tsconfig.check.json",
200
- "typecheck": "tsc --noEmit && tsc --noEmit -p src/node",
194
+ "typecheck": "tsc && tsc -p src/node",
201
195
  "lint": "eslint --cache --ext .ts src/**",
202
- "format": "prettier --write --cache --parser typescript \"src/**/*.ts\""
196
+ "format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
197
+ "generate-target": "tsx scripts/generateTarget.ts"
203
198
  }
204
199
  }
@@ -28,10 +28,24 @@ export interface ImportGlobOptions<
28
28
  * @default false
29
29
  */
30
30
  exhaustive?: boolean
31
+ /**
32
+ * Base path to resolve relative paths.
33
+ */
34
+ base?: string
31
35
  }
32
36
 
33
37
  export type GeneralImportGlobOptions = ImportGlobOptions<boolean, string>
34
38
 
39
+ /**
40
+ * Declare Worker in case DOM is not added to the tsconfig lib causing
41
+ * Worker interface is not defined. For developers with DOM lib added,
42
+ * the Worker interface will be merged correctly.
43
+ */
44
+ declare global {
45
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
46
+ interface Worker {}
47
+ }
48
+
35
49
  export interface KnownAsTypeMap {
36
50
  raw: string
37
51
  url: string
@@ -11,8 +11,7 @@ interface ViteTypeOptions {
11
11
  type ImportMetaEnvFallbackKey =
12
12
  'strictImportMetaEnv' extends keyof ViteTypeOptions ? never : string
13
13
 
14
- interface ImportMetaEnv {
15
- [key: ImportMetaEnvFallbackKey]: any
14
+ interface ImportMetaEnv extends Record<ImportMetaEnvFallbackKey, any> {
16
15
  BASE_URL: string
17
16
  MODE: string
18
17
  DEV: boolean
@@ -14,31 +14,12 @@ import type Stylus from 'stylus'
14
14
  // https://github.com/type-challenges/type-challenges/issues/29285
15
15
  type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false
16
16
 
17
- type DartSassLegacyStringOptionsAsync = DartSass.LegacyStringOptions<'async'>
18
- type SassEmbeddedLegacyStringOptionsAsync =
19
- SassEmbedded.LegacyStringOptions<'async'>
20
- type SassLegacyStringOptionsAsync =
21
- IsAny<DartSassLegacyStringOptionsAsync> extends false
22
- ? DartSassLegacyStringOptionsAsync
23
- : SassEmbeddedLegacyStringOptionsAsync
24
-
25
- export type SassLegacyPreprocessBaseOptions = Omit<
26
- SassLegacyStringOptionsAsync,
27
- | 'data'
28
- | 'file'
29
- | 'outFile'
30
- | 'sourceMap'
31
- | 'omitSourceMapUrl'
32
- | 'sourceMapEmbed'
33
- | 'sourceMapRoot'
34
- >
35
-
36
17
  type DartSassStringOptionsAsync = DartSass.StringOptions<'async'>
37
18
  type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>
38
19
  type SassStringOptionsAsync =
39
- IsAny<DartSassStringOptionsAsync> extends false
40
- ? DartSassStringOptionsAsync
41
- : SassEmbeddedStringOptionsAsync
20
+ IsAny<SassEmbeddedStringOptionsAsync> extends false
21
+ ? SassEmbeddedStringOptionsAsync
22
+ : DartSassStringOptionsAsync
42
23
 
43
24
  export type SassModernPreprocessBaseOptions = Omit<
44
25
  SassStringOptionsAsync,
@@ -0,0 +1,11 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
+
3
+ // @ts-ignore `terser` may not be installed
4
+ export type * as Terser from 'terser'
5
+ // @ts-ignore `terser` may not be installed
6
+ import type * as Terser from 'terser'
7
+
8
+ /* eslint-enable @typescript-eslint/ban-ts-comment */
9
+
10
+ export type TerserMinifyOptions = Terser.MinifyOptions
11
+ export type TerserMinifyOutput = Terser.MinifyOutput
@@ -15,8 +15,6 @@ export interface CustomPluginOptionsVite {
15
15
  * ```js
16
16
  * cssScopeTo: ['/src/App.vue', 'default']
17
17
  * ```
18
- *
19
- * @experimental
20
18
  */
21
19
  cssScopeTo?: readonly [importerId: string, exportName: string | undefined]
22
20
 
@@ -1,95 +0,0 @@
1
- (*
2
- Copyright (c) 2015-present, Facebook, Inc.
3
-
4
- This source code is licensed under the MIT license found in the
5
- LICENSE file at
6
- https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
7
- *)
8
-
9
- property targetTab: null
10
- property targetTabIndex: -1
11
- property targetWindow: null
12
- property theProgram: "Google Chrome"
13
-
14
- on run argv
15
- set theURL to item 1 of argv
16
-
17
- -- Allow requested program to be optional,
18
- -- default to Google Chrome
19
- if (count of argv) > 1 then
20
- set theProgram to item 2 of argv
21
- end if
22
-
23
- using terms from application "Google Chrome"
24
- tell application theProgram
25
-
26
- if (count every window) = 0 then
27
- make new window
28
- end if
29
-
30
- -- 1: Looking for tab running debugger
31
- -- then, Reload debugging tab if found
32
- -- then return
33
- set found to my lookupTabWithUrl(theURL)
34
- if found then
35
- set targetWindow's active tab index to targetTabIndex
36
- tell targetTab to reload
37
- tell targetWindow to activate
38
- set index of targetWindow to 1
39
- return
40
- end if
41
-
42
- -- 2: Looking for Empty tab
43
- -- In case debugging tab was not found
44
- -- We try to find an empty tab instead
45
- set found to my lookupTabWithUrl("chrome://newtab/")
46
- if found then
47
- set targetWindow's active tab index to targetTabIndex
48
- set URL of targetTab to theURL
49
- tell targetWindow to activate
50
- return
51
- end if
52
-
53
- -- 3: Create new tab
54
- -- both debugging and empty tab were not found
55
- -- make a new tab with url
56
- tell window 1
57
- activate
58
- make new tab with properties {URL:theURL}
59
- end tell
60
- end tell
61
- end using terms from
62
- end run
63
-
64
- -- Function:
65
- -- Lookup tab with given url
66
- -- if found, store tab, index, and window in properties
67
- -- (properties were declared on top of file)
68
- on lookupTabWithUrl(lookupUrl)
69
- using terms from application "Google Chrome"
70
- tell application theProgram
71
- -- Find a tab with the given url
72
- set found to false
73
- set theTabIndex to -1
74
- repeat with theWindow in every window
75
- set theTabIndex to 0
76
- repeat with theTab in every tab of theWindow
77
- set theTabIndex to theTabIndex + 1
78
- if (theTab's URL as string) contains lookupUrl then
79
- -- assign tab, tab index, and window to properties
80
- set targetTab to theTab
81
- set targetTabIndex to theTabIndex
82
- set targetWindow to theWindow
83
- set found to true
84
- exit repeat
85
- end if
86
- end repeat
87
-
88
- if found then
89
- exit repeat
90
- end if
91
- end repeat
92
- end tell
93
- end using terms from
94
- return found
95
- end lookupTabWithUrl