-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
61 lines (57 loc) · 1.62 KB
/
astro.config.ts
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
import { defineConfig } from "astro/config";
import { loadEnv } from "vite";
import mdx from "@astrojs/mdx";
import partytown from "@astrojs/partytown";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import playformCompress from "@playform/compress";
import tailwindcss from "@tailwindcss/vite";
import remarkPrependUrl from "remark-prepend-url";
import { schema } from "./env.ts";
import { gitCommitRemarkPlugin } from "./src/lib/blog/gitCommitRemarkPlugin.ts";
const { SITE } = loadEnv(process.env.NODE_ENV!, process.cwd(), "");
export default defineConfig({
site: SITE ?? "http://localhost:3000",
output: "static",
integrations: [
mdx(),
partytown({
config: {
forward: ["dataLayer.push"],
},
}),
sitemap({
filter: (page) => {
return !page.includes("/thoughts/_");
},
}),
playformCompress({
Logger: 1,
}),
react(),
],
server: {
port: 3000,
},
prefetch: {
prefetchAll: true,
defaultStrategy: "viewport",
},
markdown: {
syntaxHighlight: "prism",
remarkPlugins: [
// @ts-ignore: incorrectly typed in @astrojs/markdown-remark
gitCommitRemarkPlugin,
[remarkPrependUrl, new URL(SITE ?? "http://localhost:3000")],
],
},
redirects: {
"/work": "/resume",
"/t/[id]": "/thoughts/[id]",
},
env: { schema },
vite: {
// @ts-ignore: incorrectly typed in @tailwindcss/vite
plugins: [tailwindcss()],
},
});