Open krzykamil opened 5 months ago
I'm in the same boat. We'll start building a Hanami 2.1 app next month and another one in September. Our front-end devs want to use Vite for convenience, familiarity, and because Hanami's default setup is lacking features (HMR being the most important one).
I was also wondering if vite_hanami could just build on esbuild since hanami-assets is using it. I'm not sure if that makes sense, though.
Since hanami-assets is just a gem that is optional, you can just start your project without it, and add vite separately, this will however include doing your own asset helpers for the views and all.
Right now all solutions I saw were kinda workarounds, maybe not really suitable for real production projects, but if someone comes up with something I'll gladly help. However now, the problem I've outlined in the linked discussion is making most solutions pointless due to how strongly hanami-assets is connected to esbuild.
Making a sensible vite integration would probably require changes to hanami lib itself
Yeah, we can't have workarounds. I don't mind creating a PR. I've done it before with lucky_vite, so it's not new to me. But I'll need to look at both ends (Hanami and vite_ruby) to see how it all fits together while staying as close as possible to Hanami's API.
Discussed in https://github.com/ElMassimo/vite_ruby/discussions/445