Nuxt
@module-federation/nuxt is a Nuxt module that wires Module Federation into Nuxt hosts and remotes. It uses @module-federation/vite with Nuxt's default Vite builder, or @module-federation/enhanced/rspack when the app uses the Rspack builder, so you configure federation once in nuxt.config.ts regardless of the builder.
@module-federation/nuxt is still in beta, and its API may change while the integration settles. Please report bugs and edge cases in module-federation/nuxt.
Supports
- Nuxt
>=4.5.1with the default Vite builder or a matching@nuxt/rspack-builder - Node.js
^22.18.0,^24.11.0, or>=26.0.0 - Server-rendered remote components in development and production on writable Node deployments
- Convention-based component exposes from
~/components/exposed - Remote Vue components registered for Nuxt template auto-imports
vueandvue-routershared as singletons by default
Installation
Install the module in both the host and the remote:
Configure a remote
Register the module and give every deployed container a unique name:
Components placed in app/components/exposed are exposed automatically. For example, app/components/exposed/ProductCard.vue is exposed to hosts as ./ProductCard.
You can also configure exposes directly. Relative paths resolve from the Nuxt application root:
Configure a host
The exposed component is then available through Nuxt's component auto-imports:
During setup, the module fetches each remote's mf-manifest.json and registers its component exposes. remoteComponents is the fallback list used when the manifest cannot be reached, such as when the remote is deployed separately from the host build.
Prefer manifest URLs for SSR hosts: the runtime uses the manifest to pick the browser or server entry, and can detect a new server build without restarting the host.
Component names
With a single remote, ./ProductCard becomes RemoteProductCard. With multiple remotes, the remote name is included to avoid collisions, so catalog/ProductCard becomes RemoteCatalogProductCard.
Only expose names that start with a letter and contain letters, numbers, underscores, or hyphens are registered as Nuxt components. Other exposes remain available through normal runtime imports.
Server rendering
Remote components render on the Nuxt server by default. A production remote publishes both remoteEntry.js for the browser and remoteEntry.ssr.js for the server; the host loads the server entry while rendering, includes the remote HTML in its response, and hydrates the same component in the browser.
The default SSR loader writes fetched modules to node_modules/.ssr-cache below the server working directory. For read-only or serverless deployments, turn remote SSR off:
If a remote fails during a server request, the host renders an empty fallback for that request so the page still responds, and later requests retry the remote.
Remote SSR executes the remote's server entry with the host process's privileges. Only configure trusted remotes, and use direct HTTPS URLs in production.
Shared dependencies
When config.shared is not set, vue and vue-router are shared as singletons using their installed versions. Provide config.shared to override the defaults:
Use the Rspack builder
Vite is the default. To use Rspack, install @nuxt/rspack-builder at the same version as Nuxt and set builder: 'rspack' in the app:
Both builders use the same moduleFederation configuration and can consume each other's manifests. Vite-only options such as hostInitInjectLocation are ignored by Rspack.
Options
Configure these values under moduleFederation in nuxt.config.ts:
See the package reference for typed remote components, Bridge application exports, and the full deployment contract.
Examples
- module-federation/nuxt example apps: Vite and Rspack hosts and remotes
- Nuxt host and remote: Nuxt 4 with SSR remote components