RxAssim
ExInertia - Toolkit for Phoenix + Inertia.js Integration with Bun and Vite
I’m excited to announce ExInertia, a toolkit built on top of Igniter that provides a robust integration between Phoenix and Inertia.js, with first-class support for Routes library and Bun.
Technical Stack:
- Built on Igniter for powerful, composable installer generators
- Full Inertia.js integration with Phoenix using Inertiajs/inertia-phoenix
- Modern asset pipeline using Bun + Vite (replacing esbuild/tailwind)
- Built-in Routes integration for type-safe routing between Phoenix and TypeScript
- Automated manifest handling for Vite assets
Installation:
def deps do
[
{:exinertia, "~> 0.5.0"},
]
end
The installer, powered by Igniter (thanks @zachdaniel ), handles the complete setup:
mix exinertia.install
What gets installed:
- Vite manifest reader in your Web namespace
- Inertia pipeline + configuration in your Router
- Routes integration for type-safe routing
- Modified root layout with Vite asset handling
- Complete Bun + Vite setup replacing esbuild/tailwind
- TypeScript-ready frontend structure with Routes type definitions
- Automated mix aliases for asset building
Development Experience:
- Hot Module Replacement (HMR) with Vite
- TypeScript compilation with Bun
- Type-safe routing between Phoenix and TypeScript using Routes
- Seamless server-side rendering support
- Zero-configuration Tailwind integration
Type-safe routing example with Routes:
// Your routes are automatically typed!
const url = Routes.path('user.show', { id: 123 });
// => "/users/123"
// TypeScript error if you miss required params
const url = Routes.path('user.show'); // Error: missing id parameter
The project is built to be modular - you can use the installers independently or compose them with your own Igniter-based installers.
Resources:
- Documentation: HexDocs
- GitHub:
Contributions and feedback are welcome! We’re particularly interested in hearing about different use cases and integration patterns.
Most Liked
zachdaniel
Looks awesome!
FYI your package can be installed without modifying the mix.exs file by anyone who already is using igniter with mix igniter.install exinertia and that’s the command we recommend to use when running installers as opposed to calling exinertia.install directly ![]()
Great work!
zachdaniel
Awesome! One small note is that mix igniter.install actually works even when igniter is not installed into a project, as long as igniter_new is installed as an archive.
So your instructions could be
# in your project directory
mix archive.install hex igniter_new
mix igniter.install exinertia
And then the user doesn’t have to manually edit even a single file ![]()
RxAssim
Thanks for the feedback! I’ve updated exinertia to make Igniter an optional dependency and modified the README to instruct users to install via mix igniter.install exinertia. This should help ensure Igniter remains a dev/test only dependency as intended.
skyturtle
Thanks for creating this! I’ve been playing around with Inertia.js and Phoenix and have really been enjoying the experience. It was getting old having to go through all the same setup steps. I had a couple of questions:
- Are there any changes you need to make to the Dockerfile that is created by
mix phx.gen.release --docker? I tried to deploy my app to Coolify on a self-hosted VPS. My build keeps failing during the builder stage atRUN mix assets.deploy. Here is what I see in the debug log:
#22 [builder 12/17] COPY assets assets
#22 DONE 0.0s
#23 [builder 13/17] RUN mix assets.deploy
#23 0.771 Compiling 17 files (.ex)
#23 1.753 Generated test_exinertia app
#23 2.003 03:56:23.754 [debug] Downloading bun from https://github.com/oven-sh/bun/releases/download/bun-v1.2.1/bun-linux-x64.zip
#23 4.794 $ ../_build/bun x --bun vite build --minify
#23 4.806 Resolving dependencies
#23 5.309 Resolved, downloaded and extracted [128]
#23 5.371 Saved lockfile
#23 6.361 failed to load config from /app/assets/vite.config.ts
#23 6.361 error during build:
#23 6.361 undefined
#23 6.375 error: script "build" exited with code 1
#23 6.381 ** (Mix) `mix bun build --minify` exited with 1
#23 ERROR: process "/bin/sh -c mix assets.deploy" did not complete successfully: exit code: 1
It looks like the Vite.js config file can’t be found. When I used Svelte in a Phoenix + Inertia.js project, I had to install Node for the build stage to run npm install is the assets directory after it was copied. I wasn’t sure if I need to do something similar here. This is my first time using the Hex Bun package. I thought the Bun wrapper package eliminated the need to install any additional JavaScript tooling, but I might be mistaken.
- I was curious why you created the
PhxManifestReadermodule. When I was trying to setup Vite within a Phoenix project, I noticed other examples had setmanifest: falsein theirvite.config.tsand put theoutputto match theassetsfolder used by Phoenix. Is there an advantage to reading those manifest files in this manner?
Thanks again for creating this toolkit! Everything seems to be working in dev right now. This was also my first time using Igniter and the ExInertia installation experience was sweet.
dmitriid
I read that, too. And that means what exactly? I’ve always been able to build anything on the frontend using anything on the backend ![]()







