// @ts-check import { defineConfig } from "astro/config"; import tailwindcss from "@tailwindcss/vite"; import svelte from "@astrojs/svelte"; import remarkGithubBlockquoteAlert from "remark-github-blockquote-alert"; import { EventEmitter } from "events"; EventEmitter.defaultMaxListeners = 25; // https://astro.build/config export default defineConfig({ site: "https://iky.hadi.icu", output: "static", vite: { resolve: { noExternal: ["@lucide/svelte"], }, plugins: [ tailwindcss(), { name: "shell-rewrite", configureServer(server) { server.middlewares.use((req, _res, next) => { if (/^\/tools\/[^/]+\/?(\?.*)?$/.test(req.url)) req.url = "/tools/_"; if (/^\/search\/[^/]+\/?(\?.*)?$/.test(req.url)) req.url = "/search/_"; next(); }); }, }, ], server: { proxy: { "/api": "http://localhost:8080", }, }, }, integrations: [svelte()], markdown: { remarkPlugins: [remarkGithubBlockquoteAlert], shikiConfig: { theme: "github-dark", transformers: [ { name: "code-block-meta", pre(node) { node.properties["data-lang"] = this.options.lang || "text"; }, }, ], }, }, });