My Authors
Read all threads
There's a lot of new stuff added to vite in the past week. It's no longer just "dev server for Vue SFCs." Time for a recap on what it really does (thread):
1. During dev, vite is a dev server that compiles source files as they are requested by the browser. No bundling is required, and compilation is truly on-demand. Unchanged files return 304 so browsers don't even request it. This is what makes it start fast and stay fast.
2. Vite supports Hot Module Replacement, which is fundamentally different from "simply reload the page". It's a world of difference in terms of DX. Vue components and CSS HMR are supported out of the box, and 3rd party frameworks can leverage the HMR API.
3. Vite supports a number of webpack-inspired features like importing `.css` files from js (a la css-loader), referencing assets based on fs relative paths (a la file-loader, the final public deployed path is auto taken care of by simply specifying `--base` during build)
4. Vite supports .(t|j)sx? files out of the box via esbuild, which is astonishingly fast, so even with TS transpilation the HMR is still literally instant.
5. Vite uses Rollup for production builds, with an internal config that mirrors the dev server features. The production build output is a directory of traditional static assets that can be deployed anywhere (and can be polyfilled to support older browsers).
6. Vite is also extensible at core (config/plugin format pending) - you can add support for custom file transforms by adding a Koa middleware (for dev) + a Rollup plugin (for build).
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Evan You

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!