-
Notifications
You must be signed in to change notification settings - Fork 156
/
astro.config.mjs
61 lines (59 loc) · 1.56 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
import db from '@astrojs/db';
import mdx from '@astrojs/mdx';
import netlify from '@astrojs/netlify';
import sitemap from '@astrojs/sitemap';
import solid from '@astrojs/solid-js';
import tailwind from '@astrojs/tailwind';
import webVitals from '@astrojs/web-vitals';
import astroExpressiveCode from 'astro-expressive-code';
import { defineConfig } from 'astro/config';
import houston from './houston.theme.json';
/* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */
const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL;
// https://astro.build/config
export default defineConfig({
site: NETLIFY_PREVIEW_SITE || 'https://astro.build',
prefetch: true,
integrations: [
tailwind({
applyBaseStyles: false,
}),
solid(),
astroExpressiveCode({
themes: [houston],
frames: false,
}),
mdx(),
sitemap(),
/**
* Only add Astro DB and Web Vitals integrations for `astro dev`, CI builds,
* or when an explicit `WITH_DB` variable is set.
*/
{
name: 'conditional-web-vitals',
hooks: {
'astro:config:setup'({ command, updateConfig }) {
if (command === 'dev' || process.env.CI || process.env.WITH_DB) {
updateConfig({
integrations: [...db(), webVitals()],
});
}
},
},
},
],
image: {
domains: ['v1.screenshot.11ty.dev', 'storage.googleapis.com'],
},
vite: {
ssr: {
noExternal: ['smartypants'],
},
},
output: 'hybrid',
adapter: netlify({ imageCDN: false }),
experimental: {
contentIntellisense: true,
contentLayer: true,
},
});