-
Notifications
You must be signed in to change notification settings - Fork 0
/
sanity.config.ts
33 lines (30 loc) · 997 Bytes
/
sanity.config.ts
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
// Different environments use different variables
const projectId =
import.meta.env.PUBLIC_SANITY_STUDIO_PROJECT_ID! ||
import.meta.env.PUBLIC_SANITY_PROJECT_ID!
const dataset =
import.meta.env.PUBLIC_SANITY_STUDIO_DATASET! || import.meta.env.PUBLIC_SANITY_DATASET!
// Feel free to remove this check if you don't need it
if (!projectId || !dataset) {
throw new Error(
`Missing environment variable(s). Check if named correctly in .env file.\n\nShould be:\nPUBLIC_SANITY_STUDIO_PROJECT_ID=${projectId}\nPUBLIC_SANITY_STUDIO_DATASET=${dataset}\n\nAvailable environment variables:\n${JSON.stringify(
import.meta.env,
null,
2,
)}`,
)
}
import { visionTool } from "@sanity/vision"
import { defineConfig } from "sanity"
import { structureTool } from "sanity/structure"
import { schemaTypes } from "./schema"
export default defineConfig({
name: "APRO",
title: "APRO - admin",
projectId,
dataset,
plugins: [structureTool(), visionTool()],
schema: {
types: schemaTypes,
},
})