Yes:
// sanity.config.js
import { defineConfig } from "sanity";
import { deskTool } from 'sanity/desk'
import schemas from './schemas/schema'
import { visionTool } from '@sanity/vision'
import deskStructure from './src/structure/deskStructure'
import dashboard from './src/dashboardConfig'
export default defineConfig({
title: "Testing Sanity v3",
projectId: "zfgtf7ck",
dataset: "production",
plugins: [
deskTool({
structure: deskStructure
}),
visionTool(),
],
tools: (prev) *=>* {
// π Uses environment variables set by Vite in development mode
if (<http://import.meta.env.DEV|import.meta.env.DEV>) {
return prev
}
return prev.filter((tool) *=>* tool.name !== 'vision')
},
schema: {
types: schemas,
},
document: {
newDocumentOptions: (prev, { creationContext })
*=>* {
if (creationContext.type === 'global') {
return prev.filter((templateItem)
*=>* templateItem.templateId != 'siteSettings')
}
return prev
},
actions: (prev, { schemaType })
*=>* {
if (schemaType === 'siteSettings') {
return prev.filter(({ action })
*=>* !['unpublish', 'delete','duplicate'].includes(action))
}
return prev
},
},
});