JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 980
  • Score
    100M100P100Q93791F
  • License MIT

Module federation vite plugin for the Sanity Content Operating System

Package Exports

  • @sanity/federation/package.json
  • @sanity/federation/runtime
  • @sanity/federation/vite

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 builds

Vite plugin

The Vite plugin composes three internal plugins:

  1. sanity/environment — registers a federation build environment with Rollup, outputting to dist/federation/.
  2. sanity/federation-runtime — for studios, generates a .sanity/federation/remote-entry.jsx entry file that wraps the Sanity Studio component.
  3. @module-federation/vite — the upstream Module Federation plugin, configured with the resolved exposes map 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