forked from namesakefyi/namesake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.ts
More file actions
114 lines (113 loc) · 2.71 KB
/
Copy pathastro.config.ts
File metadata and controls
114 lines (113 loc) · 2.71 KB
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
import cloudflare from "@astrojs/cloudflare";
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import sanity from "@sanity/astro";
import {
defineConfig,
fontProviders,
passthroughImageService,
} from "astro/config";
import browserslist from "browserslist";
import { browserslistToTargets } from "lightningcss";
export default defineConfig({
output: "server",
adapter: cloudflare({
imageService: "compile",
}),
image: {
service: passthroughImageService(),
},
site: "https://namesake.fyi",
integrations: [
sitemap(),
mdx(),
sanity({
projectId: "k4p1j15y",
dataset: "production",
useCdn: true,
apiVersion: "2025-09-19",
}),
react(),
],
prefetch: true,
trailingSlash: "never",
build: {
// Eliminate trailing slashes from Cloudflare Pages
// https://creativehike.com/posts/removing-trailng-slashes-astro
format: "file",
},
fonts: [
{
provider: fontProviders.local(),
name: "Atkinson Hyperlegible Soft",
cssVariable: "--font-sans",
fallbacks: ["Helvetica", "Arial", "sans-serif"],
options: {
variants: [
{
weight: 400,
style: "normal",
src: ["./src/fonts/AtkinsonHyperlegibleSoft-Regular.woff2"],
},
{
weight: 400,
style: "italic",
src: ["./src/fonts/AtkinsonHyperlegibleSoft-RegularItalic.woff2"],
},
{
weight: 700,
style: "normal",
src: ["./src/fonts/AtkinsonHyperlegibleSoft-Bold.woff2"],
},
{
weight: 700,
style: "italic",
src: ["./src/fonts/AtkinsonHyperlegibleSoft-BoldItalic.woff2"],
},
],
},
},
],
devToolbar: {
enabled: false,
},
server: {
host: true,
},
vite: {
assetsInclude: ["**/*.wasm"],
ssr: {
external: ["node:buffer", "node:path", "node:fs"],
optimizeDeps: {
exclude: ["astro-portabletext"],
},
},
css: {
transformer: "lightningcss",
lightningcss: {
targets: browserslistToTargets(browserslist("defaults")),
},
},
// Re-enable this after Astro supports Vite v8
// https://github.com/vitejs/vite/issues/21293
// build: {
// cssMinify: "lightningcss",
// },
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (
(id.includes("/src/constants/") &&
!id.includes("/src/constants/forms")) ||
id.includes("/src/utils/")
) {
return "shared";
}
},
},
},
},
},
});