Vite + Preact + Hono!

The Preact element is injected below 👇

View on GitHub
Context and backstory

This project is based upon this recipe in the Hono documentation:
https://hono.dev/docs/recipes/vite

This recipe supports compiling client side scripts with Vite along with the Hono server application. However, if you try to use Preact (or React) on the client side, you'll find that the client side scripts are compiled with Vite but do not function.

This is because Hono's JSX implementation supercedes Preact's JSX implementation.

The trick here is to use two configs for Vite. One for the client and one for the server.

The mode property in the Vite config is used to determine which config to use.

The mode property is set to client in the `package.json` sccript:

"dev:client": "vite --mode client",