Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

vite.config.ts

22 lines839 Bytes

1import { defineConfig } from 'vite'
2import { tanstackStart } from '@tanstack/react-start/plugin/vite'
3import viteReact from '@vitejs/plugin-react'
4import tailwindcss from '@tailwindcss/vite'
5import { cloudflare } from '@cloudflare/vite-plugin'
6​
7// Standalone by default (`bun run deploy` → your own workers.dev, app at
8// "/"); the modelschemas Cloudflare environment mounts this example at
9// modelschemas.com/examples/video-composer/ via a zone route — see
10// wrangler.jsonc. Router basepath and server-fn base derive from `base`.
11const hosted = process.env.CLOUDFLARE_ENV === 'modelschemas'
12​
13export default defineConfig({
14 base: hosted ? '/examples/video-composer/' : '/',
15 server: { port: 3203 },
16 plugins: [
17 cloudflare({ viteEnvironment: { name: 'ssr' } }),
18 tailwindcss(),
19 tanstackStart(),
20 viteReact(),
21 ],
22})