-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathastro.config.ts
117 lines (108 loc) · 2.26 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import ChildProcess from 'node:child_process'
import { promisify } from 'node:util'
import db from '@astrojs/db'
import mdx from '@astrojs/mdx'
import netlify from '@astrojs/netlify'
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 icon from 'astro-icon'
import { defineConfig } from 'astro/config'
import {
rehypePlugins,
shikiConfig,
} from './config/plugins'
import { schema } from './env.schema'
const execAsync = promisify(ChildProcess.exec)
async function generateGitData() {
return (await execAsync('git rev-parse HEAD')).stdout
}
const res = JSON.stringify(await generateGitData())
/**
* https://astro.build/config
*/
export default defineConfig({
site: 'https://antzhu.com/',
prefetch: true,
integrations: [
db(),
mdx(),
sitemap(),
react(),
icon({
include: {
'lucide': [
'asterisk',
'arrow-up-left',
'arrow-up-right',
'align-left',
'hash',
'rss',
],
'simple-icons': ['github', 'x', 'bluesky', 'notion', 'gmail'],
},
}),
partytown({
config: {
forward: ['dataLayer.push'],
},
}),
playformCompress({
HTML: true,
Image: true,
JavaScript: true,
SVG: true,
Action: {
// https://github.com/PlayForm/Compress/issues/376
Passed: async () => true,
},
}),
],
markdown: {
shikiConfig,
rehypePlugins,
},
image: {
remotePatterns: [{
protocol: 'https',
}],
},
experimental: {
contentIntellisense: true,
responsiveImages: true,
svg: true,
},
devToolbar: {
enabled: false,
},
vite: {
server: {
allowedHosts: true,
},
optimizeDeps: {
include: ['lucide-react'],
},
plugins: [
{
name: 'vite-plugin-git-revision-info',
config() {
return {
define: {
PUBLIC_GIT_REVISION_INFO: res,
},
}
},
},
tailwindcss(),
],
},
env: {
schema,
validateSecrets: false,
},
adapter: netlify({
cacheOnDemandPages: false,
}),
})