Before 2.9, the first time dev was run on a project Vite needed to perform a scan phase to discover dependencies and then pre-bundle them before starting the server. In 2.9 both scanning #7379 and pre-bundling #6758 of dependencies are now non-blocking, so the server starts right away during cold start. We also now allow requests to flow through the pipeline improving initial cold start load speed and increasing the chances of discovering new missing dependencies when re-processing and letting Vite populate the module graph and the browser to process files. In many cases, there is also no need to full-reload the page when new dependencies are discovered.
CSS Sourcemap support during dev (experimental)
Vite now supports CSS sourcemaps #7173. This feature is still experimental, and it is disabled by default to avoid incurring a performance penalty for users that don't need it. To enable it, set css.devSourcemap to true.
Avoid splitting vendor chunks by default
Vite's default chunking strategy was a good fit for most SPAs, but it wasn't ideal in some other use cases. Vite doesn't have enough context to make the best decision here, so in Vite 2.9 the previous chunking strategy is now opt-in #6534 and Vite will no longer split vendor libs in a separate chunk.
Web Workers enhancements
Web Workers now supports source map generation (see #5417). The implementation is also now more robust, fixing several issues encountered in previous versions (#6599).
Raw Glob Imports
Glob imports support for the raw modifier syntax has changed to using { as: 'raw' }, which works in the same way as the ?raw suffix in regular imports:
The { assert: { type: 'raw' }} syntax introduced in v2.8 has been deprecated. See #7017 for more information.
New tools for Plugin and Framework Authors
Client Server Communication API
Vite now provides utilities for plugins to help handle the communication with clients connected to Vite's server #7437. Reusing the open WebSocket connection between the server and clients several use cases can be simplified (vite-plugin-inspect, SliDev, and many others). Check out the Client Server Communication docs for more information.
// Send a message from the client to the server
if (import.meta.hot) {
import.meta.hot.send('my:from-client', { msg: 'Hey!' })
</tr></table>
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
⚠️ Dependabot is rebasing this PR ⚠️
Rebasing might not happen immediately, so don't worry if this takes some time.
Note: if you make any changes to this PR yourself, they will take precedence over the rebase.
Bumps vite from 2.8.5 to 2.9.1.
Release notes
Sourced from vite's releases.
Changelog
Sourced from vite's changelog.
... (truncated)
Commits
a3b9f4c
release: v2.9.1d0253d7
fix: brotli let for reassignment (#7544)87fbe13
docs(changelog): fix raw glob imports syntax (#7540)173e4c9
fix: allow port 0 to be provided to server (#7530)29c1ec0
fix: dynamic import warning with@vite-ignore
(#7533)41fa2f5
fix: remove unneeded skipping optimization log (#7531)4324f48
chore: 2.9 release notes (#7525)997e735
release: v2.9.08efc6a6
fix: revert #7463 and #6624 (#7522)4fda42f
chore: typo (#7520)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)