Vite 6.0 released – but devs still await Rust-powered future for popular build tool

Vite 6.0 released – but devs still await Rust-powered future for popular build tool

Vite 6.0 is the first major update since Vite 5.0 a year ago, and while the team claims it is the most significant release since Vite 2.0 in 2021, the biggest changes are still to come.

A Hello World app built with Vue 6.0

Vite is a build tool for JavaScript and TypeScript that aims to be faster and more productive than other options. It does more than just building applications, since Vite includes a development server and supports hot module replacement (HMR), the ability to modify code and have this change reflected in the running application, in development environments.

Version 6.0 is described as “the most significant major release since Vite 2,” released in 2021; but this is not the major update that developers are waiting for. New features include use of the modern API for the Sass CSS language by default, ability to customize the CSS output file name, and internal refactoring to support the experimental Environment API. 

Currently Vite supports two environments, one for running an application in the browser, and another for server-side rendering. In Vite 6, using the experimental Environment API, it is possible to define multiple environments, to match different production targets including running on Node.js, or on Cloudflare Workerd. There is also provision for running in multiple different environments concurrently.

There is a lot more change in the pipeline though, as explained by Vite (and Vue.js) creator Evan You at the October ViteConf. The future of Vite, You stated, is based on four tools, these being:

  • The Vite development server with HMR and framework support
  • Vitest, a Vite-native test runner
  • Rolldown, a replacement for the Rollup bundler, written in Rust
  • Oxc (Oxidation Compiler), described as a language toolchain, which performs tasks including parsing, linting, transforming TypeScript to JavaScript, and minifying code. Oxc is also written in Rust

You also announced a new company, Void(0) (or VoidZero) which is building “next generation JavaScript tooling,” founded with $4.6 million in seed funding. The new company owns and controls Oxc and Rolldown, though these are still open source projects under the MIT license.

Vite, said You, has challenges which reflect those of the wider JavaScript ecosystem – that what began as a simple scripting language is now used for large and complex applications. The community has created tools to bridge the gap between JavaScript’s capabilities and the requirements for today’s use cases, including TypeScript, bundlers, minifiers and more. It is a healthy community, but disadvantages include fragmentation, incompatibility and inefficiency.

Vite itself has two or three big dependencies. One is esbuild, a bundler written in Go, used for transforming TypeScript, minifying code, and dependency pre-bundling. Another is Rollup, used for the production bundler, plug-in support, and tree-shaking (dead code elimination). An optional third is SWC, another JavaScript/TypeScript compiler, often used in React applications.

Using these various tools with overlapping features introduces “subtle bugs because of different behavior,” said You, as well as causing pipeline inefficiency as code gets passed back and forth between them.

Not yet: a future Vite introduced by Evan You at ViteConf in October

The future You foresees is Vite with Rolldown and Oxc as what he called a “unified toolchain” which will be faster and more reliable.

That future is still some distance away. The next step perhaps will be a beta version of Rolldown sometime next year.

Vite is popular. According to the team, downloads from the npm registry increased from 7.5 million to 17 million downloads per week, since Vite 5 was released last year. Developers like its performance and that it is relatively easy to use. It has competition though, including from Vercel’s Turbopack, written in Rust – though You has disputed Vercel’s claims that it was 10 times faster than Vite.