Skip to content

Fix Vercel deployment config and add DEPLOYMENT.md#235

Merged
hotlong merged 2 commits intomainfrom
copilot/evaluate-vercel-deployment
Feb 10, 2026
Merged

Fix Vercel deployment config and add DEPLOYMENT.md#235
hotlong merged 2 commits intomainfrom
copilot/evaluate-vercel-deployment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 10, 2026

Vercel deployment was misconfigured: docs site (apps/site/out) was not included in the output, and the SPA fallback rewrite swallowed /docs/* paths.

Changes

  • vercel.json: Switch buildCommand to build:vercel, add cleanUrls, fix SPA fallback regex from /((?!api/).*)/((?!api/|docs/).*) so /docs/* serves static files from CDN
  • package.json: Add build:vercel script — runs turbo run build then copies apps/site/outapps/web/dist/docs/ to produce a single combined output directory
  • DEPLOYMENT.md: Documents both deployment modes (self-hosted pnpm start vs Vercel serverless), build outputs, URL routing, env vars, and Vercel limitations (no WebSocket, cold-start, function timeout)
  • README.md: Add "Deploy to Vercel" section, link to deployment guide

dist folder layout

apps/web/dist/          ← Vercel outputDirectory (Vite SPA)
  ├── index.html
  ├── assets/
  └── docs/             ← copied from apps/site/out during build:vercel
apps/site/out/          ← Next.js static export (self-hosted mount)
packages/*/dist/        ← server plugin bundles (tsup)

Routing

Path Self-hosted (pnpm start) Vercel
/api/v1/* Hono routes api/index.ts serverless fn
/console/* Static mount → apps/web/dist N/A (SPA at /)
/docs/* Static mount → apps/site/out CDN → apps/web/dist/docs/
/* SPA fallback → index.html

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectos Error Error Feb 10, 2026 8:48pm

Request Review

- Add build:vercel script that combines apps/web/dist + apps/site/out
- Update vercel.json: use build:vercel, add cleanUrls, fix SPA fallback to exclude /docs/
- Create DEPLOYMENT.md documenting pnpm start, Vercel, and dist folders
- Update README.md with deployment section and link to guide

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Assess project deployment to Vercel using pnpm start Fix Vercel deployment config and add DEPLOYMENT.md Feb 10, 2026
Copilot AI requested a review from hotlong February 10, 2026 20:45
@hotlong hotlong marked this pull request as ready for review February 10, 2026 21:07
Copilot AI review requested due to automatic review settings February 10, 2026 21:07
@hotlong hotlong merged commit 544892a into main Feb 10, 2026
5 of 6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the Vercel deployment configuration so the Vite SPA and exported docs site can be served correctly from a single static output directory, and documents the supported deployment modes for ObjectOS.

Changes:

  • Update vercel.json to use a Vercel-specific build command, enable cleanUrls, and refine SPA fallback rewrites to avoid /docs/*.
  • Add build:vercel to combine apps/site/out into apps/web/dist/docs for a single Vercel outputDirectory.
  • Add DEPLOYMENT.md and update README.md with Vercel deployment guidance.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
vercel.json Switches to build:vercel, enables cleanUrls, adjusts SPA fallback rewrite to exclude docs paths.
package.json Adds build:vercel script to build via Turbo and copy docs output into the SPA dist folder.
README.md Updates production build instructions and links to the new deployment guide + Vercel section.
DEPLOYMENT.md New deployment documentation covering self-hosted vs Vercel architecture, outputs, routing, and limitations.

Comment thread vercel.json
"rewrites": [
{ "source": "/api/v1/(.*)", "destination": "/api" },
{ "source": "/((?!api/).*)", "destination": "/index.html" }
{ "source": "/((?!api/|docs/).*)", "destination": "/index.html" }
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SPA fallback rewrite excludes /docs/… but not the /docs root path (no trailing slash). A request to /docs will match this regex and be rewritten to /index.html, breaking the docs landing page unless the client always includes the trailing slash. Consider updating the negative lookahead to exclude docs with or without a trailing slash (e.g., docs(?:/|$)), or add an explicit rewrite/redirect for /docs/docs/.

Suggested change
{ "source": "/((?!api/|docs/).*)", "destination": "/index.html" }
{ "source": "/((?!api/|docs(?:/|$)).*)", "destination": "/index.html" }

Copilot uses AI. Check for mistakes.
Comment thread package.json
"dev:all": "concurrently -n api,web,site -c blue,green,yellow \"pnpm objectstack:serve\" \"pnpm web:dev\" \"pnpm site:dev\"",
"start": "pnpm objectstack:serve",
"build": "turbo run build",
"build:vercel": "turbo run build && cp -r apps/site/out apps/web/dist/docs",
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build:vercel copies apps/site/out into apps/web/dist/docs without clearing the destination first. If apps/web/dist/docs already exists (e.g., repeated local builds), cp -r will nest the output (ending up with docs/out/...) or leave stale files. Consider removing apps/web/dist/docs before copying, and/or copying the contents of out/ into docs/ to make the script idempotent.

Suggested change
"build:vercel": "turbo run build && cp -r apps/site/out apps/web/dist/docs",
"build:vercel": "turbo run build && rm -rf apps/web/dist/docs && mkdir -p apps/web/dist/docs && cp -r apps/site/out/. apps/web/dist/docs",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants