-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
astro.config.mjs
93 lines (91 loc) · 2.24 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
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
import { defineConfig } from 'astro/config'
import solid from '@astrojs/solid-js'
import tailwind from '@astrojs/tailwind'
import { i18n, filterSitemapByDefaultLocale } from 'astro-i18n-aut/integration'
import sitemap from '@astrojs/sitemap'
import cloudflare from '@astrojs/cloudflare'
import { defaultLang, languages } from './src/i18n/ui'
import { SITE } from './src/config'
import icon from 'astro-icon'
import mdx from '@astrojs/mdx'
import { VitePWA } from 'vite-plugin-pwa'
import AstroPWA from '@vite-pwa/astro'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import remarkToc from 'remark-toc'
import rehypeSlug from 'rehype-slug'
import compress from 'astro-compress'
const locales = languages
const defaultLocale = defaultLang
const isDev = import.meta.env.DEV;
// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: cloudflare(),
site: SITE.url,
trailingSlash: 'never',
build: {
format: 'file',
inlineStylesheets: 'always'
},
markdown: {
remarkPlugins: [remarkToc],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: 'append'
}
]
]
},
integrations: [
solid(),
tailwind(),
icon({
iconDir: 'src/assets',
include: {
tabler: ['*']
}
}),
i18n({
locales,
defaultLocale,
exclude: [
'pages/offline.astro',
'pages/fr/*',
'pages/es/*',
'pages/en/*',
'pages/api/*'
]
}),
sitemap({
i18n: {
locales,
defaultLocale,
exclude: [
'pages/offline.astro',
'pages/fr/*',
'pages/es/*',
'pages/en/*',
'pages/api/*'
]
},
filter: filterSitemapByDefaultLocale({
defaultLocale
})
}),
mdx(),
compress()
],
// vite: {
// // resolve: {
// // conditions: ["worker", "webworker"],
// // mainFields: ["module"],
// // }
// // define: {
// // 'process.env.PUBLIC_VITE_SUPABASE_URL': JSON.stringify(process.env.PUBLIC_VITE_SUPABASE_URL),
// // 'process.env.PUBLIC_VITE_SUPABASE_ANON_KEY': JSON.stringify(process.env.PUBLIC_VITE_SUPABASE_ANON_KEY),
// // }
// },
})