// @ts-check import { defineConfig, envField, memoryCache } from 'astro/config'; import node from '@astrojs/node'; // https://astro.build/config export default defineConfig({ // Used for canonical URLs (and the sitemap/RSS once the blog lands). // Note: .env is not loaded into process.env for this file; pass it via the environment. site: process.env.SITE_URL, trailingSlash: 'always', prefetch: { defaultStrategy: 'hover', prefetchAll: true }, // Static pages stay prerendered; the registry pages opt into on-demand rendering. adapter: node({ mode: 'standalone' }), // No page reads query params, so ignore them in cache keys (`?x=random` can't bypass the cache). cache: { provider: memoryCache({ query: { include: [] } }) }, // Bundle runtime deps into the server build so the image needs no node_modules. vite: { ssr: { noExternal: ['marked'] } }, env: { // All `secret` so they are read from the server environment at runtime, never inlined at build. schema: { HARBOR_URL: envField.string({ context: 'server', access: 'secret', optional: true, url: true }), HARBOR_REGISTRY_HOST: envField.string({ context: 'server', access: 'secret', optional: true }), HARBOR_PROJECTS: envField.string({ context: 'server', access: 'secret', optional: true }), HARBOR_USERNAME: envField.string({ context: 'server', access: 'secret', optional: true }), HARBOR_PASSWORD: envField.string({ context: 'server', access: 'secret', optional: true }), }, }, });