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.
12 lines
494 B
TypeScript
12 lines
494 B
TypeScript
#!/usr/bin/env bun
|
|
// `bun run build [--mode dev]`: typecheck, client build (Cloudflare Build Output), SSR build, then prerender.
|
|
import { parseArgs } from "node:util"
|
|
import { $ } from "bun"
|
|
|
|
const { values } = parseArgs({ options: { mode: { type: "string", default: "production" } } })
|
|
const mode = values.mode
|
|
|
|
await $`tsc -b`
|
|
await $`vite build --mode ${mode}`
|
|
await $`vite build --mode ${mode} --ssr src/prerender.tsx --outDir dist-server`
|
|
await $`bun scripts/prerender.ts --mode ${mode}`
|