View Source mix exinertia.install (exinertia v0.8.2)
Installs Exinertia and updates your project accordingly.
This installer automates the basic steps for integrating Exinertia into a Phoenix project using bun for JavaScript and CSS bundling, removing esbuild/tailwind configs, and adding a simple Inertia setup.
It follows the rough steps:
- Create a Vite manifest reader in your Web app folder.
- Add Inertia and bun to your mix.exs, remove esbuild/tailwind if present, and run deps.get.
- Update config.exs to configure bun.
- Update dev.exs watchers to point to bun and remove esbuild/tailwind watchers.
- Modify your router and add an :inertia pipeline + a test route.
- Modify a controller to render an Inertia page.
- Create an inertia_root.html.heex layout.
- Modify the existing root.html.heex to reference your new Vite manifest for main.js.
- Insert Inertia imports into lib/myapp_web.ex for your controllers/templates.
- Update mix aliases for building/deploying assets with bun.
- Clone the Inertia.js template from nordbeam/exinertia-templates
- Install frontend dependencies with bun
- Configure Tailwind content paths for JavaScript files
Example
mix exinertia.install