Preact with Inertia Phoenix
inertia-phoenix offers a great React installer out of box:
mix archive.install hex igniter_new
mix igniter.install inertia --client-framework=react --typescript
Here’s how to turn it into Preact:
npm install preact && npm remove react-dom reacttsconfig.jsonpaths:
"react": ["./node_modules/preact/compat/"],
"react/jsx-runtime": ["./node_modules/preact/jsx-runtime"],
"react-dom": ["./node_modules/preact/compat/"],
"react-dom/*": ["./node_modules/preact/compat/*"]
--alias:react=preact/compatinconfig.exsesbuild flags.
Note: while Inertia.js doesn’t provide a dedicated Preact client, the regular React client works well under Preact’s compatibility mode.