When will custom webpack configuration feature be released?
I understand you're seeing some code in a repository that references webpack configuration customization and @sanity/server, and you're wondering when it will be released or how to install from a specific commit.
First, let me clarify the current state of Sanity Studio's build tooling: Sanity Studio has used Vite (not webpack) since Studio v3 was released in January 2023. The @sanity/server package was part of the older Studio v2 architecture and is no longer actively developed.
However, I want to acknowledge that you're seeing specific code in a repository, and there could be a few scenarios here:
If you're looking at the main Sanity repository:
- It's possible you're seeing legacy code or tooling that's maintained for backward compatibility
- Some internal tooling or testing infrastructure might still use webpack
- Without seeing the specific commit or file, it's hard to say exactly what you're looking at
For customizing the build configuration in modern Sanity Studio, you'll want to work with Vite configuration instead. This is done in your sanity.config.ts (or .js) file:
// sanity.config.ts
import {defineConfig} from 'sanity'
export default defineConfig({
// Your project settings
projectId: 'your-project-id',
dataset: 'production',
// Custom Vite configuration
vite: {
// Your custom Vite configuration here
// This gets merged with Sanity's defaults
}
})According to the Sanity documentation on Vite, custom Vite configuration is automatically merged with Sanity's default configuration using Vite's merge logic.
Regarding installing from a specific commit in a monorepo:
If you really need to install a package from a specific GitHub commit, you can reference it in your package.json:
{
"dependencies": {
"sanity": "sanity-io/sanity#commit-hash"
}
}However, this approach has limitations with monorepos since it will try to install the entire repository, not a specific package within it.
My recommendation: Before trying to install unreleased code, I'd suggest reaching out on the Sanity Slack community or opening a GitHub issue to clarify:
- What specific functionality you're trying to access
- Whether what you're seeing is actually intended for public release
- What your actual use case is - there may be a better modern approach using Vite configuration
Could you share the specific GitHub URL or commit you're referencing? That would help the community provide more specific guidance on whether this is something you should be using and when it might be officially released. The Sanity team is pretty responsive on Slack and can let you know if there's a timeline for any webpack-related features you might be seeing in the codebase.
Show original thread1 reply
Sanity – Build the way you think, not the way your CMS thinks
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.