Skip to content

Commit c4e6ecc

Browse files
committed
chore: merge main
2 parents de9074c + 13e3391 commit c4e6ecc

File tree

41 files changed

+449
-538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+449
-538
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,15 @@ For a mock dependency, make sure you add a `@vitejs/test-` prefix to the package
232232
- Checkout a topic branch from a base branch (e.g. `main`), and merge back against that branch.
233233

234234
- If adding a new feature:
235-
236235
- Add accompanying test case.
237236
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first, and have it approved before working on it.
238237

239238
- If fixing a bug:
240-
241239
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log (e.g. `fix: update entities encoding/decoding (fix #3899)`).
242240
- Provide a detailed description of the bug in the PR. Live demo preferred.
243241
- Add appropriate test coverage if applicable.
244242

245243
- If it's a chore:
246-
247244
- For typos and comment changes, try to combine multiple of them into a single PR.
248245
- **Note that we discourage contributors from submitting code refactors that are largely stylistic.** Code refactors are only accepted if it improves performance, or objectively improves code quality (e.g. makes a related bug fix or feature implementation easier, and it is as a separate PR to improve git history).
249246
- The reason is that code readability is subjective. The maintainers of this project have chosen to write the code in its current style based on our preferences, and we do not want to spend time explaining our stylistic preferences. Contributors should just respect the established conventions when contributing code. Another aspect of it is that large scale stylistic changes result in massive diffs that touch multiple files, adding noise to the git history and makes tracing behavior changes across commits more cumbersome.

