Vite
Last updated
Was this helpful?
Last updated
Was this helpful?
As we build more and more ambitious applications, the amount of JavaScript we are dealing with is also increasing dramatically. It is not uncommon for large scale projects to contain thousands of modules. We are starting to hit a performance bottleneck for JavaScript based tooling: it can often take an unreasonably long wait (sometimes up to minutes!) to spin up a dev server, and even with Hot Module Replacement (HMR), file edits can take a couple of seconds to be reflected in the browser.
Vite improves the dev server start time by first dividing the modules in an application into two categories: dependencies and source code.
Vite using . esbuild is written in Go and pre-bundles dependencies 10-100x faster than JavaScript-based bundlers
Vite serves source code over . This is essentially letting the browser take over part of the job of a bundler: Vite only needs to transform and serve source code on demand, as the browser requests it.
Vite's adoption of Rollup's flexible plugin API and infrastructure heavily contributed to its success in the ecosystem.