Working with a Version 3 Sanity project to provide backend data.
However, I noticed that there are two files that deals with project settings/configurations.
PROJECT_DIR/sanity.config.js
- included from startupPROJECT_DIR/sanity.json
- not included from startup
My question are
- What is the difference between the two
- How should I handle duplicate settings such as
plugins
that are already defined insanity.config.js
, do I define them again insanity.json
?
Please help, as I cannot find any documentation that addresses my questions above,
An example taken from sanity docs sanity.json
{
"root": true,
"project": {
"name": "Movies",
"basePath": "/studio"
},
"api": {
"projectId": "<yourProjectID>",
"dataset": "production"
},
"plugins": [
"@sanity/base",
"@sanity/components",
"@sanity/default-layout",
"@sanity/default-login",
"@sanity/desk-tool",
"@sanity/google-maps-input"
],
"parts": [
{
"name": "part:@sanity/base/schema",
"path": "./schemas/schema.js"
}
]
}
And an example from my project sanity.config.js
import {defineConfig} from 'sanity'
import {deskTool} from 'sanity/desk'
import {visionTool} from '@sanity/vision'
import {schemaTypes} from './schemas'
export default defineConfig({
name: 'default',
title: 'app-title',
projectId: '<project-id>',
dataset: 'production',
plugins: [deskTool(), visionTool()],
schema: {
types: schemaTypes,
},
})
Would I still include "@sanity/desk-tool"
in my sanity.json
if deskTool() is already added within the plugins array in sanity.config.js