-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.config.mjs
54 lines (53 loc) · 1.55 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
53
54
import Sitemap from '@astrojs/sitemap'
import AstroPWA from '@vite-pwa/astro'
import { defineConfig } from 'astro/config'
import UnoCSS from 'unocss/astro'
import ViteRestart from 'vite-plugin-restart'
import { rehypePlugins, remarkPlugins } from './src/lib/markdown'
import injectAfterHeadEl from './src/lib/server/injectAfterHeadEl'
import injectBeforeHeadEl from './src/lib/server/injectBeforeHeadEl'
import vitePWAOptions from './src/lib/server/pwa'
import Meta from './src/meta'
export default defineConfig({
site: Meta.site,
build: {
/**
* I turn on:
* - netlify `pretty_urls`
* - vercel `cleanUrls`
* If not. Plz using default and move file src/pages/posts.astro - src/pages/posts/index.astro
*/
format: 'preserve',
},
integrations: [
UnoCSS({ injectReset: true }),
AstroPWA(vitePWAOptions),
Sitemap(),
injectBeforeHeadEl(),
injectAfterHeadEl(),
],
vite: {
build: { cssCodeSplit: false },
plugins: [ViteRestart({
reload: [],
restart: [
'./src/main.ts',
'./src/lib/markdown/**/*.ts',
'./src/lib/client/head/**/*.ts',
],
})],
optimizeDeps: { exclude: ['@resvg/resvg-js'] },
},
prefetch: {
defaultStrategy: 'viewport',
prefetchAll: true,
},
markdown: {
shikiConfig: {
theme: 'vitesse-dark',
wrap: true,
},
remarkPlugins,
rehypePlugins,
},
})