Skip to content
File

Blob: vite.config.ts

typescript31 lines
1import { cloudflare } from "@cloudflare/vite-plugin";
2import babel from "@rolldown/plugin-babel";
3import tailwindcss from "@tailwindcss/vite";
4import react, { reactCompilerPreset } from "@vitejs/plugin-react";
5import { resolve } from "node:path";
6import { defineConfig } from "vite";
7 
8const persistStatePath = process.env.ANVIL_PERSIST_STATE_PATH;
9 
10export 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});