Skip to content

refactor: update build process and integrate vite-react-ssg for stati… - #85

Merged
devaraj3 merged 1 commit into
mainfrom
feature/landing-page-performance
Jul 26, 2026
Merged

refactor: update build process and integrate vite-react-ssg for stati…#85
devaraj3 merged 1 commit into
mainfrom
feature/landing-page-performance

Conversation

@devaraj3

Copy link
Copy Markdown
Owner

What changed

  • Added vite-react-ssg@0.7.0 (pinned exact version — Vite 6+ versions of this package are incompatible with our Vite 5 setup)
  • Changed build script to vite-react-ssg build (dev script unchanged, still plain vite)
  • Rewrote src/main.tsx to use vite-react-ssg's route-array API: / renders Landing directly (server-rendered), /viewer wraps App in <ClientOnly> so the WebGL viewer stays 100% client-side and untouched, * keeps the existing NotFound
  • Added a <Head> block to src/pages/Landing.tsx with a real per-page <title>, meta description, and canonical link
  • Removed the now-duplicate static <title>/description/canonical from index.html (OG/Twitter tags and JSON-LD stay, since those are shared across routes)

Why

  • The live landing page was previously an empty shell to any crawler that doesn't execute JavaScript — search engines and AI crawlers saw no content at all
  • After this change, dist/index.html contains the actual headline, feature list, and supported-formats text as real HTML, not just an empty <div id="root">
  • The CAD viewer itself is completely unchanged — it's explicitly excluded from server-rendering since it depends on WebGL, which can't run outside a browser

Validation

  • npm run lint
  • npm run typecheck
  • npm run build (confirmed dist/index.html contains real rendered marketing copy, dist/viewer.html correctly stays client-only/empty)
  • npm run preview — tested locally: landing page loads normally, direct visit to /viewer (not just in-app navigation) loads correctly, uploaded a test CAD file and confirmed orbit/measure still work

Notes

  • Build now outputs two HTML files (index.html and viewer.html) instead of one shared shell — if the live /viewer route doesn't load correctly after this deploys, it likely needs a small server routing rule (.htaccess) on Hostinger to map /viewer to viewer.html; flagging in case it comes up post-merge
  • No visual or functional changes to the CAD viewer app itself

…c site generation

- Changed build script in package.json to use vite-react-ssg for static site generation.
- Updated main.tsx to define routes using vite-react-ssg and replaced ReactDOM rendering with ViteReactSSG.
- Enhanced Landing component with SEO improvements using Head from vite-react-ssg and refactored layout for better structure.
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cad-viewer Ready Ready Preview, Comment Jul 26, 2026 6:10am

@devaraj3
devaraj3 merged commit 50d0be4 into main Jul 26, 2026
6 checks passed
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.

1 participant