vestige/apps/dashboard/svelte.config.js
Sam Valladares 79b1026a65 ci(pages): deploy dashboard to GitHub Pages with subpath-aware base
The github-pages deployment showed a red X: actions/configure-pages@v5
ran with enablement:true, but Pages was never enabled in repo settings and
the default GITHUB_TOKEN cannot create a Pages site, so deploy failed with
"Resource not accessible by integration". The launch-kit revert then deleted
the workflow entirely, leaving nothing to deploy.

- Restore a modernized pages.yml (Pages now enabled via API, so no
  enablement hack; actions/checkout@v5 + Node 24 off the deprecated Node 20).
- Make the dashboard base path env-driven (VESTIGE_BASE_PATH), defaulting to
  /dashboard for local/embedded use and overridden to /vestige in CI so
  assets resolve at the Pages project subpath instead of 404ing.
- Workflow builds the dashboard under /vestige and writes a root-level
  redirect index.html so the bare Pages URL lands on the dashboard.
- Rebuild the committed dashboard artifact (was stale at 2.1.23) to 2.1.27.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 17:46:43 -05:00

37 lines
973 B
JavaScript

import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
const appVersion = process.env.VESTIGE_DASHBOARD_VERSION ?? process.env.npm_package_version ?? 'dev';
// Base path the app is served from. Defaults to '/dashboard' for local dev and
// the embedded release binary. CI overrides it (e.g. '/vestige') so assets
// resolve correctly when published to a GitHub Pages project subpath.
const basePath = process.env.VESTIGE_BASE_PATH ?? '/dashboard';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: 'index.html',
precompress: true,
strict: false
}),
paths: {
base: basePath
},
version: {
name: appVersion
},
alias: {
$lib: 'src/lib',
$components: 'src/lib/components',
$stores: 'src/lib/stores',
$types: 'src/lib/types'
}
}
};
export default config;