File
Blob: vite.config.ts
| 1 | import { cloudflare } from "@cloudflare/vite-plugin"; |
| 2 | import babel from "@rolldown/plugin-babel"; |
| 3 | import tailwindcss from "@tailwindcss/vite"; |
| 4 | import react, { reactCompilerPreset } from "@vitejs/plugin-react"; |
| 5 | import { resolve } from "node:path"; |
| 6 | import { defineConfig } from "vite"; |
| 7 | |
| 8 | const persistStatePath = process.env.ANVIL_PERSIST_STATE_PATH; |
| 9 | |
| 10 | export default defineConfig({ |
| 11 | plugins: [ |
| 12 | react(), |
| 13 | babel({ presets: [reactCompilerPreset()] }), |
| 14 | tailwindcss(), |
| 15 | cloudflare( |
| 16 | persistStatePath |
| 17 | ? { |
| 18 | persistState: { |
| 19 | path: persistStatePath, |
| 20 | }, |
| 21 | } |
| 22 | : undefined, |
| 23 | ), |
| 24 | ], |
| 25 | resolve: { |
| 26 | alias: { |
| 27 | "@": resolve(import.meta.dirname, "src"), |
| 28 | }, |
| 29 | }, |
| 30 | }); |