
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGreat to hear the monorepo setup worked out of the box! Yes, you can absolutely change the dist path for the build.
According to the Sanity CLI build reference, the sanity build command accepts an optional OUTPUT_DIR argument:
sanity build [OUTPUT_DIR]So you can simply specify your root dist folder:
sanity build ../../dist
# or whatever relative path points to your root dist folderYou can also add this to your package.json scripts in the Studio package:
{
"scripts": {
"build": "sanity build ../../dist"
}
}The build command also supports several useful flags:
--source-maps - Enable source maps (increases bundle size)--no-minify - Skip minification (faster builds, larger bundles)-y, --yes - Unattended mode for CI/CDYour suggestion about adding the build command to package.json during sanity init is excellent feedback! Currently, when you run sanity init, it does create a package.json but the build script isn't always included by default. This would definitely be a helpful addition for developers, especially those working with monorepos.
You might want to share this feedback directly with the Sanity team through their community Slack or by opening a feature request on their GitHub repository. The team is quite responsive to community suggestions!
For monorepo setups specifically, you might also want to look into using workspace-level scripts or tools like Turborepo/Nx to manage builds across packages if you haven't already.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store