| 1 | import { reactRouter } from "@react-router/dev/vite"; |
| 2 | import { cloudflare } from "@cloudflare/vite-plugin"; |
| 3 | import tailwindcss from "@tailwindcss/vite"; |
| 4 | import { defineConfig } from "vite"; |
| 5 | |
| 6 | export default defineConfig({ |
| 7 | plugins: [ |
| 8 | cloudflare({ viteEnvironment: { name: "ssr" } }), |
| 9 | tailwindcss(), |
| 10 | reactRouter(), |
| 11 | ], |
| 12 | resolve: { |
| 13 | tsconfigPaths: true, |
| 14 | }, |
| 15 | build: { |
| 16 | rolldownOptions: { |
| 17 | output: { |
| 18 | codeSplitting: { |
| 19 | // Icons are shared by nearly every page, a few hundred bytes each: |
| 20 | // one file for all of them, not a request per icon. |
| 21 | groups: [{ name: "icons", test: /[\\/]node_modules[\\/]lucide-react[\\/]/ }], |
| 22 | }, |
| 23 | }, |
| 24 | }, |
| 25 | }, |
| 26 | }); |