top | item 32085609

(no title)

pastelsky | 3 years ago

Question: Is Vite really a serious tool built for production apps? The design decisions don't give me confidence.

As your app starts to grow, you'd definitely not want 1000s of modules loading in your browser.

Seems like something that gets you from 0-60 quickly, and becomes a pain after. Similarly, the different choice of bundlers in development and production would well lead to difference in behaviour / hard to catch bugs.

discuss

order

dmix|3 years ago

Shopify is using it with React. Lavarel now adopted it. It's the default for Vue projects going forward (given it's made by the person who made Vue).

Plenty of serious support behind it.

Not sure how you'd end up with "1000s of modules in your browser", unless you have some mega-project with an unwieldy package.json. I have a pretty complex Vue project app and it loads <100 .js files async and the vast majority are 100b and 95% will cache on the first load and never change. It's really not that big of a deal for modern browsers to load lots of tiny js files from your local machine in development.

I've found it to be way faster than Webpack for dev build times which is all that really matters to me.

pastelsky|3 years ago

> 1000s of modules in your browser Isn't very uncommon with large scale apps (1M LOC +)

rickbergfalk|3 years ago

Yes. Currently using it in production and couldn't be happier.

The individual modules are only served during development, but even then startup/load is faster than our previous webpack setup by an order of magnitude. When you build for production, you still end up with a bundle like you had previously.

ForSpareParts|3 years ago

It serves unbundled for development and bundled in production. In practice this works pretty well as long as you do decent code splitting (and you should be doing code splitting!)

Edit: lol I should have read your post more closely. Yes, the different strategies can cause bugs; there's much more shared between the two pipelines than there used to be so this situation is improving. We actually had really bad compatibility with problems six months ago and it was still easily worth the trouble for the performance improvement.