Read a local blueprint and the ids of the Stack it deploys to
Ids come from overrides, the environment, defineBlueprint, then .sanity/blueprint.config.json. Resources are not validated. No network access.
overrides
defineBlueprint
.sanity/blueprint.config.json
import {readBlueprint} from '@sanity/blueprints/resolve'const {resources, resourcesByName, stackId, sources} = await readBlueprint()resources.map((resource) => resource.name)resourcesByName['production-dataset']?.type // 'sanity.project.dataset'sources.stackId // 'config' Copy
import {readBlueprint} from '@sanity/blueprints/resolve'const {resources, resourcesByName, stackId, sources} = await readBlueprint()resources.map((resource) => resource.name)resourcesByName['production-dataset']?.type // 'sanity.project.dataset'sources.stackId // 'config'
When no blueprint file is found, it cannot be loaded, or resources is not an array
resources