Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vavite vs. vite-node: Are they comparable? #38

Closed
AaronBeaudoin opened this issue Apr 27, 2023 · 1 comment
Closed

vavite vs. vite-node: Are they comparable? #38

AaronBeaudoin opened this issue Apr 27, 2023 · 1 comment

Comments

@AaronBeaudoin
Copy link

AaronBeaudoin commented Apr 27, 2023

I just read the discussion yesterday for Vite 5, and one thing that stood out to me was that the team is considering moving vite-node to Vite core "as an alternative to Vite's current SSR primitives to add support for source maps and HMR during SSR". From what I understand, vite-node was created to do nearly the same thing as vavite—correct me if I'm wrong on that. Since this repository doesn't have a "Discussions" tab, I'm using this issue to ask a few questions:

  • How does vavite compare to vite-node?
  • How does vite-node potentially moving into Vite core affect vavite?
@cyco130
Copy link
Owner

cyco130 commented May 2, 2023

In short, vite-node is more powerful and flexible but vavite easier to set up.

  • vite-node can run your server code in a worker or in a separate process while vavite is always in-process.
  • vite-node can customize hot module replacement behavior but vavite only has two strategies (reload all or reload static dependents only).

vavite has one more feature, the ESM loader, which may bring some unique possibilities in the future. Currently it leaks memory because Node.js has no way to dispose of a module but I'm hoping that it will change in the future. I also didn't find it to be a problem in practice.

If vite-node does get merged into Vite's core, I don't think I would mind switching to it. But until then I find vavite to be easier to use.

@cyco130 cyco130 closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants