-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
48 lines (45 loc) · 1.38 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
import react from "@astrojs/react";
import tailwind from "@astrojs/tailwind";
import vercel from "@astrojs/vercel/serverless";
import sanity from "@sanity/astro";
import { defineConfig } from "astro/config";
import { loadEnv } from "vite";
// Use loadEnv to load environment variables
import sitemap from "@astrojs/sitemap";
const { PUBLIC_SANITY_STUDIO_PROJECT_ID, PUBLIC_SANITY_STUDIO_DATASET } =
loadEnv(import.meta.env.MODE, process.cwd(), "");
// Get project id & dataset
const projectId = PUBLIC_SANITY_STUDIO_PROJECT_ID;
const dataset = PUBLIC_SANITY_STUDIO_DATASET;
// https://astro.build/config
export default defineConfig({
// Hybrid+adapter is required to support embedded Sanity Studio
output: "hybrid",
// Don't use vercel web analytics config here (use inject) cannot customize scriptSrc to avoid adblockers
adapter: vercel(),
site: "https://dewodt.com",
image: {
remotePatterns: [
{
protocol: "https",
hostname: "cdn.sanity.io",
pathname: "/images/**",
},
],
},
integrations: [
react(),
tailwind(),
sitemap(),
sanity({
projectId,
dataset,
studioBasePath: "/admin",
useCdn: false,
// Statically build no need cdn
apiVersion: "2024-04-19",
// Set to date of setup to use the latest API version
perspective: "published", // Use the published dataset
}),
],
});