LostKobrakai
I’ve recently created a small library phoenix_vite integrating the vite build tooling with phoenix.
It
- provides an igniter.installer to install all the necessary files
- creates elixir and js boilerplate
- configures phoenix LV static file tracking with the manifest vite generates
- uses phoenix
static_urlconfiguration to handle all static assets via the vite dev server - moves static assets from
priv/statictoassets/public
- provides a heex function component to pull in js/css from
- vite dev server in development
- the vite manifest in prod
- can optionally pull in
:bunto run without a locally installed nodejs, just like phoenix does by default
When used with :bun this should provide a setup that’s as “working out of the box” as the default phoenix boilerplate, but including package managing as well as an very flexible and extensible build system.
The installer could likely use a bit more work around the failure cases, but it works for fresh phoenix 1.7/1.8 projects.
You can install the package by adding it to your mix.exs and running
mix phoenix_vite.install [--bun]
or all in one using
mix igniter.install phoenix_vite [--bun]
or from scratch
mix igniter.new my_app --with phx.new --install phoenix_vite [--bun]
Trending in Announcing
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
I’ve moved the strategies out of PowAssent and created a multi-provider framework for Elixir. This way the strategies can be used in any ...
New
Aloha gang,
There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here:
...
New
I needed something like premailer for rails, and after searching, I decided to make an easy-to-use library to handle inline styles and co...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
With advancements in AI gathering pace and set to increasingly accelerate, perhaps it’s worth having an annual thread on the topic - feel...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #elixirconf-us
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Jskalc
Thank you for this @LostKobrakai!
LiveVue relies heavily on Vite, but installation instructions are long and discourage trying it out (even 3min setup is too much for many
).
I started working on Igniter installer but didn’t had the time to finish. Your library seems like a solid foundation to build upon. I will give it a shot later this week and hopefully I could include phoenix_vite in the next version!
Two questions:
might create a separate chunk. Then, code of that chunk will try to import shared parts from
app.ts, because these chunks doesn’t know about phoenix manifest. So we’ll end up with twoapp.tsfiles loaded, one hashed by phoenix and one not.My solution was not to use phoenix manifest file, instead use vite hashing. It was also important when generating
preloaddirectives for SSR, since when doing SSR with Vite it’s using chunk names from vite manifest.I’m pretty sure some interoperability can be reached between these two manifests - adjusting one manifest to use file names from the other one. But it felt like a rabbit hole at a time.
LostKobrakai
This does the same. The vite manifest is the source of truth and is used to provide information to phoenix.
phx.digestis not used.ravecat
@LostKobrakai thanks for the great work! thanks to your project, I will finally be able to transfer Phoenix + Inertia projects to vite. I’ll leave an example in repository for the future. SSR is still a work in progress, but I’m quite happy with the current result
te_chris
Interesting. I ended up DIYing alongside our over-eager AI friends. Works really well and, with inertia, means we can rapidly vibe code our admin.
LostKobrakai
I just published 0.4.0. The major themes of the updates have been
phoenix_live_reloads:notifyfeatureostap
Added prefetching and nonce
Thanks for reviewing LostKobrakai
DaAnalyst
Does it support umbrellas?