Live data from Hacker News

Why we switched from Webpack to Vite

blog.replit.com

191–200 of 229 posts

Re: Why we switched from Webpack to Vite

#191

Author of Vite here. I see many people evaluating Vite as a webpack replacement, so I want to clarify the goal of the project here: It is NOT Vite's goal to completely replace webpack. There are probably a small number of features/capabilities that some existing webpack projects rely on that doesn't exist in Vite, but those features are in the long tail and are only needed by a small number of power users who write b…

First of all thank you for writing so many useful open-source software.

Anyway since you are here is there any reason why Vite won't run with Vue 2.x? I tried Vue 3 with Vite and I was blown away how much dev time it saves. No startup time, no compile time.. but we have thousand and thousands of line of Vue 2 that isn't going to be ported to V3 anytime soon and it kills me that I have to waste so much time looking at webpack compiling all the vue files everytime I load it.

Is this technically impossible to make Vite work with Vue 2 or is it because the community has moved away from V2 and don't want to spend any time on V2 tooling? Thanks.

Re: Why we switched from Webpack to Vite

#192
Author of vite-plugin-ssr [1] here. Let me know if you have any question about doing SSR with Vite.

(vite-plugin-ssr provides a similar DX than Nuxt/Next.js but as a simple do-one-thing-do-it-well Vite plugin. Vite has a powerful SSR native API which makes not only vite-plugin-ssr's source code lean & small but also enables you to easily implement your custom SSR solution.)

[1]: https://github.com/brillout/vite-plugin-ssr

Re: Why we switched from Webpack to Vite

#193

I literally just spent days trying out Vite and comparing it to Webpack 5, and I can comfortably say that they are in two very distinct leagues. It isn't fair to compare Vite to a CRA build with Webpack. You can greatly improve Webpack's performance by: * Making sure `mode` is set to "development" (don't specify it all if in doubt) * Ditching babel-loader and using esbuild-loader instead * Adjusting build targets and…

> It just isn't suitable for proper server-side rendering, we'd need access to chunk names at build time

You can at later rollup hooks (it doesn't make sense to access chunks that don't exist yet).

Actually, there are SSR frameworks being built on top of Vite such as SvelteKit [1] or vite-plugin-ssr [2] (vite-plugin-ssr is not a framework but gives you a similar DX than Nuxt/Next.js; I'm its author), and many people are implementing custom SSR solutions.

Join our Discord #ssr channel and ask us questions https://discord.gg/PkbxgzPhJv ;-).

[1]: https://github.com/sveltejs/kit

[2]: https://github.com/brillout/vite-plugin-ssr

Re: Why we switched from Webpack to Vite

#194
Webpack was the most complex part of our application - it littered the root project with config files and needed a companion documentation file to be maintained let everyone know what was being used where. At some point treeshaking stopped working properly. I very nearly moved us to using makefiles.

As a side project to investigate upgrading to Vue3 we used Vite and have never looked back. Everyone understands how it works and what the config does (probably because of its built in support for things like SCSS without requiring a chain of configuration) and everything runs much faster.

I still worry that Vite like webpack and other web build systems is doing a lot under the hood and it will get complex to maintain when we want to do something out of the ordinary and a more 'open' build system like Make and an obvious sequence of processing steps would be better.

Re: Why we switched from Webpack to Vite

#197

When I learned about Prolog in university I had a "eureka" moment where I wondered why I was spending all this time learning to implement algorithms in imperative code, when I could just express the output I want and then let some über constraint solver figure out how to produce it. How liberating declarative programming would be if only we started coding with it more. When I try to use Webpack, as I click through ob…

I believe that SICP handled these sentiments very early on in the book.

Re: Why we switched from Webpack to Vite

#198

Author of Vite here. I see many people evaluating Vite as a webpack replacement, so I want to clarify the goal of the project here: It is NOT Vite's goal to completely replace webpack. There are probably a small number of features/capabilities that some existing webpack projects rely on that doesn't exist in Vite, but those features are in the long tail and are only needed by a small number of power users who write b…

First of all thank you for writing so many useful open-source software. Anyway since you are here is there any reason why Vite won't run with Vue 2.x? I tried Vue 3 with Vite and I was blown away how much dev time it saves. No startup time, no compile time.. but we have thousand and thousands of line of Vue 2 that isn't going to be ported to V3 anytime soon and it kills me that I have to waste so much time looking at…

There's a `vite-plugin-vue2`: https://github.com/underfin/vite-plugin-vue2#vite-plugin-vue...

Re: Why we switched from Webpack to Vite

#199

Author of Vite here. I see many people evaluating Vite as a webpack replacement, so I want to clarify the goal of the project here: It is NOT Vite's goal to completely replace webpack. There are probably a small number of features/capabilities that some existing webpack projects rely on that doesn't exist in Vite, but those features are in the long tail and are only needed by a small number of power users who write b…

Core team on Marko and author of Solid. Vite is exactly the sort of project we've been looking for. Sure I love coming up with the perfect Rollup setups to produce the smallest application bundles. But Vite closed the loop we were looking for in terms of offering low config client/server applications with both ease of use and great flexibility. You can see the focus and care put into Vite to make it easier to address…

[deleted]

Re: Why we switched from Webpack to Vite

#200
post #178
post #159

Earlier quoted context omitted.

Maybe you can enlighten me how to easily add a dependency (the equivalent of "yarn add lodash") in a platform-independent way.

I have used CMake. I added the dependency by writing about three CMake lines. And after that, it just works, for years. I may have to add from 2, to 5 dependencies for a project, instead of the myriad of dependencies in JS. And they don't become obsolete and need an update each week. It's a difference of some orders of magnitude, both in number and in upgrade frequency. This is a huge part of dependency management fo…

CMake only finds the dependencies, how do they get to your computer? Do you link statically or dynamically? What compiler toolchains are these libraries built with, do they use the same standard library as your code or different ones? When you want to cross compile, how do you find libraries for your target architecture?

Conan makes much of this easier, but is not really suited for large software projects with the problems mentioned above - in my experience.

Post reply on HN