mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
One site/cloudflare.config.ts defines the production Worker hex (anoma.ly/hex, bucket hex-production-files) and the dev Worker hex-dev (dev.anoma.ly/hex, bucket hex-dev-files), deployed only from CI with cf deploy --prebuilt --mode. The Worker serves the site and the release bucket; apps, scripts, the release workflow, and docs use https://anoma.ly/hex/files. Staging releases publish to the dev bucket; stable releases deploy the production site.
11 lines
505 B
TypeScript
11 lines
505 B
TypeScript
import { cloudflare } from "@cloudflare/vite-plugin"
|
|
import react from "@vitejs/plugin-react"
|
|
import { defineConfig } from "vite"
|
|
import { BASE_PATH } from "./src/base.ts"
|
|
|
|
// The Cloudflare plugin only shapes the client build into Build Output for `cf deploy`.
|
|
// Dev stays plain Vite, and the SSR build only feeds the prerender.
|
|
export default defineConfig(({ command, isSsrBuild }) => ({
|
|
plugins: [react(), ...(command === "build" && !isSsrBuild ? [cloudflare()] : [])],
|
|
base: `${BASE_PATH}/`,
|
|
}))
|