Vite won.

The Rise of Vite 00:00

  • Vite has surpassed Webpack in weekly npm installs, marking a major shift in the JavaScript bundler landscape
  • The creator credits Evan You and the company around Vite for driving important change in web development tooling
  • Vite's win isn't solely about npm installs; there are deeper ecosystem and technical reasons for its success

Brief History of JavaScript Bundlers 03:32

  • Webpack 1.0 released in 2014 to help bundle growing numbers of JavaScript files into a single file for users, addressing browser connection limits
  • Before bundlers, developers relied on script tags and hoped for correct dependency loading, risking broken sites
  • Browserify enabled the use of Node-style modules and packages in the browser, including support for commonjs modules and built-in node features via shims and polyfills
  • npm's arrival provided a standardized package manager beyond script tags, shifting how dependencies were managed

The Webpack Era 07:47

  • Webpack rose to prominence around 2015, partly due to React's growth and endorsement from key figures like Pete Hunt
  • Introduced concepts like dependency graphs for all website assets, enabling features like code splitting and hot module reloading (HMR) for improved developer experience
  • Webpack's loaders allowed flexible handling of various file types, but maintaining these configurations was often complex
  • React and Webpack were closely linked, with tools like Create React App abstracting config complexities but presenting difficulties when customizations were needed

Personal Experience with Complex Tooling 12:15

  • The creator shares their experience at Twitch, transitioning through several teams and eventually working on complex React/GraphQL apps with heavy reliance on Webpack
  • Migrating from Webpack 2 to 4 was particularly challenging, leading to a deeper respect for modern web engineering
  • Spending significant time on low-level Webpack config revealed both the power and pain of existing tooling

Emergence of Snowpack and Vite 19:00

  • Snowpack, built by Fred K. Schott (Astro creator), improved dev speed with plugin support, caching, and fast refresh, but is now unmaintained in favor of alternatives like Vite
  • Vite, originally designed as a bundler for Vue, rapidly expanded to support other frameworks, including React, thanks to community contributions
  • Unlike Snowpack (custom everything), Vite used esbuild for dev and Rollup for production, combining fast local dev with reliable production bundling

Key Innovations of Vite 23:10

  • Vite's hybrid approach used esbuild during development for instant feedback and Rollup for efficient, optimized production code
  • Out-of-the-box experience, faster reloads, and reduced config complexity made Vite preferable over alternatives
  • Supported automatic bundle splitting via Rollup, outperforming manual splitting often necessary in Webpack; this realization was transformative for the creator

Widespread Adoption and Ecosystem Shift 30:18

  • Vite became the default for Vue and gained broad adoption in the React community, surpassing tools like Create React App for new projects
  • Most new React sites are now started using Vite templates
  • Despite some install metrics being skewed by caching and build processes, Vite's real-world momentum is undeniable

Limitations of Vite for Large Enterprises 34:25

  • Migrating massive, legacy Webpack codebases (thousands of files, custom loaders) to Vite is difficult and often impractical for big companies
  • Vite's development mode (esbuild serving many files independently) doesn't scale to huge apps, posing performance issues for large teams
  • Alternatives like Turbopack (from Vercel, Rust-based, aiming for Webpack API compatibility) and Rspack (TikTok/ByteDance's Rust-based bundler) are emerging for these cases

The Future: Rust-based Bundlers and RollDown 37:28

  • The Vite team is developing RollDown, a Rust rewrite of Rollup to further speed up both dev and production builds and solve scaling challenges
  • RollDown aims to unify dev and prod builds, addressing limitations present when dealing with very large projects

Conclusion and Takeaways 39:18

  • Npm install counts (for Vite or Webpack) can be misleading due to caching and how large teams manage dependencies
  • Despite technical caveats, Vite is now the default choice for most new web apps due to superior developer experience and community support
  • The bundler wars are effectively over: new projects rarely choose Webpack, marking a new era centered around Vite
  • The ecosystem has matured, and churn in tooling is largely behind us, promising greater stability and productivity for web developers