@sanity/federation
v0.1.0-alpha.9
Published
Module federation vite plugin for the Sanity Content Operating System
Downloads
2,042
Readme
@sanity/federation
Internal package providing Module Federation support for Sanity apps and studios. Used by the Sanity CLI — not intended for direct consumption.
Structure
src/
runtime/ → Runtime utilities for federated modules
vite/ → Vite plugin for federation buildsVite plugin
The Vite plugin composes three internal plugins:
sanity/environment— registers afederationbuild environment with Rollup, outputting todist/federation/.sanity/federation-runtime— for studios, generates a.sanity/federation/remote-entry.jsxentry file that wraps the Sanity Studio component.@module-federation/vite— the upstream Module Federation plugin, configured with the resolvedexposesmap and manifest generation.
Entry resolution
| Mode | Entry point |
| ------ | --------------------------------------- |
| App | ./src/App.tsx |
| Studio | ./.sanity/federation/remote-entry.jsx |
The exposes map always includes ./App pointing at the resolved entry. Additional entries passed via the exposes option are merged on top.
License
MIT
