import { defineConfig } from "astro/config" import mdx from "@astrojs/mdx" import sitemap from "@astrojs/sitemap" import solidJs from "@astrojs/solid-js" import node from "@astrojs/node" import tailwindcss from "@tailwindcss/vite" // https://astro.build/config export default defineConfig({ site: "https://spaghet.io", integrations: [mdx(), sitemap(), solidJs()], output: "server", adapter: node({ mode: "ssr" }), markdown: { shikiConfig: { // Two themes plus `defaultColor: false` makes Shiki emit every token as a // `--shiki-light` / `--shiki-dark` pair instead of a hard-coded `color:`. // global.css then picks one per mode, so a light-mode reader no longer // gets a dark gray code block (the old `.prose pre { #1f2937 !important }` // hack) and a dark-mode reader no longer gets cream-on-cream. // // Chosen by measuring every bundled theme's token colours against the // site's own `code-bg` surfaces, not by eye: the previous vitesse pair // bottomed out at 1.04:1 (light) and 1.28:1 (dark) — punctuation was // effectively invisible. `light-plus` reaches ~3.5:1 on white and // `everforest-dark` ~5.6:1 on the espresso block, and everforest's warm // red/green/amber palette sits inside the pasta colours rather than // fighting them. themes: { light: "light-plus", dark: "everforest-dark" }, defaultColor: false, }, }, vite: { plugins: [tailwindcss()], optimizeDeps: { // Client-island deps that are not reachable from the SSR entry graph are // discovered mid-session, which makes Vite re-optimize and bump the browserHash. // Every already-served island module then 504s with "Outdated Optimize Dep", // hydration aborts, and the Solid lists on /blog, /projects and /search stay // empty. Pre-declaring them bundles them at startup so the hash never changes // underneath a page. Keep this list in sync with the imports of every // src/components/*.tsx island (solid-js, @lib/utils -> clsx + tailwind-merge, // @lib/search -> fuse.js). include: ["solid-js", "solid-js/web", "clsx", "tailwind-merge", "fuse.js"], }, } })