-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
64 lines (63 loc) · 2.15 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
import cloudflare from "@astrojs/cloudflare";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import playformCompress from "@playform/compress";
import tailwindcss from "@tailwindcss/vite";
import robotsTxt from "astro-robots-txt";
import { defineConfig, envField, passthroughImageService } from "astro/config";
export default defineConfig({
site: "https://leomercier.blog",
output: "server",
adapter: cloudflare(),
integrations: [playformCompress(), react(), robotsTxt(), sitemap()],
vite: {
// @ts-expect-error: Type error, will be fixed when using integration
plugins: [tailwindcss()],
// NOTE: Remove this after this is fixed: https://github.com/withastro/adapters/pull/436
// Use react-dom/server.edge instead of react-dom/server.browser for React 19.
// Without this, MessageChannel from node:worker_threads needs to be polyfilled.
resolve: {
// @ts-expect-error: only in prod
alias: import.meta.env.PROD && {
"react-dom/server": "react-dom/server.edge",
},
},
},
devToolbar: {
enabled: false,
},
prefetch: {
prefetchAll: true,
defaultStrategy: "viewport",
},
image: {
service: passthroughImageService(),
remotePatterns: [
{
protocol: "https",
},
],
},
markdown: {
shikiConfig: {
theme: "catppuccin-mocha",
},
},
env: {
schema: {
// NOTE: Change access to secret for DB_URL and GITHUB_CLIENT_SECRET if you're not using the cloudflare adapter
MARKDOWN_PATH: envField.string({ context: "server", access: "public" }),
DB_URL: envField.string({ context: "server", access: "public" }),
SESSION_COOKIE: envField.string({ context: "server", access: "public" }),
SESSION_EXPIRY: envField.number({ context: "server", access: "public" }),
GITHUB_CLIENT_ID: envField.string({ context: "server", access: "public" }),
GITHUB_CLIENT_SECRET: envField.string({ context: "server", access: "public" }),
GITHUB_REDIRECT_URI: envField.string({ context: "server", access: "public" }),
},
validateSecrets: true,
},
experimental: {
clientPrerender: true,
svg: true,
},
});