This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
astro.config.mjs
52 lines (49 loc) · 1.58 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from "astro/config";
import svelte from "@astrojs/svelte";
import mdx from "@astrojs/mdx";
import fs from "fs/promises";
import astroExpressiveCode from 'astro-expressive-code'
// TODO(@maxu): Remove these once we have them migrated!
import react from "@astrojs/react";
import preact from "@astrojs/preact";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import {generateIndexPages} from './src/generate-indexes'
import tailwind from '@astrojs/tailwind'
const headingIcon = (node) => {
let e = new HTMLSpanElement();
e.innerText = "🔗 asid";
return [e];
};
// https://astro.build/config
export default defineConfig({
integrations: [astroExpressiveCode(), mdx(), svelte(), preact(), react(), tailwind()],
site: "https://deta.space/",
base: "/",
markdown: {
rehypePlugins: [
rehypeSlug,
[rehypeAutolinkHeadings, { behavior: "wrap", content: headingIcon }]
]
},
experimental: {
viewTransitions: true
},
vite: {
build: {
rollupOptions: {
external:
process.env.PUBLIC_TELETYPE_INSTALLED === "true" ? [] : ["@deta/teletype/src/index"],
output: {
assetFileNames: (assetInfo) => {
let extType = assetInfo.name.split(".").at(1);
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) extType = "img";
return `docs_assets/${extType}/[name]-[hash][extname]`;
},
chunkFileNames: "docs_chunks/[name]-[hash].js",
entryFileNames: "docs_assets/js/[name]-[hash].js"
}
}
}
}
});