37 lines
1.7 KiB
JavaScript
37 lines
1.7 KiB
JavaScript
import { defineConfig } from 'astro/config';
|
|
|
|
// Static output (zero runtime) — the whole point of the git-based approach.
|
|
export default defineConfig({
|
|
output: 'static',
|
|
// Placeholder domain until the real one exists — only used to build absolute
|
|
// URLs (canonical, og:*, RSS, sitemap). Swap once the portal has a home.
|
|
site: 'https://portal.ctao.org',
|
|
// Built-in prefetch on every internal link (no per-link attributes needed).
|
|
// Default 'hover' strategy: near-instant navigation without the bandwidth
|
|
// cost of 'viewport' on a 24-card grid; auto-falls back to 'tap' on
|
|
// data-saver / slow connections (Astro handles that).
|
|
prefetch: { prefetchAll: true },
|
|
server: { port: 4321, host: true },
|
|
vite: {
|
|
build: {
|
|
// Lightning CSS (the default minifier) illegally folds animation-timeline
|
|
// INTO the `animation` shorthand (`animation: ... view()`), which browsers
|
|
// reject — silently killing every scroll-driven effect in production.
|
|
// esbuild minifies without property merging.
|
|
cssMinify: 'esbuild',
|
|
},
|
|
server: {
|
|
// Vite blocks unknown Host headers by default; the demo is viewed through an
|
|
// ephemeral cloudflared quick tunnel, so allow any *.trycloudflare.com host.
|
|
allowedHosts: ['.trycloudflare.com'],
|
|
// Same-origin path for the Sveltia/Decap local backend proxy (default port
|
|
// moved to 8082 to avoid colliding with Metro on 8081). Proxying it here
|
|
// means the CMS admin talks to one origin, so editing also works through the
|
|
// cloudflared tunnel from the phone.
|
|
proxy: {
|
|
'/api/v1': { target: 'http://localhost:8082', changeOrigin: true },
|
|
},
|
|
},
|
|
},
|
|
});
|