npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@module-federation/rstest

v2.9.0

Published

Module Federation plugin for Rstest.

Readme

@module-federation/rstest

Module Federation integration for Rstest Node, JSDOM, and browser test environments.

Installation

npm install --save-dev @module-federation/rstest @rstest/core

Use @rstest/[email protected] or newer. That release includes Rstest's federation support (web-infra-dev/rstest#1407).

Usage

Node and JSDOM

import { federation } from '@module-federation/rstest';
import { defineConfig } from '@rstest/core';

export default defineConfig({
  plugins: [
    federation({
      name: 'main_app_web',
      remotes: {
        'component-app': 'component_app@http://localhost:3001/remoteEntry.js',
      },
      shared: {
        react: { singleton: true },
        'react-dom': { singleton: true },
      },
    }),
  ],
});

For Node test environments, the plugin enables Rstest's federation compatibility mode automatically. Do not also set federation: true in rstest.config.*.

If the test project already uses @module-federation/rsbuild-plugin, reuse that configuration instead of declaring the options twice:

import { createModuleFederationConfig, pluginModuleFederation } from '@module-federation/rsbuild-plugin';
import { federation } from '@module-federation/rstest';
import { defineConfig } from '@rstest/core';

const options = createModuleFederationConfig({
  name: 'main_app_web',
  remotes: {
    'component-app': 'component_app@http://localhost:3001/remoteEntry.js',
  },
});

export default defineConfig({
  plugins: [
    pluginModuleFederation(options, {
      environment: 'rstest',
      target: 'node',
    }),
    federation(),
  ],
});

Register the Rsbuild plugin first. federation() then applies the Rstest defaults to the same typed options and creates a single compiler plugin.

For both Node and browser targets, dts, manifest, and dev default to false; explicit values are preserved.

The plugin applies these Node defaults:

  • target: async-node
  • experiments.asyncStartup = true
  • CommonJS library output (library.type = 'commonjs-module'); module and modern-module library types are normalized
  • Node runtime plugin (@module-federation/node/runtimePlugin)
  • experiments.optimization.target = 'node'
  • Script remote transport (remoteType = 'script'); inline prefixes such as commonjs ... still override the default

Browser Mode

Install @rstest/browser and a Playwright browser before enabling Browser Mode. See Rstest's Browser Mode setup.

import { federation } from '@module-federation/rstest';
import { defineConfig } from '@rstest/core';

export default defineConfig({
  browser: {
    enabled: true,
    provider: 'playwright',
  },
  plugins: [
    federation({
      name: 'browser_host',
      remotes: {
        app2: 'app2@http://localhost:3001/remoteEntry.js',
      },
    }),
  ],
});

Browser Mode is detected from Rstest's resolved browser.enabled configuration. In browser target mode, node-only defaults are not applied. experiments.asyncStartup remains enabled.

The plugin name is rstest:federation, exported as FEDERATION_PLUGIN_NAME.

Real-world Example

Rstest's federation example tests an HTTP component remote and a locally built CommonJS remote from Node and JSDOM projects. It covers both static and dynamic remote imports.

Documentation

See the Rstest integration guide for configuration details.