Skip to content

Commit 2fc8a98

Browse files
committed
fix(issues): #1761 #1763 #1764 #1767
1 parent e40a204 commit 2fc8a98

File tree

9 files changed

+4406
-4
lines changed

9 files changed

+4406
-4
lines changed

1764.patch

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 87cc63d91c9dc4cb0b8c10b0d7f1a1e9e559408c Mon Sep 17 00:00:00 2001
2+
From: Bjorn Lu <bjornlu.dev@gmail.com>
3+
Date: Thu, 12 Mar 2026 14:11:25 +0800
4+
Subject: [PATCH] docs: fix optimizeDeps type links (#21823)
5+
6+
---
7+
docs/config/dep-optimization-options.md | 18 ++----------------
8+
1 file changed, 2 insertions(+), 16 deletions(-)
9+
10+
diff --git a/docs/config/dep-optimization-options.md b/docs/config/dep-optimization-options.md
11+
index bc15d635d618f8..35fcce94e4e74e 100644
12+
--- a/docs/config/dep-optimization-options.md
13+
+++ b/docs/config/dep-optimization-options.md
14+
@@ -53,11 +53,7 @@ export default defineConfig({
15+
16+
## optimizeDeps.rolldownOptions <NonInheritBadge />
17+
18+
-- **Type:** [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)`<`[`RolldownOptions`](https://rolldown.rs/reference/), `'input' | 'logLevel' | 'output'> & {
19+
- output?: [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)`<`
20+
- [`RolldownOutputOptions`](https://rolldown.rs/reference/),
21+
- `'format' | 'sourcemap' | 'dir' | 'banner'>`
22+
-`}`
23+
+- **Type:** <code>Omit<<a href="https://rolldown.rs/reference/Interface.RolldownOptions">RolldownOptions</a>, 'input' | 'logLevel' | 'output'> & { output?: Omit<<a href="https://rolldown.rs/reference/#:~:text=Output%20Options">RolldownOutputOptions</a>, 'format' | 'sourcemap' | 'dir' | 'banner'> }</code>
24+
25+
Options to pass to Rolldown during the dep scanning and optimization.
26+
27+
@@ -67,17 +63,7 @@ Certain options are omitted since changing them would not be compatible with Vit
28+
29+
## optimizeDeps.esbuildOptions <NonInheritBadge />
30+
31+
-- **Type:** [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)`<`[`EsbuildBuildOptions`](https://esbuild.github.io/api/#general-options)`,
32+
-| 'bundle'
33+
-| 'entryPoints'
34+
-| 'external'
35+
-| 'write'
36+
-| 'watch'
37+
-| 'outdir'
38+
-| 'outfile'
39+
-| 'outbase'
40+
-| 'outExtension'
41+
-| 'metafile'>`
42+
+- **Type:** <code>Omit<<a href="https://esbuild.github.io/api/#general-options">EsbuildBuildOptions</a>, 'bundle' | 'entryPoints' | 'external' | 'write' | 'watch' | 'outdir' | 'outfile' | 'outbase' | 'outExtension' | 'metafile'></code>
43+
- **Deprecated**
44+
45+
This option is converted to `optimizeDeps.rolldownOptions` internally. Use `optimizeDeps.rolldownOptions` instead.

1767.patch

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
From aa1ba2b67ca210fe8f03af8974b4c3c950f0cf3d Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?=E7=BF=A0?= <green@sapphi.red>
3+
Date: Thu, 12 Mar 2026 19:24:53 +0900
4+
Subject: [PATCH] docs(apis): add document for `this.meta.viteVersion` and
5+
`*version` variables (#21824)
6+
7+
---
8+
docs/guide/api-javascript.md | 24 ++++++++++++++++++++++++
9+
docs/guide/api-plugin.md | 27 +++++++++++++++++++++++++++
10+
2 files changed, 51 insertions(+)
11+
12+
diff --git a/docs/guide/api-javascript.md b/docs/guide/api-javascript.md
13+
index d12433f618aa40..0158a01638e7b4 100644
14+
--- a/docs/guide/api-javascript.md
15+
+++ b/docs/guide/api-javascript.md
16+
@@ -461,3 +461,27 @@ Pre-processes `.css`, `.scss`, `.sass`, `.less`, `.styl` and `.stylus` files to
17+
The pre-processor used is inferred from the `filename` extension. If the `filename` ends with `.module.{ext}`, it is inferred as a [CSS module](https://github.com/css-modules/css-modules) and the returned result will include a `modules` object mapping the original class names to the transformed ones.
18+
19+
Note that pre-processing will not resolve URLs in `url()` or `image-set()`.
20+
+
21+
+## `version`
22+
+
23+
+**Type:** `string`
24+
+
25+
+The current version of Vite as a string (e.g. `"8.0.0"`).
26+
+
27+
+## `rolldownVersion`
28+
+
29+
+**Type:** `string`
30+
+
31+
+The version of Rolldown used by Vite as a string (e.g. `"1.0.0"`). A re-export of [`VERSION`](https://rolldown.rs/reference/Variable.VERSION) from `rolldown`.
32+
+
33+
+## `esbuildVersion`
34+
+
35+
+**Type:** `string`
36+
+
37+
+Only kept for backward compatibility.
38+
+
39+
+## `rollupVersion`
40+
+
41+
+**Type:** `string`
42+
+
43+
+Only kept for backward compatibility.
44+
diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md
45+
index e418b8503c3320..c6cdbfb81fdd21 100644
46+
--- a/docs/guide/api-plugin.md
47+
+++ b/docs/guide/api-plugin.md
48+
@@ -477,6 +477,33 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
49+
}
50+
```
51+
52+
+## Plugin Context Meta
53+
+
54+
+For plugin hooks that has access to the plugin context, Vite exposes additional properties on `this.meta`:
55+
+
56+
+- `this.meta.viteVersion`: The current Vite version string (e.g. `"8.0.0"`).
57+
+
58+
+::: tip Detecting Rolldown powered Vite
59+
+
60+
+[`this.meta.rolldownVersion`](https://rolldown.rs/reference/Interface.PluginContextMeta#rolldownversion) is only available for Rolldown powered Vite (i.e. Vite 8+). You can use it to detect whether the current Vite instance is powered by Rolldown:
61+
+
62+
+```ts
63+
+function versionCheckPlugin(): Plugin {
64+
+ return {
65+
+ name: 'version-check',
66+
+ buildStart() {
67+
+ if (this.meta.rolldownVersion) {
68+
+ // only do something if running on a Rolldown powered Vite
69+
+ } else {
70+
+ // do something else if running on a Rollup powered Vite
71+
+ }
72+
+ },
73+
+ }
74+
+}
75+
+```
76+
+
77+
+:::
78+
+
79+
## Output Bundle Metadata
80+
81+
During build, Vite augments Rolldown's build output objects with a Vite-specific `viteMetadata` field.

0 commit comments

Comments
 (0)