elixir phoenix liveview

Elixir vs Vite: Do You Need Vite With Phoenix?

Daniil Popov November 28, 2026

Some people find this site by searching "elixir vs vite". I get why. When we wrote up our last migration, Vite was on the list of things that went away, and Elixir was what stayed. So it looks like one replaced the other.

It didn't, not directly. Elixir and Vite aren't the same kind of tool, and comparing them is a bit like comparing a kitchen and a knife. But the question behind the search is a good one: if I build with Elixir and Phoenix, do I still need Vite? Usually no. Sometimes yes. Here's how I'd decide.

What each one is

Vite is a frontend build tool. In its own words it "aims to provide a faster and leaner development experience for modern web projects": a dev server with fast reloads, and a build command that bundles your JavaScript and CSS for production. It runs on Node.js.

Elixir is a programming language, and Phoenix is its web framework. Phoenix runs your whole backend: the database, the business logic, the background jobs, the HTML. With LiveView on top, it also runs most of the interactive UI. The LiveView docs put it in one line: "rich, real-time user experiences with server-rendered HTML".

So Vite builds frontend assets. Phoenix is the application. They can live in the same project, and some teams do exactly that.

What Phoenix uses instead of Vite

A new Phoenix app still has some JavaScript and CSS. It just doesn't need Vite or Node to build them.

The Phoenix asset docs say it directly: "newly generated applications do not have dependencies on Node.js or an external build system". JavaScript goes through esbuild and CSS through Tailwind, both driven by small Elixir wrappers. You run mix phx.server and the assets rebuild as you edit.

You only bring in npm when you want an npm package. Even then, there's no separate frontend project to maintain.

Why Vite usually goes away in a Phoenix project

Vite is there to build a big client side app, usually React or Vue. In most Phoenix projects, that app is what disappears.

With LiveView the server renders the UI and pushes small updates to the browser over a websocket. Forms, tables, filters, live dashboards, modals: all of it lives in Elixir. There's no state to sync between a frontend and a backend, and no API layer between them. Once the big client app is gone, there's not much left for Vite to build.

That's what happened in our migration. The frontend we inherited had 398 component files, 54 npm packages and a Vite build pipeline. After the move to LiveView, the frontend went from 18,797 lines to 1,330. We didn't swap Vite for something faster. We deleted the reason it was there.

When I'd keep Vite

LiveView isn't the right tool for everything, and I'd rather say so than have you find out later.

  • The UI is mostly client side work: a drawing canvas, a photo editor, a 3D view, anything that must keep working offline.
  • You have a large React or Vue codebase that works well, and a team that knows it. Rewriting a good frontend just to remove a build tool is a bad trade.
  • You rely on a frontend library ecosystem that expects a Vite setup.

In those cases you can keep both. The Phoenix docs explain how to replace the default build with your own, and there's a Hex package, phoenix_vite, that "integrates the vite built tool with :phoenix". I'd still render most screens with LiveView and use React only for the parts that really need it.

The short answer

Question Answer
Are Elixir and Vite alternatives? No. Elixir is a language, Vite is a frontend build tool.
Does Phoenix need Vite? No. New apps use esbuild and Tailwind with no Node.js dependency.
Why do teams drop Vite after moving to Phoenix? LiveView replaces the React or Vue app that Vite was building.
When should you keep it? Heavy client side UI, offline apps, or a large frontend that works.
Can you use both? Yes, for example with the phoenix_vite package.

Thinking about the move?

The build tool is the smallest part of the decision. The real question is whether your frontend and backend should be one codebase. I wrote about that for Node.js teams and Rails teams, and there's a full map of the Elixir stack and what each piece replaces.

If you want someone to look at your project, we do migrations module by module, and we'll tell you if keeping your current frontend is the better call.

Share