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
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
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
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
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
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Most Liked- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
I just published 0.4.0. The major themes of the updates have been
phoenix_live_reloads:notifyfeatureJskalc
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.