docs/blog/announcing-vite7.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Vite 7.0 is out!
3+
author:
4+
name: The Vite Team
5+
date: 2025-06-24
6+
sidebar: false
7+
head:
8+
- - meta
9+
- property: og:type
10+
content: website
11+
- - meta
12+
- property: og:title
13+
content: Announcing Vite 7
14+
- - meta
15+
- property: og:image
16+
content: https://vite.dev/og-image-announcing-vite7.png
17+
- - meta
18+
- property: og:url
19+
content: https://vite.dev/blog/announcing-vite7
20+
- - meta
21+
- property: og:description
22+
content: Vite 7 Release Announcement
23+
- - meta
24+
- name: twitter:card
25+
content: summary_large_image
26+
---
27+
28+
# Vite 7.0 is out!
29+
30+
_June 24, 2025_
31+
32+
![Vite 7 Announcement Cover Image](/og-image-announcing-vite7.png)
33+
34+
We're happy to share the release of Vite 7! It has been 5 years since Evan You sent the first commit to the Vite repo, and nobody could have predicted how much the frontend ecosystem would change since then. Most modern frontend frameworks and tools are now working together, building on top of Vite's shared infrastructure. And they can innovate at a faster pace by sharing at a higher level. Vite is now being downloaded 31 million times a week, with a 14 million increase in the last seven months since the previous major release.
35+
36+
This year, we're making several big steps. To start with, [ViteConf](https://viteconf.org) is going to be in person! The Vite Ecosystem will gather in Amsterdam on October 9-10! Organized by [JSWorld](https://jsworldconference.com/) in partnership with [Bolt](https://bolt.new), [VoidZero](https://voidzero.dev), and the Vite Core Team! We had three incredible [ViteConf online editions](https://www.youtube.com/@viteconf/playlists), and we can't wait to meet in real life. Check out the speakers and get your ticket at the [ViteConf site](https://viteconf.org)!
37+
38+
And [VoidZero](https://voidzero.dev/posts/announcing-voidzero-inc) continues to make significant strides in its mission to build an open source unified development toolchain for the JavaScript ecosystem. Over the last year, the VoidZero team has been working on [Rolldown](https://rolldown.rs/), a Rust-based next-generation bundler, as part of a broader effort to modernize Vite's core. You can try out the Rolldown-powered Vite today by using the `rolldown-vite` package instead of the default `vite` package. It is a drop-in replacement, as Rolldown will become the default bundler for Vite in the future. Switching should reduce your build time, especially for larger projects. Read more at the [Rolldown-vite announcement blog post](https://voidzero.dev/posts/announcing-rolldown-vite) and our [migration guide](https://vite.dev/rolldown).
39+
40+
Through a partnership between VoidZero and [NuxtLabs](https://nuxtlabs.com/), Anthony Fu is working on creating Vite DevTools. They will offer deeper and more insightful debugging and analysis for all Vite-based projects and frameworks. You can read more on the [VoidZero and NuxtLabs join forces on Vite Devtools blog post](https://voidzero.dev/posts/voidzero-nuxtlabs-vite-devtools).
41+
42+
Quick links:
43+
44+
- [Docs](/)
45+
- New Translation: [فارسی](https://fa.vite.dev/)
46+
- Other Translations: [简体中文](https://cn.vite.dev/), [日本語](https://ja.vite.dev/), [Español](https://es.vite.dev/), [Português](https://pt.vite.dev/), [한국어](https://ko.vite.dev/), [Deutsch](https://de.vite.dev/)
47+
- [Migration Guide](/guide/migration)
48+
- [GitHub Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
49+
50+
Play online with Vite 7 using [vite.new](https://vite.new) or scaffold a Vite app locally with your preferred framework running `pnpm create vite`. Check out the [Getting Started Guide](/guide/) for more information.
51+
52+
We invite you to help us improve Vite (joining the more than [1.1K contributors to Vite Core](https://github.com/vitejs/vite/graphs/contributors)), our dependencies, or plugins and projects in the ecosystem. Learn more at our [Contributing Guide](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md). A good way to get started is by [triaging issues](https://github.com/vitejs/vite/issues), [reviewing PRs](https://github.com/vitejs/vite/pulls), sending tests PRs based on open issues, and supporting others in [Discussions](https://github.com/vitejs/vite/discussions) or Vite Land's [help forum](https://discord.com/channels/804011606160703521/1019670660856942652). If you have questions, join our [Discord community](http://chat.vite.dev/) and talk to us in the [#contributing channel](https://discord.com/channels/804011606160703521/804439875226173480).
53+
54+
Stay updated and connect with others building on top of Vite by following us on [Bluesky](https://bsky.app/profile/vite.dev), [X](https://twitter.com/vite_js), or [Mastodon](https://webtoo.ls/@vite).
55+
56+
## Node.js Support
57+
58+
Vite now requires Node.js 20.19+, 22.12+. We have dropped Node.js 18, now that it has reached its [EOL](https://endoflife.date/nodejs) at the end of April 2025.
59+
60+
We require these new ranges so Node.js supports `require(esm)` without a flag. This allows us to distribute Vite 7.0 as ESM only without preventing the Vite JavaScript API from being required by CJS modules. Check out Anthony Fu's [Move on to ESM-only](https://antfu.me/posts/move-on-to-esm-only) for a detailed review of the current state of ESM in the ecosystem.
61+
62+
## Default Browser Target Changed to Baseline Widely Available
63+
64+
[Baseline](https://web-platform-dx.github.io/web-features/) gives us clear information about which web platform features work across their core browser set today. Baseline Widely Available indicates the feature is well-established and works across many devices and browser versions, being available across browsers for at least 30 months.
65+
66+
In Vite 7, the default browser target is changing from `'modules'` to a new default: `'baseline-widely-available'`. The set of browsers will be updated on each major to match the list of minimum browser versions compatible with Baseline Widely available features. The default browser value of `build.target` is changing in Vite 7.0:
67+
68+
- Chrome 87 → 107
69+
- Edge 88 → 107
70+
- Firefox 78 → 104
71+
- Safari 14.0 → 16.0
72+
73+
This change adds predictability to the default browser target for future releases.
74+
75+
## Vitest
76+
77+
For Vitest users, Vite 7.0 is supported from Vitest 3.2. You can read more about how the Vitest team keeps improving Vite testing story in the [Vitest 3.2 release blog post](https://vitest.dev/blog/vitest-3-2.html).
78+
79+
## Environment API
80+
81+
Vite 6 was the most significant major release since Vite 2, adding new capabilities with the [new experimental Environment API](https://vite.dev/blog/announcing-vite6.html#experimental-environment-api). We are keeping the new APIs as experimental while the ecosystem reviews how the new APIs fit on their projects and provide feedback. If you're building on top of Vite, we encourage you to test the new APIs and reach out to us in the [open Feedback discussion here](https://github.com/vitejs/vite/discussions/16358).
82+
83+
In Vite 7, we added a new `buildApp` hook to let plugins coordinate the building of environments. Read more in the [Environment API for Frameworks guide](/guide/api-environment-frameworks.html#environments-during-build).
84+
85+
We want to thank the teams that have been testing the new APIs and helping us stabilize the new features. The Cloudflare team, for example, announced the 1.0 release of their Cloudflare Vite plugin, as well as official support for React Router v7. Their plugin shows the potential of Environment API for runtime providers. Learn more about their approach and future steps at ["Just use Vite”… with the Workers runtime](https://blog.cloudflare.com/introducing-the-cloudflare-vite-plugin/).
86+
87+
## Migrating to Vite 7
88+
89+
Vite 7 should be a smooth update from Vite 6. We're removing already deprecated features, like Sass legacy API support and the `splitVendorChunkPlugin` that shouldn't affect your projects. We still suggest you review the [detailed Migration Guide](/guide/migration) before upgrading.
90+
91+
The complete list of changes is at the [Vite 7 Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md).
92+
93+
## Acknowledgments
94+
95+
Vite 7 was crafted by the [Vite Team](/team) with the help of the wide community of contributors, downstream maintainers, plugin authors. A special shout-out to [sapphi-red](https://github.com/sapphi-red) for his remarkable work on `rolldown-vite` and this release. Vite is brought to you by [VoidZero](https://voidzero.dev), in partnership with [Bolt](https://bolt.new/) and [Nuxt Labs](https://nuxtlabs.com/). We also want to thank our sponsors on [Vite's GitHub Sponsors](https://github.com/sponsors/vitejs) and [Vite's Open Collective](https://opencollective.com/vite).

docs/guide/api-environment-plugins.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,29 @@ The hook can choose to:
126126
}
127127
```
128128
129+
## Per-environment State in Plugins
130+
131+
Given that the same plugin instance is used for different environments, the plugin state needs to be keyed with `this.environment`. This is the same pattern the ecosystem has already been using to keep state about modules using the `ssr` boolean as key to avoid mixing client and ssr modules state. A `Map<Environment, State>` can be used to keep the state for each environment separately. Note that for backward compatibility, `buildStart` and `buildEnd` are only called for the client environment without the `perEnvironmentStartEndDuringDev: true` flag.
132+
133+
```js
134+
function PerEnvironmentCountTransformedModulesPlugin() {
135+
const state = new Map<Environment, { count: number }>()
136+
return {
137+
name: 'count-transformed-modules',
138+
perEnvironmentStartEndDuringDev: true,
139+
buildStart() {
140+
state.set(this.environment, { count: 0 })
141+
},
142+
transform(id) {
143+
state.get(this.environment).count++
144+
},
145+
buildEnd() {
146+
console.log(this.environment.name, state.get(this.environment).count)
147+
}
148+
}
149+
}
150+
```
151+
129152
## Per-environment Plugins
130153
131154
A plugin can define what are the environments it should apply to with the `applyToEnvironment` function.

docs/guide/api-plugin.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
338338
Dedicated hook for transforming HTML entry point files such as `index.html`. The hook receives the current HTML string and a transform context. The context exposes the [`ViteDevServer`](./api-javascript#vitedevserver) instance during dev, and exposes the Rollup output bundle during build.
339339

340340
The hook can be async and can return one of the following:
341-
342341
- Transformed HTML string
343342
- An array of tag descriptor objects (`{ tag, attrs, children }`) to inject to the existing HTML. Each tag can also specify where it should be injected to (default is prepending to `<head>`)
344343
- An object containing both as `{ html, tags }`
@@ -417,13 +416,11 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
417416
server: ViteDevServer
418417
}
419418
```
420-
421419
- `modules` is an array of modules that are affected by the changed file. It's an array because a single file may map to multiple served modules (e.g. Vue SFCs).
422420

423421
- `read` is an async read function that returns the content of the file. This is provided because on some systems, the file change callback may fire too fast before the editor finishes updating the file and direct `fs.readFile` will return empty content. The read function passed in normalizes this behavior.
424422

425423
The hook can choose to:
426-
427424
- Filter and narrow down the affected module list so that the HMR is more accurate.
428425

429426
- Return an empty array and perform a full reload:

docs/guide/backend-integration.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ If you need a custom integration, you can follow the steps in this guide to conf
4545
```
4646

4747
In order to properly serve assets, you have two options:
48-
4948
- Make sure the server is configured to proxy static assets requests to the Vite server
5049
- Set [`server.origin`](/config/server-options.md#server-origin) so that generated asset URLs will be resolved using the back-end server URL instead of a relative path
5150

@@ -100,7 +99,6 @@ If you need a custom integration, you can follow the steps in this guide to conf
10099
}
101100
}
102101
```
103-
104102
- The manifest has a `Record<name, chunk>` structure
105103
- For entry or dynamic entry chunks, the key is the relative src path from project root.
106104
- For non entry chunks, the key is the base name of the generated file prefixed with `_`.
@@ -131,7 +129,6 @@ If you need a custom integration, you can follow the steps in this guide to conf
131129

132130
Specifically, a backend generating HTML should include the following tags given a manifest
133131
file and an entry point:
134-
135132
- A `<link rel="stylesheet">` tag for each file in the entry point chunk's `css` list
136133
- Recursively follow all chunks in the entry point's `imports` list and include a
137134
`<link rel="stylesheet">` tag for each CSS file of each imported chunk.

docs/guide/static-deploy.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ You can deploy your Vite app as a Static Site on [Render](https://render.com/).
265265
3. Connect your GitHub/GitLab account or use a public repository.
266266

267267
4. Specify a project name and branch.
268-
269268
- **Build Command**: `npm install && npm run build`
270269
- **Publish Directory**: `dist`
271270

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"gsap": "^3.13.0",
1515
"vitepress": "^1.6.3",
1616
"vitepress-plugin-group-icons": "^1.6.0",
17-
"vitepress-plugin-llms": "^1.5.0",
18-
"vue": "^3.5.16"
17+
"vitepress-plugin-llms": "^1.5.1",
18+
"vue": "^3.5.17"
1919
}
2020
}
674 KB
Loading

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export default tseslint.config(
102102
'less',
103103
'sass',
104104
'sass-embedded',
105+
'terser',
105106
'lightningcss',
106107
'vitest',
107108
'unbuild',

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@types/estree": "^1.0.8",
5151
"@types/etag": "^1.8.4",
5252
"@types/less": "^3.0.8",
53-
"@types/node": "^22.15.31",
53+
"@types/node": "^22.15.32",
5454
"@types/picomatch": "^4.0.0",
5555
"@types/stylus": "^0.48.43",
5656
"@types/ws": "^8.18.1",
@@ -64,15 +64,15 @@
6464
"globals": "^16.2.0",
6565
"lint-staged": "^16.1.2",
6666
"picocolors": "^1.1.1",
67-
"playwright-chromium": "^1.53.0",
68-
"prettier": "3.5.3",
67+
"playwright-chromium": "^1.53.1",
68+
"prettier": "3.6.0",
6969
"rollup": "^4.40.0",
7070
"simple-git-hooks": "^2.13.0",
7171
"tsx": "^4.20.3",
7272
"typescript": "~5.7.2",
73-
"typescript-eslint": "^8.34.0",
73+
"typescript-eslint": "^8.34.1",
7474
"vite": "workspace:*",
75-
"vitest": "^3.2.3"
75+
"vitest": "^3.2.4"
7676
},
7777
"simple-git-hooks": {
7878
"pre-commit": "pnpm exec lint-staged --concurrent false"
@@ -91,7 +91,7 @@
9191
"eslint --cache --fix"
9292
]
9393
},
94-
"packageManager": "[email protected].1",
94+
"packageManager": "[email protected].2",
9595
"pnpm": {
9696
"overrides": {
9797
"vite": "workspace:rolldown-vite@*"
@@ -130,11 +130,13 @@
130130
],
131131
"onlyBuiltDependencies": [
132132
"@parcel/watcher",
133+
"@tailwindcss/oxide",
133134
"bcrypt",
134135
"esbuild",
135136
"playwright-chromium",
136-
"rolldown",
137+
"sharp",
137138
"simple-git-hooks",
139+
"unrs-resolver",
138140
"workerd"
139141
]
140142
},

0 commit comments

Comments
 (0)