// @ts-check import { defineConfig } from "astro/config"; import mdx from "@astrojs/mdx"; import sitemap from "@astrojs/sitemap"; import { site } from "./src/site.config.ts"; // Static output only: everything must run on a free static host. export default defineConfig({ site: site.url, output: "static", trailingSlash: "always", integrations: [mdx(), sitemap()], // Inline the (small) CSS into each page: removes render-blocking requests, which matters most // on slow phone connections. About 5 KB gzipped per page. build: { inlineStylesheets: "always" }, vite: { build: { rolldownOptions: { onwarn(warning, warn) { // Astro's own content plugin adds a "use astro:head-inject" directive to every MDX // article on purpose; the bundler flags it as a generic directive. Harmless, so hide // exactly that one warning and let everything else through. if ( warning.code === "MODULE_LEVEL_DIRECTIVE" && warning.message.includes("astro:head-inject") ) return; warn(warning); }, }, }, }, });