-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathastro.config.mjs
More file actions
59 lines (57 loc) · 1.6 KB
/
astro.config.mjs
File metadata and controls
59 lines (57 loc) · 1.6 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
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import react from '@astrojs/react';
import mdx from '@astrojs/mdx';
import node from '@astrojs/node';
import sitemap from '@astrojs/sitemap';
// Get site URL from environment variable or default to localhost for development
const SITE_URL = process.env.SITE_URL || 'http://localhost:4321';
// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: node({
mode: 'standalone',
}),
site: SITE_URL,
server: {
headers: {
// These global headers supplement the ones in Layout.astro
'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload',
'X-Content-Type-Options': 'nosniff',
'X-XSS-Protection': '1; mode=block',
'X-Frame-Options': 'SAMEORIGIN',
'Referrer-Policy': 'strict-origin-when-cross-origin',
'Permissions-Policy': 'accelerometer=(), camera=(), geolocation=(), microphone=()',
}
},
// Image optimization
image: {
service: {
entrypoint: 'astro/assets/services/sharp',
config: {
// Use next-gen formats
formats: ['avif', 'webp', 'png', 'jpg'],
// Image quality optimization
quality: 80,
// Cache optimized images
cacheDir: './.astro/image-cache',
}
},
},
integrations: [
tailwind(),
react(),
mdx(),
sitemap({
filter: (page) => !page.includes('/admin'),
changefreq: 'weekly',
lastmod: new Date(),
serialize(item) {
return {
...item,
priority: 0.7,
};
},
}),
],
});