Files
iknowyou/front/astro.config.mjs
2026-04-11 20:43:30 +02:00

57 lines
1.4 KiB
JavaScript

// @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": {
target: "http://localhost:8080",
timeout: 120000,
proxyTimeout: 120000,
},
},
},
},
integrations: [svelte()],
markdown: {
remarkPlugins: [remarkGithubBlockquoteAlert],
shikiConfig: {
theme: "github-dark",
transformers: [
{
name: "code-block-meta",
pre(node) {
node.properties["data-lang"] = this.options.lang || "text";
},
},
],
},
},
});