-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
72 lines (69 loc) · 1.65 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
import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
import sitemap from '@astrojs/sitemap';
import react from '@astrojs/react';
import sanity from '@sanity/astro';
import autoprefixer from 'autoprefixer';
import postcssNested from 'postcss-nested';
import postcssMediaMinMax from 'postcss-media-minmax';
import cssnano from 'cssnano';
import { loadEnv } from 'vite';
// Loading environment variables from .env files
// https://docs.astro.build/en/guides/configuring-astro/#environment-variables
const { PUBLIC_SANITY_STUDIO_PROJECT_ID, PUBLIC_SANITY_STUDIO_DATASET } = loadEnv(
import.meta.env.MODE,
process.cwd(),
'',
);
import { defineConfig } from 'astro/config';
const projectId = PUBLIC_SANITY_STUDIO_PROJECT_ID;
const dataset = PUBLIC_SANITY_STUDIO_DATASET;
// https://astro.build/config
export default defineConfig({
site: process.env.PUBLIC_BASE_URL,
output: 'hybrid',
vite: {
ssr: {
external: [
'node:buffer',
'node:path',
'node:fs',
'node:os',
'node:crypto',
'node:async_hooks',
],
},
css: {
postcss: {
plugins: [
autoprefixer({ flexbox: 'no-2009' }),
postcssNested(),
postcssMediaMinMax(),
cssnano(),
],
},
},
},
prefetch: {
defaultStrategy: 'viewport',
},
adapter: cloudflare({
imageService: 'passthrough',
platformProxy: {
enabled: true,
},
}),
integrations: [
react(),
sitemap(),
sanity({
projectId,
dataset,
studioBasePath: '/admin',
useCdn: false,
}),
],
devToolbar: {
enabled: false,
},
});