blog/astro.config.mjs

52 lines
1.1 KiB
JavaScript
Raw Normal View History

import { defineConfig, envField } from "astro/config";
2025-04-11 21:50:48 +08:00
import solidJs from "@astrojs/solid-js";
import mdx from "@astrojs/mdx";
import icon from "astro-icon";
import paths from "node:path";
2025-04-11 21:50:48 +08:00
import rehypeBuckTable from "~/support/rehype-buck-tables";
// https://astro.build/config
export default defineConfig({
env: {
schema: {
VISIBLE_DRAFT: envField.boolean({
context: "server",
access: "public",
default: false,
}),
},
},
integrations: [
solidJs(),
mdx(),
icon(),
{
name: "inject-cloudflare-headers",
hooks: {
"astro:config:setup": ({ injectRoute }) => {
injectRoute({
pattern: "/_headers",
entrypoint: "./src/pages/_headers.ts",
});
},
},
},
2025-04-11 21:50:48 +08:00
],
markdown: {
rehypePlugins: [rehypeBuckTable],
shikiConfig: {
themes: {
light: "github-light",
dark: "github-dark",
},
},
2025-04-11 21:50:48 +08:00
},
vite: {
resolve: {
alias: {
"~": paths.resolve(import.meta.dir, "src"),
},
},
},
2025-04-11 21:50:48 +08:00
});