-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathastro.config.mjs
More file actions
64 lines (62 loc) · 1.5 KB
/
Copy pathastro.config.mjs
File metadata and controls
64 lines (62 loc) · 1.5 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
// @ts-check
import { unified } from "@astrojs/markdown-remark";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig, svgoOptimizer } from "astro/config";
import astroInference from "astro-inference";
import pagefind from "astro-pagefind";
import { ViteImageOptimizer } from "vite-plugin-image-optimizer";
import baseConfig from "./astro.base.config.mjs";
import { rehypeCodeCopy } from "./src/lib/rehype-code-copy.mjs";
import { remarkReadingTime } from "./src/lib/remark-reading-time.mjs";
const markdownProcessor = () =>
unified({
remarkPlugins: [remarkReadingTime],
rehypePlugins: [rehypeCodeCopy],
});
// https://astro.build/config
export default defineConfig({
site: "https://fastify.dev",
base: baseConfig.base,
outDir: "./build",
experimental: {
svgOptimizer: svgoOptimizer({ multipass: true }),
},
markdown: {
shikiConfig: {
themes: {
light: "github-light",
dark: "github-dark",
},
defaultColor: "dark",
},
processor: markdownProcessor(),
},
integrations: [
mdx({
shikiConfig: {
themes: {
light: "github-light",
dark: "github-dark",
},
defaultColor: "dark",
},
processor: markdownProcessor(),
}),
sitemap(),
pagefind(),
astroInference({
exclude: ["resources/**", "benchmarks/**", "organizations/**"],
}),
],
vite: {
plugins: [
tailwindcss(),
ViteImageOptimizer({
includePublic: true,
svg: { multipass: true },
}),
],
},
});