Fix production CLOG asset paths and Vite base-path routing #12

Closed
opened 2026-07-30 04:06:32 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-30 04:06:32 +00:00 (Migrated from github.com)

Problem

The production frontend hosting path introduced in PR #3 is inconsistent.

frontend-asset-path resolves frontend/dist/ relative to the quasar-web ASDF system source directory. Because the ASD file lives under systems/, this points at systems/frontend/dist/ instead of the actual repository path frontend/dist/.

The Vite build defaults to base path /, while CLOG attempts to serve the application under /frontend/. Production builds therefore generate asset URLs that do not match the CLOG route. SPA fallback and nested-route handling are also not demonstrated.

Found during review of PR #3.

Required changes

  • Resolve the repository root explicitly and derive frontend/dist/ from it.
  • Choose one production URL contract:
    • serve the application at /; or
    • build and serve consistently at /frontend/.
  • Set VITE_BASE_PATH during production builds when using a non-root route.
  • Serve hashed assets with correct content types and caching.
  • Provide an SPA fallback to index.html for browser routes without swallowing real asset 404s.
  • Ensure 404.html, service worker paths, manifest paths, and PWA scope match the chosen base path.
  • Add a packaged-production smoke test using the generated frontend build and Lisp executable/server.

Acceptance criteria

  • scripts/run-production builds and starts the application from a fresh checkout.
  • The browser loads the React application and all hashed assets from the chosen route.
  • Direct navigation to a nested React route works.
  • Service worker and manifest requests succeed at the correct scope.
  • CI verifies production asset serving rather than only running vite build.

Related PR: #3

## Problem The production frontend hosting path introduced in PR #3 is inconsistent. `frontend-asset-path` resolves `frontend/dist/` relative to the `quasar-web` ASDF system source directory. Because the ASD file lives under `systems/`, this points at `systems/frontend/dist/` instead of the actual repository path `frontend/dist/`. The Vite build defaults to base path `/`, while CLOG attempts to serve the application under `/frontend/`. Production builds therefore generate asset URLs that do not match the CLOG route. SPA fallback and nested-route handling are also not demonstrated. Found during review of PR #3. ## Required changes - Resolve the repository root explicitly and derive `frontend/dist/` from it. - Choose one production URL contract: - serve the application at `/`; or - build and serve consistently at `/frontend/`. - Set `VITE_BASE_PATH` during production builds when using a non-root route. - Serve hashed assets with correct content types and caching. - Provide an SPA fallback to `index.html` for browser routes without swallowing real asset 404s. - Ensure `404.html`, service worker paths, manifest paths, and PWA scope match the chosen base path. - Add a packaged-production smoke test using the generated frontend build and Lisp executable/server. ## Acceptance criteria - `scripts/run-production` builds and starts the application from a fresh checkout. - The browser loads the React application and all hashed assets from the chosen route. - Direct navigation to a nested React route works. - Service worker and manifest requests succeed at the correct scope. - CI verifies production asset serving rather than only running `vite build`. Related PR: #3
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/quasar#12
No description provided.