Today I extracted and released PetiteViteRails, a small library that integrates Ruby and Vite. I’ve been developing this idea for nine months now, specifically for a site that’s built on Vue and TypeScript. It’s really lightweight.
I am a bit biased, but I’ve found this pretty easy to maintain. PetiteVite largely works via having a shared config (JSON), updating Vite’s config to read a few values, and providing a Rails view helper that links to Vite’s compiled assets.
This philosophy—letting Vite be Vite and Rails be Rails—comes with fewer surprises and allows those familiar with the respective frameworks to work as they’re used to.
I’m aware of at least one piece of prior art — ViteRuby. I’ve used it briefly, but it didn’t meet my needs. They also support other Ruby web frameworks which may be helpful for you.
I consider this to be fairly complete already, but I will be monitoring breaking changes and adding improvements as I think of them.
I hope that PetiteViteRails is helpful for you!