| 1 | # Cloudflare Website: Vite |
| 2 | |
| 3 | Deploys a [Vite](https://vite.dev) React SPA to Cloudflare Workers with |
| 4 | `Cloudflare.Website.Vite` — no `main` entry, build command, or Wrangler |
| 5 | configuration. Alchemy runs Vite with the project's own |
| 6 | `vite.config.ts`, merging its Cloudflare integration on top, and serves |
| 7 | the client assets from a Worker. The page renders entirely in the |
| 8 | browser. |
| 9 | |
| 10 | - `src/main.tsx` mounts the React app into `index.html`. |
| 11 | - Tailwind CSS v4 is wired through `@tailwindcss/vite` in the project's |
| 12 | own `vite.config.ts`, which Alchemy loads natively — plugins included. |
| 13 | |
| 14 | ## Deploy |
| 15 | |
| 16 | ```sh |
| 17 | bun install |
| 18 | bun run deploy |
| 19 | ``` |
| 20 | |
| 21 | Unchanged sources skip the Vite build entirely on subsequent deploys — |
| 22 | the input files are content-hashed (scoped by `memo.include`). |
| 23 | |
| 24 | ## Local development |
| 25 | |
| 26 | ```sh |
| 27 | bun run dev |
| 28 | ``` |
| 29 | |
| 30 | `alchemy dev` runs Vite's own dev server (HMR included) behind Alchemy's |
| 31 | local proxy. |
| 32 | |
| 33 | ## Destroy |
| 34 | |
| 35 | ```sh |
| 36 | bun run destroy |
| 37 | ``` |