fix CI SPA prerender build
Some checks failed
CI / Typecheck, test & build (push) Failing after 2m3s
CI / Deploy to Cloudflare Workers (push) Has been skipped

This commit is contained in:
2026-08-31 01:22:01 +08:00
parent a0d0bd8b08
commit 848de4e309
5 changed files with 265 additions and 419 deletions

View File

@ -43,7 +43,7 @@ progress, so upload UIs stay indeterminate.
The app is a client-rendered SPA served as static assets by a Cloudflare Worker
(`wrangler.jsonc`, `not_found_handling: single-page-application`). The build
emits `_shell.html`, which is copied to `index.html` so Cloudflare's SPA
emits `dist/client/_shell.html`, which is copied to `index.html` so Cloudflare's SPA
fallback returns it for every client route.
**Manual deploy** (needs `wrangler login` or `CLOUDFLARE_API_TOKEN` /

View File

@ -13,14 +13,14 @@
"test": "vitest run",
"gen:api": "node scripts/gen-api.mjs",
"typecheck": "tsc --noEmit",
"cf:build": "vite build && node -e \"require('fs').copyFileSync('.output/public/_shell.html','.output/public/index.html')\"",
"cf:build": "vite build && node -e \"require('fs').copyFileSync('dist/client/_shell.html','dist/client/index.html')\"",
"cf:deploy": "pnpm cf:build && wrangler deploy"
},
"dependencies": {
"@hookform/resolvers": "^5.4.0",
"@tailwindcss/vite": "^4.1.18",
"@tanstack/react-devtools": "latest",
"@tanstack/react-query": "^5.101.2",
"@tanstack/react-query": "^5.102.8",
"@tanstack/react-router": "latest",
"@tanstack/react-router-devtools": "latest",
"@tanstack/react-router-ssr-query": "latest",
@ -33,7 +33,6 @@
"i18next": "^26.3.4",
"lucide-react": "^0.545.0",
"next-themes": "^0.4.6",
"nitro": "npm:nitro-nightly@latest",
"radix-ui": "^1.6.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",

673
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,6 @@ import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { nitro } from 'nitro/vite'
// SPA mode: auth is Bearer-token client-side (localStorage), so route guards
// and data fetching must not run during SSR.
@ -14,7 +13,6 @@ const config = defineConfig({
plugins: [
devtools(),
tanstackStart({ spa: { enabled: true } }),
nitro({ rollupConfig: { external: [/^@sentry\//] } }),
tailwindcss(),
viteReact(),
],

View File

@ -8,7 +8,7 @@
// `pnpm cf:build` copies the TanStack Start shell to index.html, which
// `single-page-application` handling serves for any non-asset request.
"assets": {
"directory": ".output/public",
"directory": "dist/client",
"not_found_handling": "single-page-application"
},
"observability": {