mix vitex.install (Vitex v0.2.4)
View SourceInstalls and configures Phoenix Vite in a Phoenix application using Igniter.
This installer:
- Creates vite.config.js with appropriate configuration
- Updates package.json with Vite dependencies and scripts
- Adds the Vite watcher to the development configuration
- Updates the root layout template to use Vite helpers
- Creates or updates asset files for Vite
Usage
$ mix vitex.install
Options
--ssr Enable Server-Side Rendering support
--tls Enable automatic TLS certificate detection
--react Enable React Fast Refresh support
--typescript Enable TypeScript support
--inertia Enable Inertia.js support (automatically enables React)
--shadcn Enable shadcn/ui component library (requires --typescript and either --react or --inertia)
--base-color Base color for shadcn/ui theme (neutral,gray, zinc, stone, slate) - defaults to neutral
--bun Use Bun as the package manager instead of npm
--yes Don't prompt for confirmations
Package Manager Support
Vitex supports two approaches for package management:
- System Package Managers (npm, pnpm, yarn): Uses whatever is installed on the system
- Elixir-Managed Bun (--bun flag): Uses the Elixir bun package to download and manage the bun executable
The --bun option is special because:
- It adds a Mix dependency for bun
- The bun executable is managed at _build/bun
- It can use Bun workspaces for Phoenix JS dependencies
- Mix tasks handle the bun installation lifecycle